question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add microk8s.kubectl as an alias for kubectl

See original GitHub issue

This 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:closed
  • Created 5 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
johnscacommented, May 22, 2018

Ok, doing some more research, it looks like the snap doesn’t need to do anything to allow the user to do:

sudo snap alias microk8s.kubectl kubectl

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

sudo snap install --classic kubectl

Will fail with:

error: cannot install "kubectl": snap "kubectl" command namespace conflicts with alias "kubectl"
       for "microk8s" snap

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.

0reactions
cyrilthankcommented, Sep 18, 2019

Thanks for updating this patiently.

You are right it was all set and i just had to ignore the step and proceed

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found