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
KUBECONFIG
environment variable - by using the
$HOME/.kube/config
file on the local machine