microk8s icon indicating copy to clipboard operation
microk8s copied to clipboard

Improve warning message when not using sudo

Open aleksandaratanasov opened this issue 2 years ago • 3 comments

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.

aleksandaratanasov avatar Feb 08 '23 19:02 aleksandaratanasov

Hey @aleksandaratanasov, Are you proposing that instead of the current message, we instead show the message to use a superuser shell?

sachinkumarsingh092 avatar Feb 09 '23 07:02 sachinkumarsingh092

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.

stale[bot] avatar Jan 05 '24 10:01 stale[bot]

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.

aleksandaratanasov avatar Jan 09 '24 13:01 aleksandaratanasov