diff --git a/docs/getting-started-guides/aws/cloud-configs/master.yaml b/docs/getting-started-guides/aws/cloud-configs/master.yaml index e96234f3934..72613a4ed25 100644 --- a/docs/getting-started-guides/aws/cloud-configs/master.yaml +++ b/docs/getting-started-guides/aws/cloud-configs/master.yaml @@ -60,32 +60,28 @@ coreos: Wants=etcd.service After=etcd.service After=network-online.target - Before=flannel.service + Before=flanneld.service [Service] ExecStartPre=/usr/bin/chmod +x /opt/bin/waiter.sh ExecStart=/usr/bin/bash /opt/bin/waiter.sh RemainAfterExit=true Type=oneshot - - name: flannel.service + - name: flanneld.service command: start - content: | - [Unit] - Wants=etcd-waiter.service - After=etcd-waiter.service - Requires=etcd.service - After=etcd.service - After=network-online.target - Wants=network-online.target - Description=flannel is an etcd backed overlay network for containers - - [Service] - Type=notify - ExecStartPre=-/usr/bin/mkdir -p /opt/bin - ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/k8s/flanneld - ExecStartPre=/usr/bin/chmod +x /opt/bin/flanneld - ExecStartPre=-/usr/bin/etcdctl mk /coreos.com/network/config '{"Network":"10.244.0.0/16", "Backend": {"Type": "vxlan"}}' - ExecStart=/opt/bin/flanneld + drop-ins: + - name: 50-network-config.conf + content: | + [Service] + ExecStartPre=/usr/bin/etcdctl set /coreos.com/network/config '{"Network":"10.244.0.0/16", "Backend": {"Type": "vxlan"}}' + ExecStart= + ExecStart=/usr/libexec/sdnotify-proxy /run/flannel/sd.sock \ + /usr/bin/docker run --net=host --privileged=true --rm \ + --volume=/run/flannel:/run/flannel \ + --env=NOTIFY_SOCKET=/run/flannel/sd.sock \ + --env-file=/run/flannel/options.env \ + --volume=${ETCD_SSL_DIR}:/etc/ssl/etcd:ro \ + quay.io/coreos/flannel:${FLANNEL_VER} /opt/bin/flanneld --ip-masq=true --iface=eth1 - name: docker-cache.service command: start content: | @@ -115,8 +111,10 @@ coreos: - name: 51-docker-mirror.conf content: | [Unit] - Requires=docker-cache.service - After=docker-cache.service + # making sure that docker-cache is up and that flanneld finished + # startup, otherwise containers won't land in flannel's network... + Requires=docker-cache.service flanneld.service + After=docker-cache.service flanneld.service [Service] Environment=DOCKER_OPTS='--registry-mirror=http://$private_ipv4:5000' - name: kube-apiserver.service diff --git a/docs/getting-started-guides/aws/cloud-configs/node.yaml b/docs/getting-started-guides/aws/cloud-configs/node.yaml index 098a642bdd8..59c24c5f24f 100644 --- a/docs/getting-started-guides/aws/cloud-configs/node.yaml +++ b/docs/getting-started-guides/aws/cloud-configs/node.yaml @@ -9,25 +9,34 @@ coreos: mask: true - name: fleet.service command: start - - name: flannel.service + - name: flanneld.service command: start - content: | - [Unit] - After=network-online.target - Wants=network-online.target - Description=flannel is an etcd backed overlay network for containers - - [Service] - Type=notify - ExecStartPre=-/usr/bin/mkdir -p /opt/bin - ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/k8s/flanneld - ExecStartPre=/usr/bin/chmod +x /opt/bin/flanneld - ExecStart=/opt/bin/flanneld -etcd-endpoints http://:4001 + drop-ins: + - name: 50-network-config.conf + content: | + [Service] + ExecStartPre=/usr/bin/etcdctl set /coreos.com/network/config '{"Network":"10.244.0.0/16", "Backend": {"Type": "vxlan"}}' + # as we need to turn eth1 as the default interface + # https://github.com/coreos/bugs/issues/228 is sorted + # see notes in https://github.com/coreos/flannel/pull/137 + ExecStart= + ExecStart=/usr/libexec/sdnotify-proxy /run/flannel/sd.sock \ + /usr/bin/docker run --net=host --privileged=true --rm \ + --volume=/run/flannel:/run/flannel \ + --env=NOTIFY_SOCKET=/run/flannel/sd.sock \ + --env-file=/run/flannel/options.env \ + --volume=${ETCD_SSL_DIR}:/etc/ssl/etcd:ro \ + quay.io/coreos/flannel:${FLANNEL_VER} /opt/bin/flanneld -etcd-endpoints http://:4001 --ip-masq=true --iface=eth1 - name: docker.service command: start drop-ins: - name: 51-docker-mirror.conf content: | + [Unit] + # making sure that flanneld finished startup, otherwise containers + # won't land in flannel's network... + Requires=flanneld.service + After=flanneld.service [Service] Environment=DOCKER_OPTS='--registry-mirror=http://:5000' - name: setup-network-environment.service diff --git a/docs/getting-started-guides/coreos/cloud-configs/master.yaml b/docs/getting-started-guides/coreos/cloud-configs/master.yaml index 5f8c71376a9..25fd8cee24d 100644 --- a/docs/getting-started-guides/coreos/cloud-configs/master.yaml +++ b/docs/getting-started-guides/coreos/cloud-configs/master.yaml @@ -62,32 +62,28 @@ coreos: Wants=etcd.service After=etcd.service After=network-online.target - Before=flannel.service + Before=flanneld.service [Service] ExecStartPre=/usr/bin/chmod +x /opt/bin/waiter.sh ExecStart=/usr/bin/bash /opt/bin/waiter.sh RemainAfterExit=true Type=oneshot - - name: flannel.service + - name: flanneld.service command: start - content: | - [Unit] - Wants=etcd-waiter.service - After=etcd-waiter.service - Requires=etcd.service - After=etcd.service - After=network-online.target - Wants=network-online.target - Description=flannel is an etcd backed overlay network for containers - - [Service] - Type=notify - ExecStartPre=-/usr/bin/mkdir -p /opt/bin - ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/k8s/flanneld - ExecStartPre=/usr/bin/chmod +x /opt/bin/flanneld - ExecStartPre=-/usr/bin/etcdctl mk /coreos.com/network/config '{"Network":"10.244.0.0/16", "Backend": {"Type": "vxlan"}}' - ExecStart=/opt/bin/flanneld + drop-ins: + - name: 50-network-config.conf + content: | + [Service] + ExecStartPre=/usr/bin/etcdctl set /coreos.com/network/config '{"Network":"10.244.0.0/16", "Backend": {"Type": "vxlan"}}' + ExecStart= + ExecStart=/usr/libexec/sdnotify-proxy /run/flannel/sd.sock \ + /usr/bin/docker run --net=host --privileged=true --rm \ + --volume=/run/flannel:/run/flannel \ + --env=NOTIFY_SOCKET=/run/flannel/sd.sock \ + --env-file=/run/flannel/options.env \ + --volume=${ETCD_SSL_DIR}:/etc/ssl/etcd:ro \ + quay.io/coreos/flannel:${FLANNEL_VER} /opt/bin/flanneld --ip-masq=true --iface=eth1 - name: docker-cache.service command: start content: | @@ -117,8 +113,10 @@ coreos: - name: 51-docker-mirror.conf content: | [Unit] - Requires=docker-cache.service - After=docker-cache.service + # making sure that docker-cache is up and that flanneld finished + # startup, otherwise containers won't land in flannel's network... + Requires=docker-cache.service flanneld.service + After=docker-cache.service flanneld.service [Service] Environment=DOCKER_OPTS='--registry-mirror=http://$private_ipv4:5000' - name: kube-apiserver.service diff --git a/docs/getting-started-guides/coreos/cloud-configs/node.yaml b/docs/getting-started-guides/coreos/cloud-configs/node.yaml index 0cd47e9c210..ab4d2dc08bc 100644 --- a/docs/getting-started-guides/coreos/cloud-configs/node.yaml +++ b/docs/getting-started-guides/coreos/cloud-configs/node.yaml @@ -9,25 +9,31 @@ coreos: mask: true - name: fleet.service command: start - - name: flannel.service + - name: flanneld.service command: start - content: | - [Unit] - After=network-online.target - Wants=network-online.target - Description=flannel is an etcd backed overlay network for containers - - [Service] - Type=notify - ExecStartPre=-/usr/bin/mkdir -p /opt/bin - ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/k8s/flanneld - ExecStartPre=/usr/bin/chmod +x /opt/bin/flanneld - ExecStart=/opt/bin/flanneld -etcd-endpoints http://:4001 + drop-ins: + - name: 50-network-config.conf + content: | + [Service] + ExecStartPre=/usr/bin/etcdctl set /coreos.com/network/config '{"Network":"10.244.0.0/16", "Backend": {"Type": "vxlan"}}' + ExecStart= + ExecStart=/usr/libexec/sdnotify-proxy /run/flannel/sd.sock \ + /usr/bin/docker run --net=host --privileged=true --rm \ + --volume=/run/flannel:/run/flannel \ + --env=NOTIFY_SOCKET=/run/flannel/sd.sock \ + --env-file=/run/flannel/options.env \ + --volume=${ETCD_SSL_DIR}:/etc/ssl/etcd:ro \ + quay.io/coreos/flannel:${FLANNEL_VER} /opt/bin/flanneld -etcd-endpoints http://:4001 --ip-masq=true --iface=eth1 - name: docker.service command: start drop-ins: - name: 51-docker-mirror.conf content: | + [Unit] + # making sure that flanneld finished startup, otherwise containers + # won't land in flannel's network... + Requires=flanneld.service + After=flanneld.service [Service] Environment=DOCKER_OPTS='--registry-mirror=http://:5000' - name: setup-network-environment.service diff --git a/docs/getting-started-guides/coreos/cloud-configs/standalone.yaml b/docs/getting-started-guides/coreos/cloud-configs/standalone.yaml index 58508bafa1d..7c95ac502b7 100644 --- a/docs/getting-started-guides/coreos/cloud-configs/standalone.yaml +++ b/docs/getting-started-guides/coreos/cloud-configs/standalone.yaml @@ -23,32 +23,28 @@ coreos: Wants=etcd.service After=etcd.service After=network-online.target - Before=flannel.service + Before=flanneld.service [Service] ExecStartPre=/usr/bin/chmod +x /opt/bin/waiter.sh ExecStart=/usr/bin/bash /opt/bin/waiter.sh RemainAfterExit=true Type=oneshot - - name: flannel.service + - name: flanneld.service command: start - content: | - [Unit] - Wants=etcd-waiter.service - After=etcd-waiter.service - Requires=etcd.service - After=etcd.service - After=network-online.target - Wants=network-online.target - Description=flannel is an etcd backed overlay network for containers - - [Service] - Type=notify - ExecStartPre=-/usr/bin/mkdir -p /opt/bin - ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/k8s/flanneld - ExecStartPre=/usr/bin/chmod +x /opt/bin/flanneld - ExecStartPre=-/usr/bin/etcdctl mk /coreos.com/network/config '{"Network":"10.244.0.0/16", "Backend": {"Type": "vxlan"}}' - ExecStart=/opt/bin/flanneld + drop-ins: + - name: 50-network-config.conf + content: | + [Service] + ExecStartPre=/usr/bin/etcdctl set /coreos.com/network/config '{"Network":"10.244.0.0/16", "Backend": {"Type": "vxlan"}}' + ExecStart= + ExecStart=/usr/libexec/sdnotify-proxy /run/flannel/sd.sock \ + /usr/bin/docker run --net=host --privileged=true --rm \ + --volume=/run/flannel:/run/flannel \ + --env=NOTIFY_SOCKET=/run/flannel/sd.sock \ + --env-file=/run/flannel/options.env \ + --volume=${ETCD_SSL_DIR}:/etc/ssl/etcd:ro \ + quay.io/coreos/flannel:${FLANNEL_VER} /opt/bin/flanneld --ip-masq=true --iface=eth1 - name: docker-cache.service command: start content: | @@ -79,8 +75,10 @@ coreos: - name: 51-docker-mirror.conf content: | [Unit] - Requires=docker-cache.service - After=docker-cache.service + # making sure that docker-cache is up and that flanneld finished + # startup, otherwise containers won't land in flannel's network... + Requires=docker-cache.service flanneld.service + After=docker-cache.service flanneld.service [Service] Environment=DOCKER_OPTS='--registry-mirror=http://$private_ipv4:5000' - name: kube-apiserver.service