How to set and use a kubeconfig in Kubernetes
The kubeconfig file is the main configuration file that allows access to a Kubernetes cluster.
When you first create your Kubernetes cluster, you are given a generated yaml file.
How to configure the kubeconfig file
The kubectl CLI has the followings preference in which kubeconfig file to use:
- by adding the
--kubeconfig <file> - by setting a
KUBECONFIGenvironment variable - by using the
$HOME/.kube/configfile on the local machine