kubernetes / minikube

Run Kubernetes locally
https://minikube.sigs.k8s.io/
Apache License 2.0
29.35k stars 4.87k forks source link

Run minikube as root #11383

Closed Oliver-Sellwood closed 3 years ago

Oliver-Sellwood commented 3 years ago

Hi I am looking for a way to run minikube as root with the Docker driver. In my workflow I am using sysbox system containers to help separate different projects I'm working on. Going great so far but trying to run minikube within one of these containers I get the error that it cannot be run as root.

Since I'm already inside a container when running minikube I don't really care if it has root and it's a little painful to have to create a user and deal with that side of things.

Given this situation is there any more danger in running minikube as root that I'm not considering and if I decide to go ahead anyway is there any way to force minikube to run as root

afbjorklund commented 3 years ago

Same as #8257

Oliver-Sellwood commented 3 years ago

oh yup, my bad. the --force flag does the job.

Thanks

afbjorklund commented 3 years ago

Our main issues came from people running sudo minikube, which creates a mixture of files and directories owned by different users (both user and root). Running the entire process as root from start to finish "works", it's just considered as bad practice.

But when you have a dedicated virtual machine or a dedicated system container, it's a little different from running as root on your laptop. So maybe that scenario needs special handling, but it's also a bit different and has some usability* concerns as well.

* Like when trying to edit a file, or open a link. Need to be comfortable with the terminal.

I would prefer if we could document on how to set these CLI environments up "properly". For advanced use cases, like this.

afbjorklund commented 3 years ago

@Oliver-Sellwood : note that you are effectively running docker-in-docker-in-docker here