diff --git a/docs/getting-started-guides/coreos/cloud-configs/master.yaml b/docs/getting-started-guides/coreos/cloud-configs/master.yaml index 98a05f6aa81..fbae2645e59 100644 --- a/docs/getting-started-guides/coreos/cloud-configs/master.yaml +++ b/docs/getting-started-guides/coreos/cloud-configs/master.yaml @@ -1,5 +1,12 @@ #cloud-config +--- +write_files: +- path: /opt/bin/waiter.sh + owner: root + content: | + #! /usr/bin/bash + until curl http://127.0.0.1:4001/v2/machines; do sleep 2; done coreos: units: - name: setup-network-environment.service @@ -62,10 +69,29 @@ coreos: ExecStart=/usr/bin/fleetd Restart=always RestartSec=10s + - name: etcd-waiter.service + command: start + content: | + [Unit] + Description=etcd waiter + Wants=network-online.target + Wants=etcd.service + After=etcd.service + After=network-online.target + Before=flannel.service + Before=setup-network-environment.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 command: start content: | [Unit] + Wants=etcd-waiter.service + After=etcd-waiter.service Requires=etcd.service After=etcd.service After=network-online.target diff --git a/docs/getting-started-guides/coreos/cloud-configs/standalone.yaml b/docs/getting-started-guides/coreos/cloud-configs/standalone.yaml index e506a023f70..94d81228225 100644 --- a/docs/getting-started-guides/coreos/cloud-configs/standalone.yaml +++ b/docs/getting-started-guides/coreos/cloud-configs/standalone.yaml @@ -1,5 +1,12 @@ #cloud-config +--- +write_files: +- path: /opt/bin/waiter.sh + owner: root + content: | + #! /usr/bin/bash + until curl http://127.0.0.1:4001/v2/machines; do sleep 2; done hostname: standalone coreos: units: @@ -7,10 +14,29 @@ coreos: command: start - name: fleet.service command: start + - name: etcd-waiter.service + command: start + content: | + [Unit] + Description=etcd waiter + Wants=network-online.target + Wants=etcd.service + After=etcd.service + After=network-online.target + Before=flannel.service + Before=setup-network-environment.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 command: start content: | [Unit] + Wants=etcd-waiter.service + After=etcd-waiter.service Requires=etcd.service After=etcd.service After=network-online.target