CLI Cluster Management

Adding New Clusters

To create and provision a Kubernetes cluster definition and connection, use the cluster add command.

You can use cluster by providing a YAML file.

A sample minimalistic YAML file to connect a cluster without Istio ingress

name: eks-cluster
endpoint:
  addresses:
  - https://E8121262014D66818F6B1E5E121212.gr7.us-west-1.eks.amazonaws.com
  caCert: |-
    -----BEGIN CERTIFICATE-----
    MIICyDCCAbCgAwIBAgIBASSSBgkqhkiG9w0BAQsFADAVMRMwEQYDVQQDEwprdWJl
    cm5ldGVzMB4XDTIxMDUyNTE4NDkzNloXDTMxMDUyMzE4NDkzNlowFTETMBEGA1UE
    AxMKa3ViZXJuZXRlczCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL2e
    kpnFSDqSB7W9itPLIOx3CyCfRaEEZkqpmRscgoiM9Mly/hDHEQ4ycHEepxC20ubT
    hNOc3+lQ6A2DDU9CM2QT0XqblPuOnLjJBTYY2TCXaT2+LJavuSrSF7JcglkDByCK
    oi40vHbheNzTYYlx8AEhVDEECr6xbLUjo21wXaY6w0SPB6a/sWe7P2JdhJ6oySVP
    etl+1l//wV8OK1rxUyhK8ZvXsnYog4fbolOeUk6olnUV9GfZS/mcI76M/R/4K5IB
    SUBb6/MgfDOw4mX1XQZjnRGkxWH1zpirg+0S9BeiNKmW/BEuMFHSrpTEEorjdFmX
    J2lLcNHeeBg/xonhhmMCAwEAAaMjMCEwDgYDVR0PAQH/BAQDAgKkMA8GA1UdEwEB
    /wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAApxsdF3JacMq6nByz5XzzoOUt2Y
    UGEnUX/Ui3+icafIXJl+xdgHYtdAYuiLpeTxqLM+/XvYQhjiJLbt+zqsaWh7zedU
    qCpUwa014nHg1zQUQwvxxtf8bDXMpPQu7qiVkFU3bS60Fjz2cqZfM4xYiEDEOeMZ
    Z9+9k4eYteUj8mozv7tfue78hhr6enBCNgWxeHTkRFT6SBttbONBJh0m9OPQAl2c
    NHfSF4222OS6Hm2Gs+PDlFn81K+Q/CDfnEL6Dz1sFBRDpzk0M7q+iKHw1EcPQcSq
    Moy2Tl2FmUD0TgVby2iZCM+Op68KDj6paQFnpuC+TQR/1Stpm0gdWJO00Ps=
    -----END CERTIFICATE-----
  token: eyJhbGciOiJSUzI1NiIsImtpZ3dja0ZIUUxOSzdiMjU3TWE3WjFNT3duNnNUYWZZVE0ifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrdWJlLXN5c3RlbSIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJzaGlwYS1hZG1pbi10b2tlbi1jdDY3OSIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50Lm5hbWUiOiJzaGlwYS1hZG1pbiIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50LnVpZCI6ImRkYjcyNjhhLTgwZTQtNDU2NC1hNTM5LTIyMGRjODFhZTRkNiIsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDprdWJlLXN5c3RlbTpzaGlwYS1hZG1pbiJ9.UzOADUy3vEsQ8EjiPFHh_sSpZ3WP-4JUxpIH0e0ZYbIUMMtgdnSktlf0rTjj794jqfjsJ_7FQLD_MlE-GpOx6jT1kpjudi-PqDKvMtp7P_8ajon-_mZ6o-MkRx4z3Ji55OxwIQHWVb6UWQDcdHlJZDsh02ld0a6kgDXDdQySmwiKYl6TvI4ik0toMtW6K_KCmgHG6kO0yEWdVBbCFfGW2U3h6SpnTbQVPz3mcjW6Z2OgH6Z2I2s7U08JG3eLtCD8znup-snowquSrE0zfQJDp21FTh6tvmtiIxkqYwO0iT13bYbEaynSkGCJi5YtFgIPEmU6AuwZjccJcUau-reQJQ
resources:
  frameworks:
  - name: framework1

Sample cluster.yaml with Istio ingress

name: eks-cluster
endpoint:
  addresses:
  - https://E8121262014D66818F6B1E5E121212.gr7.us-west-1.eks.amazonaws.com
  caCert: |-
    -----BEGIN CERTIFICATE-----
    MIIDKzCCAhOgAwIBAgIRAM5hLK3U0CJSdwai7J6xTPAwDQYJKoZIhvcNAQELBQAw
    LzEtMCsGA1UEAxMkYTBhM2Y2ZGEtNmEzNC00ODZmLThmMTAtNmRmYjc3NTgyODg4
    MB4XDTIxMDYwMjIyMTIxOVoXDTI2MDYwMTIzMTIxOVowLzEtMCsGA1UEAxMkYTBh
    M2Y2ZGEtNmEzNC00ODZmLThmMTAtNmRmYjc3NTgyODg4MIIBIjANBgkqhkiG9w0B
    AQEFAAOCAQ8AMIIBCgKCAQEApwL/zfgu0Lj6gQqvhXZv2Lh6TBMTB6qWSr7nzYQx
    ELiV51cd63F/Qg50Dyw0eXFORybfHP+vMSc7YRoxRYRTiC+xKxzj6WbR/vGeaYa7
    wnL0GnY7d1HeIs7s2UxABwtCr1q3x4QTRZE1Ke2kMWe47okTYS67LQiup5tvAix4
    0jpHeCrvCUv3wbgL9ThRyIq9Nf5h/TiT5yNVPfgy4hxcmowNiLM251huMIjbHjcB
    VJcDIKSgo584yTww283+kwSBFsQLBWom8j18YtMBMvshFwyKsQutufrRzZ7tGof7
    +OtqIV7IY95ABWOgxENkgQyIUSbVQQU9MwFbKkwHgz2tXwIDAQABo0IwQDAOBgNV
    HQ8BAf8EBAMCAgQwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUrsXUxidp8uuj
    rT4HGrkIVbi7sdsdowDQYJKoZIhvcNAQELBQADggEBAAgNGVCzUvfIungPI/BQlHZl
    YFZth9OZIAx3oIGEOPgwAg0EjQyN8/JNX4d+KKFXSGR66GO8l2hraka1TzVWmVG3
    OOtgASw8qiD2uD2ExfDVne27FvgffuqIkHdNnuq1JTHpBbefE3BZLIZSDl/0NVm8
    VB/NQJqpaXG9B8rKaLH9TZ057dYX4QRun8BR2H+m9wuPJKJ7dwD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6c8j3k9JeQ
resources:
  frameworks:
  - name: framework1
  - name: istio
  ingressControllers:
  - ingressIp: E8121262014D66818F6B1E5E34341212.gr7.us-west-1.eks.amazonaws.com
    serviceType: LoadBalancer
    type: istio

To add a cluster using YAML file with cluster details:

shipa cluster add --from-file cluster.yaml

You can also add clusters using command line parameters

shipa cluster add <name> [--addr address] [--framework frameworkname] [--cacert cacertfile] [--clientcert clientcertfile] [--clientkey clientkeyfile] [--ingress-service-type ingressservicetype] [--ingress-ip ingressip] [--ingress-port ingressport] [--token token] [--custom key=value]... [--create-data key=value]... [--default]

Flags:

Flag

Description

--addr

(= []) Kubernetes API URL address to be used in cluster creation/connection

--cacert

(= "") Path to CA cert file

--clientcert

(= "") Path to client cert file

--clientkey

(= "") Path to client key file

--custom

(= {}) Custom provisioner specific data

--default

(= false) Whether it should be used as the default cluster

--framework

(= []) Framework which will use the cluster

--ingress-ip

(= "") Ingress IP

--ingress-port

(= 0) Ingress port

--ingress-service-type

(= "") Ingress service type (LoadBalancer/ClusterIP/NodePort)

--token

(= "") Token that should be used to connectt to the cluster

--from-file

File that contains the configuration to apply

Updating Clusters

To update an existing cluster definition, use the cluster update command using cluster yaml file:

shipa cluster update --from-file cluster.yaml

Or you can use command line flags to add a cluster

shipa cluster update <name> --addr address... [--framework frameworkname]... [--token/-t token] [--cacert cacertfile] [--clientcert clientcertfile] [--clientkey clientkeyfile] [--custom key=value]... [--default]

Listing Clusters

To list registered clusters, use the cluster list command.

shipa cluster list

Removing Clusters

To remove a registered cluster, use the cluster remove command.

shipa cluster remove <name> [-y]

Removes a registered cluster.

Flags:

Flag

Description

-y, --assume-yes

(= false) Don't ask for confirmation


Did this page help you?