From a70f54816ab5b9fff9b1d11c35fe6a0fff427b81 Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Thu, 25 Jun 2015 15:56:28 -0400 Subject: [PATCH 1/4] Make sure that flannel starts at boot Add dependencies to the flanneld service configuration for systemd, so that systemd will make sure the network is up and etcd is running before it goes to start flannel. --- configFlannel.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/configFlannel.md b/configFlannel.md index 5307186..570017c 100644 --- a/configFlannel.md +++ b/configFlannel.md @@ -115,11 +115,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/ # systemctl reboot ``` From c7b0a459589fe20f2a52f89b6e53240455a9773e Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Thu, 25 Jun 2015 16:38:53 -0400 Subject: [PATCH 2/4] Use rhel-tools instead of fedora:20 for testing Fedora 20's about to hit EOL, and later versions of the fedora images don't appear to include iputils. Switch to using rhel-tools instead, since it's already the big bag of troubleshooting tools. --- configFlannel.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configFlannel.md b/configFlannel.md index 570017c..ec1d979 100644 --- a/configFlannel.md +++ b/configFlannel.md @@ -258,13 +258,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. @@ -287,7 +287,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 From 50ebdb605fb75d91f13568bc55617b29b2e1d983 Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Thu, 25 Jun 2015 16:40:08 -0400 Subject: [PATCH 3/4] Whitespace fixup In the captured output of the 'ip a' command, include leading whitespace in the sample output to more closely match the expected output. --- configFlannel.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/configFlannel.md b/configFlannel.md index ec1d979..c53126a 100644 --- a/configFlannel.md +++ b/configFlannel.md @@ -273,11 +273,11 @@ From each node, pull a Docker image for testing. In our case, we will use rhel-t ``` # 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 ``` From 4da8164d7eea320b942cd34933710771e4400fca Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Thu, 25 Jun 2015 17:58:45 -0400 Subject: [PATCH 4/4] Add a note to also set ETCD_ADVERTISE_CLIENT_URLS As of etcd 2.0.11, etcd requires ETCD_ADVERTISE_CLIENT_URLS to be set if ETCD_LISTEN_CLIENT_URLS is set, and will fail to start with an error if it is not set. --- configFlannel.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/configFlannel.md b/configFlannel.md index c53126a..5496d42 100644 --- a/configFlannel.md +++ b/configFlannel.md @@ -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.