-
Notifications
You must be signed in to change notification settings - Fork 33
Updates for flannelConfig.md #68
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,12 +30,16 @@ rpm -qc flannel | |
# ip a | ||
``` | ||
|
||
* Configure etcd to listen on the public IP of the node. Change the ETCD_LISTEN_CLIENT_URLS from localhost to 0.0.0.0. | ||
* Configure etcd to listen on the public IP of the node. Change the ETCD_LISTEN_CLIENT_URLS and ETCD_ADVERTISE_CLIENT_URLS from localhost to 0.0.0.0 and the public IP, respectively. | ||
|
||
``` | ||
# grep ETCD_LISTEN_CLIENT_URLS /etc/etcd/etcd.conf | ||
ETCD_LISTEN_CLIENT_URLS="http://0.0.0.0:4001" | ||
``` | ||
``` | ||
# grep ETCD_ADVERTISE_CLIENT_URLS /etc/etcd/etcd.conf | ||
ETCD_ADVERTISE_CLIENT_URLS="http://PUBLIC.IP:4001" | ||
``` | ||
|
||
|
||
* Start etcd. | ||
|
@@ -115,11 +119,15 @@ FLANNEL_OPTIONS="eth0" | |
``` | ||
|
||
|
||
* Enable the flanneld service and reboot. | ||
* Enable the flanneld service, let systemd know that the local flanneld service needs a default route and the local etcd service to be started before it, and reboot. | ||
|
||
|
||
``` | ||
# systemctl enable flanneld | ||
# systemctl enable NetworkManager-wait-online.service | ||
# systemctl enable flanneld.service | ||
# mkdir /etc/systemd/system/flanneld.service.wants | ||
# ln -s /usr/lib/systemd/system/etcd.service /etc/systemd/system/flanneld.service.wants/ | ||
# ln -s /usr/lib/systemd/system/NetworkManager-wait-online.service /etc/systemd/system/flanneld.service.wants/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This absolutely should not be necessary... flannel waits until it can find an ip/default route... What problem did you have? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you may be right, that the startup problems I was seeing could have been caused by not being up yet. This is what happened when etcd was being started later:
They're still being started in the right order on my system, even after removing the .wants symlink, so I'm not seeing this problem any more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On Fri, 2015-06-26 at 07:07 -0700, Nalin Dahyabhai wrote:
Jun 23 14:06:55 nalin-atomic-1.os1.phx2.redhat.com flanneld[697]:
E0623 14:06:36.579070 00697 main.go:151] Failed to create
SubnetManager: 501: All the given peers are not reachable (Tried to
connect to each peer twice and failed) [0]
Jun 23 14:06:55 nalin-atomic-1.os1.phx2.redhat.com flanneld[697]:
E0623 14:06:37.581440 00697 main.go:151] Failed to create
SubnetManager: 501: All the given peers are not reachable (Tried to
connect to each peer twice and failed) [0]
This error usually means that etcd is not listening on 0.0.0.0 and is
probably only listening on 127.0.0.1. Or it is only listening on 2379
and you want 4001 (or vice versa)
|
||
# systemctl reboot | ||
``` | ||
|
||
|
@@ -254,13 +262,13 @@ At this point the flannel cluster is set up and we can test it. We have etcd run | |
|
||
##Test the flannel configuration | ||
|
||
From each node, pull a Docker image for testing. In our case, we will use fedora:20. | ||
From each node, pull a Docker image for testing. In our case, we will use rhel-tools. | ||
|
||
* Issue the following on node1. | ||
|
||
|
||
``` | ||
# docker run -it fedora:20 bash | ||
# docker run -it registry.access.redhat.com/rhel7/rhel-tools | ||
``` | ||
|
||
* This will place you inside the container. Check the IP address. | ||
|
@@ -269,11 +277,11 @@ From each node, pull a Docker image for testing. In our case, we will use fedora | |
``` | ||
# ip a l eth0 | ||
5: eth0: mtu 1450 qdisc noqueue state UP group default | ||
link/ether 02:42:0a:00:51:02 brd ff:ff:ff:ff:ff:ff | ||
inet 18.0.81.2/24 scope global eth0 | ||
valid_lft forever preferred_lft forever | ||
inet6 fe80::42:aff:fe00:5102/64 scope link | ||
valid_lft forever preferred_lft forever | ||
link/ether 02:42:0a:00:51:02 brd ff:ff:ff:ff:ff:ff | ||
inet 18.0.81.2/24 scope global eth0 | ||
valid_lft forever preferred_lft forever | ||
inet6 fe80::42:aff:fe00:5102/64 scope link | ||
valid_lft forever preferred_lft forever | ||
``` | ||
|
||
|
||
|
@@ -283,7 +291,7 @@ You can see here that the IP address is on the flannel network. | |
|
||
|
||
``` | ||
# docker run -it fedora:20 bash | ||
# docker run -it registry.access.redhat.com/rhel7/rhel-tools /bin/bash | ||
|
||
# ip a l eth0 | ||
5: eth0: mtu 1450 qdisc noqueue state UP group default | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmmmm, maybe we should add an After=etcd.service in the flannel .service? There is no requirement that flannel be running on the node in question and thus it should not 'want' etcd....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm suggesting the After= in the .service file as that solves the problem for all nodes and requires no user interaction.... Also, I thought flannel just hung/waited for etcd....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A general "After" (as you note, not a "Wants") in the unit file should accomplish this, yes, since it's an ordering requirement that only matters when both are enabled. There doesn't seem to be an equivalent way to express this using the filesystem, so manually adding a link to ".wants" avoids having to modify or override the unit file as we package it.