Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contributors/devel/running-locally.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ cd kubernetes
Since root access is sometimes needed to start/stop Kubernetes daemons, `./hack/local-up-cluster.sh` may need to be run as root. If it reports failures, try this instead:

```sh
sudo ./hack/local-up-cluster.sh
sudo -E PATH=$PATH ./hack/local-up-cluster.sh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can also break users, imagine if they only have docker available to root (which is why we need to sudo) ... this is dependent on users and their local path manipulation ...

what was missing from PATH in your case?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

etcd was missing -- if one follows the instructions earlier on the page to install etcd, it gets installed in such a way that you have to manually add it to your $PATH

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I think we should probably update the script to find etcd in the expected install location in addition to $PATH.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't aware that the instructions say sudo ./hack/local-up-cluster.sh. I always invoke it as normal user (./hack/local-up-cluster.sh) and it internally prefixes some commands with sudo as needed.

My PATH includes etcd, because that is also needed for other commands (go test ./test/integration/<something>).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My PATH includes etcd, because that is also needed for other commands (go test ./test/integration/).

Well, the integration scripts actually handle this for you now :-)

We could have the go targets do it too, it will just be messier.

but either way, if you run with sudo at the top level your path will not be preserved

we should probably stop specifying sudo here entirely

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did a little more testing and I confirmed that it works without sudo for me.

I figured out why I thought I needed the sudo workaround though: after I've run the script once, before I can run it again I have to manually delete /var/run/kubernetes/* and the relevant /tmp/*.log files or it fails to come up -- it looks like it's because a smattering of these files end up owned by root which breaks things.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That observation is correct. I forgot to mention that I am doing the same manual cleanup.

It would be good to fix that in the script itself so that it can be invoked repeatedly.

```

This will build and start a lightweight local cluster, consisting of a master and a single node. Press Control+C to shut it down.
Expand Down