Home > Net >  Microk8s kubectl alias
Microk8s kubectl alias

Time:07-29

I am new to microk8s, it's a wonderful and easy approach to setup k8s, just one thing which is quite annoying which is to use microk8s everytime before the kubectl command, is there any way to use kubectl directly or make it a alias.

For eg to run kubectl command, I've to use microk8s everytime ==> microk8s kubectl get pods

Thanks!

CodePudding user response:

Yeah, there is a way to create an alias for kubectl in microk8s, run this command

sudo snap alias microk8s.kubectl kubectl

and you will be able to use kubectl directly.

  • Related