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:
--kubeconfigcommand-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).$KUBECONFIGenvironment variable. In this case, a list of files can be provided andkubectlwill merge them. A list of paths can be provided, delimited with your filesystem's default path separator.- Default
.kube/configfile located in the local user's directory. If none of the other options is active,kubectlwill only use this file with no merging.
Where is the default Kubeconfig in Linux?
The default location of .kube/config file is:
~/.kube/configWhere is the default Kubeconfig in Windows?
The default location of .kube/config file is:
%USERPROFILE%\.kube\configWhere is the default Kubeconfig in Mac?
Just like in Linux, the default location of .kube/config file is:
~/.kube/config