Where does microk8s store kubectl config file?

Using microk8s 1.18 on Ubuntu 20.04

Kubernetes documentation on kubectl config states that the default location of the kubectl config file is ${HOME}/.kube/config

I can see the config by microk8s.kubectl config view. However, there is no file ~/.kube/config. Where is the location of that config file?

1 Like

You can extract the kubeconfig file with the microk8s config command.

The actual kubeconfig file is at /var/snap/microk8s/current/credentials/client.config

To change the kubeconfig file used by microk8s.kubectl you can edit /var/snap/microk8s/current/args/kubectl-env

1 Like