6

I've added stuff to my ~/.kube/config which doesn't appear when I do:

microk8s.kubectl config view

I'd like to use Microk8s with the default config file location.

Is this possible?

LondonRob
  • 73,083
  • 37
  • 144
  • 201
  • I got the same problem and noticed that if you use kubectl from `snap install kubectl` it works as expected. In my case it doesn't work even when you set it in cmd line (as suggested by @Aghya Sadhy – Alessandro Dentella Feb 22 '21 at 21:01

1 Answers1

3

It is possible in the latest snap version (1.14.1) by editing /var/snap/microk8s/current/args/kubectl and changing --kubeconfig to point to your own preferred config file, or in my case:

--kubeconfig=${KUBECONFIG}

Arghya Sadhu
  • 41,002
  • 9
  • 78
  • 107
  • As I wrote above this wan't enought in my case. BTW: rel 1.20.1 doesn't accept `--kubeconfig ${KUBECONFIG}` and requires `--kubeconfig ${KUBECONFIG}` – Alessandro Dentella Feb 22 '21 at 21:01