microk8s
microk8s copied to clipboard
Improve warning message when not using sudo
Summary
This feature is a direct result from #606 and the solution provided there. After the initial default installation (e.g. installing microk8s from the Ubuntu Server installer) if a user runs microk8s
without sudo
, they will automatically get the following message:
You can either try again with sudo or add the user <USER> to the 'microk8s' group:
sudo usermod -a -G microk8s <USER>
sudo chown -R <gin> ~/.kube
After this, reload the user groups either via a reboot or by running 'newgrp microk8s'.
As mentioned in #606 the first part of the solution is correct (adding the user to the group), however the second regarding ~/.kube
is not, since for a default setup there is no such folder. Again as proposed in #606, a simple
su - ${USER}
would suffice.
Why is this important?
Allows users to easily remove the requirement for using sudo
using correct step-by-step guide that is provided by microk8s itself.
Hey @aleksandaratanasov, Are you proposing that instead of the current message, we instead show the message to use a superuser shell?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hey @aleksandaratanasov, Are you proposing that instead of the current message, we instead show the message to use a superuser shell?
Would be a possible solution I think. Needs to be evaluated by more people though.
PS: Sorry for the late reply. Completely forgot about this issue.