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

[ubuntu] fix etcd flag #17419

Merged
merged 1 commit into from
Nov 23, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions cluster/ubuntu/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ function create-etcd-opts() {
cat <<EOF > ~/kube/default/etcd
ETCD_OPTS="\
-name infra\
-listen-client-urls http://0.0.0.0:4001\
-advertise-client-urls http://127.0.0.1:4001"
-listen-client-urls http://127.0.0.1:4001,http://${1}:4001\
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure why you want to listen on localhost and also advertise localhost.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

'cuz i can barely understand the relationship between these two flags(from doc).Shame on me:-/
If you could give more details on this, it would be highly appreciated.
-listen-client-urls http://127.0.0.1:4001,http://${1}:4001 -advertise-client-urls http://${1}:4001 would work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tried to file an issue coreos/etcd#3886 and didn't get what i need :-/ FYI

Copy link
Contributor

Choose a reason for hiding this comment

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

@dalanlan What do you want to know about? Listen addr is the addr your etcd process listening on. 0.0.0.0 means on all interfaces. Advertise addr is the addr to advertise.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure why you want to listen on localhost and also advertise localhost.

Why should we avoid this? Does it apply to all situations?
Say i wanna bring up a etcd cluster, all locating in a single (and the same) machine (kinda odd, i'll give you that), isn't it suppose to advertise localhost(different port though)?
Thanks ahead:)

Copy link
Contributor

Choose a reason for hiding this comment

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

If you advertise localhost, you should not expect clients outside the local machine to reach you. localhost on Machine A means differently from localhost on Machine B.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, i mean all of the clients which want to talk to the etcd locates locally as with etcd cluster itself in my use case

Copy link
Contributor

Choose a reason for hiding this comment

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

That is fine.

-advertise-client-urls http://${1}:4001"
EOF
}

Expand Down Expand Up @@ -379,7 +379,7 @@ function provision-master() {
source ~/kube/util.sh

setClusterInfo
create-etcd-opts
create-etcd-opts '${MASTER_IP}'
create-kube-apiserver-opts \
'${SERVICE_CLUSTER_IP_RANGE}' \
'${ADMISSION_CONTROL}' \
Expand Down Expand Up @@ -481,7 +481,7 @@ function provision-masterandnode() {
source ~/kube/util.sh

setClusterInfo
create-etcd-opts
create-etcd-opts '${MASTER_IP}'
create-kube-apiserver-opts \
'${SERVICE_CLUSTER_IP_RANGE}' \
'${ADMISSION_CONTROL}' \
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started-guides/docker-multinode/master.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ across reboots and failures.
Run:

```sh
sudo docker -H unix:///var/run/docker-bootstrap.sock run --net=host -d gcr.io/google_containers/etcd:2.2.1 /usr/local/bin/etcd --listen-client-urls=http://127.0.0.1:4001,http://${MASTER_IP}:4001 --advertise-client-urls=http://127.0.0.1:4001,http://${MASTER_IP}:4001 --data-dir=/var/etcd/data
sudo docker -H unix:///var/run/docker-bootstrap.sock run --net=host -d gcr.io/google_containers/etcd:2.2.1 /usr/local/bin/etcd --listen-client-urls=http://127.0.0.1:4001,http://${MASTER_IP}:4001 --advertise-client-urls=http://${MASTER_IP}:4001 --data-dir=/var/etcd/data
```

Next, you need to set a CIDR range for flannel. This CIDR should be chosen to be non-overlapping with any existing network you are using:
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started-guides/docker-multinode/master.sh
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ start_k8s(){
gcr.io/google_containers/etcd:2.2.1 \
/usr/local/bin/etcd \
--listen-client-urls=http://127.0.0.1:4001,http://${MASTER_IP}:4001 \
--advertise-client-urls=http://127.0.0.1:4001,http://${MASTER_IP}:4001
--advertise-client-urls=http://${MASTER_IP}:4001
--data-dir=/var/etcd/data

sleep 5
Expand Down