Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

cargoship kube-config

Get the admin kube-config for a control-plane node

Synopsis

Fetches the engine’s admin credentials from the first control-plane node the cluster configuration names and merges them into a kubeconfig file. The file is created when it does not exist, and an existing one keeps every other cluster it already holds.

The server address is rewritten to the control-plane address the configuration declares, rather than the node the credentials came from, so the context keeps working when that node does not. The context is named after the cluster’s metadata.name.

This changes no host – it connects, reads, and writes a file locally – so it needs no –confirm. The file written to is –kubeconfig, which defaults to KUBECONFIG when that is set and to the standard location otherwise.

cargoship kube-config [flags]

Examples

# Fetch the admin kubeconfig from an RKE2 control-plane node
$ cargoship kube-config --config ./cargoship-config.yaml --distro rke2

# Fetch it from a K3s cluster
$ cargoship kube-config --config ./cargoship-config.yaml --distro k3s

# Use the distro set in the resolved cargoship config
$ cargoship kube-config --config ./cargoship-config.yaml

Options

      --config string       Config file used to bootstrap a cluster.
  -D, --distro string       What type of distro we will get the admin config from. Valid options are: 'rke2', 'k3s'.
  -h, --help                help for kube-config
      --kubeconfig string   Path of the kubeconfig file to merge the admin creds for this cluster into. The file is created when it does not exist, and an existing one keeps every other cluster it holds. Defaults to the standard location: KUBECONFIG when set, otherwise ~/.kube/config.

Options inherited from parent commands

      --log-file            Always write a full-verbosity debug log to a file, regardless of --log-level.
  -L, --log-format string   Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console")
  -l, --log-level string    Log level when running cargoship. Valid options are: warn, info, debug, trace (default "info")
      --no-color            Disable terminal color codes in logging and stdout prints.

SEE ALSO