Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add note in README file #713

Closed
prankul88 opened this issue Jul 17, 2019 · 8 comments · Fixed by #714
Closed

Add note in README file #713

prankul88 opened this issue Jul 17, 2019 · 8 comments · Fixed by #714
Assignees
Labels
kind/documentation Categorizes issue or PR as related to documentation.

Comments

@prankul88
Copy link
Member

What would you like to be documented:
In README file under Installation and usage, there might be a need to add a note for the requirement of running docker as a non root user (running without sudo).
Good idea to add a link too.

Why is this needed:
As a new user when I was trying to run kind create cluster, I got an error "Error: could not list clusters: invalid output when listing nodes: WARNING: Error loading config file: /home/necuser/.docker/config.json: open /home/necuser/.docker/config.json: permission denied" and thus get a little confusing.

@prankul88 prankul88 added the kind/documentation Categorizes issue or PR as related to documentation. label Jul 17, 2019
@tao12345666333
Copy link
Member

Thanks.

/assign

@BenTheElder
Copy link
Member

Technically kind needs to run as any user that has access to the docker socket, which may or may not be root depending on how you install docker. This is also true if using the docker CLI or other tools though.

@prankul88
Copy link
Member Author

prankul88 commented Jul 17, 2019

@BenTheElder Thanks for replying. I am not well aware of how to run docker without binding to UNIX socket, but feel this might be the most common way of installation. So maybe this will be a nice addition in README file.
I saw your comment in the PR and thought maybe adding it here too will help.

@BenTheElder
Copy link
Member

I am not well aware of how to run Docker without binding to UNIX socket, but feel this might be the most common way of installation.

You definitely normally run it on a UNIX socket (can also be remote / TCP though), however a couple points / clarifications:

  • It's not about root / not-root users, it's about being a user with permission to the socket when executing kind or docker, which on Linux is typically the docker group, which very likely includes the root user, but technically depends on your specific installation of Docker.
  • On macOS / Windows this is a pretty much a non-issue, on Linux the upstream Docker installation docs document this:

https://docs.docker.com/install/linux/docker-ce/ubuntu/#install-using-the-convenience-script

If you would like to use Docker as a non-root user, you should now consider adding your user to the “docker” group with something like:

  sudo usermod -aG docker your-user
  • kind has the same requirements to run as docker which I wouldn't expect to be surprising? If docker ps requires sudo docker ps to succeed on a system then kind requires sudo kind.

I don't feel the repo README is quite the correct place to bring this up, as we also don't get into docker installation details and I haven't seen any comparable docker tooling (including say, docker itself) discuss this there.

I do think this at least belongs in the known-issue guide however. 😅

@prankul88
Copy link
Member Author

@BenTheElder Great, I totally agree with you now. Thanks for sharing this informarion.
However I have a small doubt ,

If docker ps requires sudo docker ps to succeed on a system then kind requires sudo kind.

If I run command sudo kind it shows command not found. I am new to this and might be confusing myself a bit.

@BenTheElder
Copy link
Member

Ah, so if you installed kind with go or the make build it was likely installed to $HOME/go/bin/kind for that user, sudo will not inherent your environment variables, so there are a few options:

  • copy it to a system-wide PATH directory (eg possibly /usr/local/bin/kind)
  • use sudo env "PATH=$PATH" kind ... to preserve your PATH under sudo
  • install it again as root
  • use the full path to kind instead of just the command name

@tao12345666333
Copy link
Member

If I run command sudo kind it shows command not found. I am new to this and might be confusing myself a bit.

If you install kind via go get it will be install at $GOPATH/bin/kind and you should add your $GOPATH/bin to your $PATH so that you can using kind derectly.

If you using sudo kind, your current environment variables will not be maintained. xref https://superuser.com/questions/232231/how-do-i-make-sudo-preserve-my-environment-variables

@prankul88
Copy link
Member Author

Closing since a PR has been created fixing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/documentation Categorizes issue or PR as related to documentation.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants