Command reference

These are the commands provided by the k8s snap:

k8s

Canonical Kubernetes CLI

Options

  -h, --help   help for k8s

k8s bootstrap

Bootstrap a new Kubernetes cluster

Synopsis

Generate certificates, configure service arguments and start the Kubernetes services.

k8s bootstrap [flags]

Options

      --address string         microcluster address or CIDR, defaults to the node IP address
      --file string            path to the YAML file containing your custom cluster bootstrap configuration. Use '-' to read from stdin.
  -h, --help                   help for bootstrap
      --interactive            interactively configure the most important cluster options
      --name string            node name, defaults to hostname
      --output-format string   set the output format to one of plain, json or yaml (default "plain")
      --timeout duration       the max time to wait for the command to execute (default 1m30s)

k8s config

Generate an admin kubeconfig that can be used to access the Kubernetes cluster

k8s config [flags]

Options

  -h, --help            help for config
      --server string   custom cluster server address

Options inherited from parent commands

      --output-format string   set the output format to one of plain, json or yaml (default "plain")
      --timeout duration       the max time to wait for the command to execute (default 1m30s)

k8s disable

Disable core cluster features

Synopsis

Disable one of network, dns, gateway, ingress, local-storage, load-balancer.

k8s disable [network|dns|gateway|ingress|local-storage|load-balancer] ... [flags]

Options

  -h, --help                   help for disable
      --output-format string   set the output format to one of plain, json or yaml (default "plain")
      --timeout duration       the max time to wait for the command to execute (default 1m30s)

k8s enable

Enable core cluster features

Synopsis

Enable one of network, dns, gateway, ingress, local-storage, load-balancer.

k8s enable [network|dns|gateway|ingress|local-storage|load-balancer] ... [flags]

Options

  -h, --help                   help for enable
      --output-format string   set the output format to one of plain, json or yaml (default "plain")
      --timeout duration       the max time to wait for the command to execute (default 1m30s)

k8s get-join-token

Create a token for a node to join the cluster

k8s get-join-token <node-name> [flags]

Options

      --expires-in duration   the time until the token expires (default 24h0m0s)
  -h, --help                  help for get-join-token
      --timeout duration      the max time to wait for the command to execute (default 1m30s)
      --worker                generate a join token for a worker node

k8s get

Get cluster configuration

Synopsis

Show configuration of one of network, dns, gateway, ingress, local-storage, load-balancer.

k8s get <feature.key> [flags]

Options

  -h, --help                   help for get
      --output-format string   set the output format to one of plain, json or yaml (default "plain")
      --timeout duration       the max time to wait for the command to execute (default 1m30s)

k8s join-cluster

Join a cluster using the provided token

k8s join-cluster <join-token> [flags]

Options

      --address string         microcluster address or CIDR, defaults to the node IP address
      --file string            path to the YAML file containing your custom cluster join configuration. Use '-' to read from stdin.
  -h, --help                   help for join-cluster
      --name string            node name, defaults to hostname
      --output-format string   set the output format to one of plain, json or yaml (default "plain")
      --timeout duration       the max time to wait for the command to execute (default 1m30s)

k8s kubectl

Integrated Kubernetes kubectl client

k8s kubectl [flags]

Options

  -h, --help   help for kubectl

k8s remove-node

Remove a node from the cluster

k8s remove-node <node-name> [flags]

Options

      --force                  forcibly remove the cluster member
  -h, --help                   help for remove-node
      --output-format string   set the output format to one of plain, json or yaml (default "plain")
      --timeout duration       the max time to wait for the command to execute (default 1m30s)

k8s set

Set cluster configuration

Synopsis

Configure one of network, dns, gateway, ingress, local-storage, load-balancer. Use k8s get to explore configuration options.

k8s set <feature.key=value> ... [flags]

Options

  -h, --help                   help for set
      --output-format string   set the output format to one of plain, json or yaml (default "plain")
      --timeout duration       the max time to wait for the command to execute (default 1m30s)

k8s status

Retrieve the current status of the cluster

Synopsis

Retrieve the current status of the cluster as well as deployment status of core features.

k8s status [flags]

Options

  -h, --help                   help for status
      --output-format string   set the output format to one of plain, json or yaml (default "plain")
      --timeout duration       the max time to wait for the command to execute (default 1m30s)
      --wait-ready             wait until at least one cluster node is ready