Commands

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

Bootstrap a new Kubernetes cluster by generating certificates, configuring service arguments, and starting 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 certs-status

Display certificate and certificate authority expiration details

Synopsis

Display detailed information about certificate and certificate authority expiration dates, including residual time until expiration.

k8s certs-status [flags]

Options

  -h, --help               help for certs-status
      --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 one or more core cluster features

Synopsis

Disable one or more core cluster features.

Available features: 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 one or more core cluster features

Synopsis

Enable one or more core cluster features.

Available features: 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

Synopsis

Create a join token that allows a new node to join the cluster. The node name is required for control plane nodes but optional for worker nodes.

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 from a cluster control plane for a worker node. Specifying the node name of the worker node is optional

k8s get

Get cluster configuration

Synopsis

Get the cluster configuration for a specific feature. If no feature is specified, display all configuration.

Available features: 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

Synopsis

Join a new node to an existing cluster using a join token obtained from a control plane node.

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

Synopsis

Run kubectl commands against the cluster using the integrated kubectl client.

k8s kubectl [flags]

Options

  -h, --help   help for kubectl

k8s remove-node

Remove a node from the cluster

Synopsis

Gracefully 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

Set cluster configuration for one or more features.

Available features: 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, including node information and the 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

k8s refresh-certs

Refresh the certificates of the running node

Synopsis

Refresh the certificates of the running node. This can be used to renew expiring certificates or update certificates with new SANs.

k8s refresh-certs [flags]

Options

      --certificates strings           List of certificates to renew in the cluster (must be used with --expires-in). Defaults to all certificates.
                                       Allowed values:
                                       Worker nodes: kubelet, kubelet.conf, proxy.conf
                                       Control Plane nodes: admin.conf, apiserver, apiserver-kubelet-client, controller.conf, front-proxy-client, kubelet, kubelet.conf, proxy.conf, scheduler.conf
      --expires-in string              the time until the certificates expire, e.g., 1h, 2d, 4mo, 5y. Aditionally, any valid time unit for ParseDuration is accepted.
      --external-certificates string   path to a YAML file containing external certificate data in PEM format. If the cluster was bootstrapped with external certificates, the certificates will be updated. Use '-' to read from stdin.
      --extra-sans stringArray         extra SANs to add to the certificates.
  -h, --help                           help for refresh-certs
      --timeout duration               the max time to wait for the command to execute (default 1m30s)

k8s completion

Generate the autocompletion script for the specified shell

Synopsis

Generate the autocompletion script for k8s for the specified shell. See each sub-command’s help for details on how to use the generated script.

Options

  -h, --help   help for completion