Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Microk8s kubectl alias

Tags:

kubernetes

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!

like image 761
Alex Avatar asked Aug 30 '26 15:08

Alex


1 Answers

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.

like image 179
Addy Avatar answered Sep 02 '26 18:09

Addy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!