I have installed Canonical Kubernetes from Snap using:
$ sudo snap install k8s --classic
And I can use it like:
$ sudo k8s kubectl get pods
NAME READY STATUS RESTARTS AGE
nginx-5869d7778c-r87sf 1/1 Running 0 14h
How can I use it without sudo and the k8s command, like:
$ kubectl get pods
Command 'kubectl' not found, did you mean:
command 'kubectx' from deb kubectx (0.9.5-1ubuntu0.2)
Try: sudo apt install <deb name>
Also, I would like an approach that can support bash-completion.
I was thinking of using the KUBECONFIG env var, but It seems that the kubectl is unknown to my command line and I also don't know the correct path for KUBECONFIG.
In addition, I was thinking of adding my user to the group, like how it can be done with microk8s, but there was no k8s group.