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.

microk8s.kubectl requires sudo

See original GitHub issue
$ snap info microk8s
installed:        v1.15.3                    (778) 171MB classic
$ microk8s.kubectl 
You do not have enough permissions to access MicroK8s. Please try again with sudo.

I noticed in the beta that microk8s.kubectl requires sudo (possibility related to #590). Is there a way to add a user to a group or something so that they don’t need to type sudo constantly?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

19reactions
amozosscommented, Sep 11, 2019

After updating, I now get this message

$ microk8s.kubectl 
Insufficient permissions to access MicroK8s.
You can either try again with sudo or add the user dan to the 'microk8s' group:

    sudo usermod -a -G microk8s dan

The new group will be available on the user's next login.

I was able to resolve this issue by adding myself to the microk8s group, as suggested by the error message.

sudo usermod -a -G microk8s ${USER}
# open a new shell for the user, with updated group membership 
su - ${USER}
4reactions
ktsakalozoscommented, Aug 21, 2019

There is no specific group. In https://github.com/ubuntu/microk8s/blob/feature/dev-docs/docs/access-without-sudo.md you can see a few methods to work around the sudo requirement including one that lets you permit your user/group to access critical files.

Read more comments on GitHub >

github_iconTop Results From Across the Web

microk8s.kubectl requires sudo · Issue #606 - GitHub
I noticed in the beta that microk8s.kubectl requires sudo (possibility related to #590). Is there a way to add a user to a...
Read more >
Microk8s sudo requirements - CircleCI Discuss
With the upcoming v1.15.3 release, MicroK8s commands will require the use of sudo whenever elevated privileges are needed. For example, microk8s ...
Read more >
Get started - MicroK8s
MicroK8s will install a minimal, lightweight Kubernetes you can run and use on practically any machine. It can be installed with a snap:...
Read more >
Working with kubectl - MicroK8s
MicroK8s is the simplest production-grade upstream K8s. Lightweight and focused. Single command install on Linux, Windows and macOS.
Read more >
Command reference - MicroK8s
Retrieves and outputs the current config information from MicroK8s (similar to that returned by kubectl ). Examples: microk8s config.
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