kubeconfig

The file that tells kubectl which clusters exist, which credentials to use, and which pairing of the two is currently selected.

It usually contains credentials, and a wrong current context sends commands to the wrong cluster.

In more detail

It holds three lists, clusters, users and contexts, plus a current-context pointer. The KUBECONFIG environment variable can point at a different file, or several separated by colons. Keeping a practice cluster in a kubeconfig of its own means no command can reach a cluster at work by accident.

Example

export KUBECONFIG=${TMPDIR:-/tmp}/kube-course.conf

Related terms

Taught in

References

Certification courses