Kubernetes: Where is my default Kubeconfig file?
Kubeconfig is the file used by kubectl
to retrieve the required configuration to access your Kubernetes cluster.
You can override the default Kubeconfig location by providing kubectl
with the --kubeconfig
flag or by setting a $KUBECONFIG
environment variable.
The default lookup order would be:
--kubeconfig
command-line flag. If set, only this file will be considered. n.b. only one instance of this flag is allowed (i.e. only one file can be loaded for a command execution).$KUBECONFIG
environment variable. In this case, a list of files can be provided andkubectl
will merge them. A list of paths can be provided, delimited with your filesystem's default path separator.- Default
.kube/config
file located in the local user's directory. If none of the other options is active,kubectl
will only use this file with no merging.
Where is the default Kubeconfig in Linux?
The default location of .kube/config
file is:
~/.kube/config
Where is the default Kubeconfig in Windows?
The default location of .kube/config
file is:
%USERPROFILE%\.kube\config
Where is the default Kubeconfig in Mac?
Just like in Linux, the default location of .kube/config
file is:
~/.kube/config