The default location of the Kubeconfig file is $HOME/.kube/configĪlso, kubernetes cluster components like controller manager, scheduler and kubelet use the kubeconfig files to interact with the API server.
When you use kubectl, it uses the information in the kubeconfig file to connect to the kubernetes cluster API. You might get this config file directly from the cluster administrator or from a cloud platform if you are using a managed Kubernetes cluster. A Kubeconfig is a YAML file with all the Kubernetes cluster details, certificates, and secret tokens to authenticate the cluster.