Add microk8s.kubectl as an alias for kubectl
See original GitHub issueThis would make it so if kubectl
wasn’t installed microk8s.kubectl
would become become linked to /snap/bin/kubectl
This would really help streamline adoption
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Get started - MicroK8s
If you don't have an existing install, it is easier to add an alias (append to ~/.bash_aliases ) like this: alias kubectl='microk8s kubectl'....
Read more >Add microk8s.kubectl as an alias for kubectl · Issue #20 - GitHub
It was my understanding that aliases were (planned to be?) moved out of the snapcraft.yaml definition to become store-only metadata?
Read more >Microk8s kubectl alias - kubernetes - Stack Overflow
Yeah, there is a way to create an alias for kubectl in microk8s, run this command. sudo snap alias microk8s.kubectl kubectl.
Read more >Create an alias for microk8s.kubectl as kubectl on Ubuntu
sudo snap alias microk8s.kubectl kubectl Sources: https://github.com/ubuntu/microk8s/issues/20.
Read more >Using official kubectl instead of microk8s.kubectl
Reason: I do have alias kubectl='microk8s.kubectl' and on the command line, the kubectl alias does work OK in interactive mode. However when ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok, doing some more research, it looks like the snap doesn’t need to do anything to allow the user to do:
We can also make a topic on the forum to request an auto-alias. If the microk8s.kubectl is aliased to kubectl, then trying to do
Will fail with:
This behavior seems less than ideal, but at least the error message is clear, even if it doesn’t explain exactly what to do to fix it. I am still not clear if it will fail in the other direction (i.e., if they already have the kubectl snap installed, if trying to install microk8s will fail if it has an auto-alias defined in the store), but I suspect it will just ignore the auto-alias. I’m not sure how to test that, though.
Thanks for updating this patiently.
You are right it was all set and i just had to ignore the step and proceed