diff --git a/fragments/docker.service.yaml b/fragments/docker.service.yaml index 374d346..269a92d 100644 --- a/fragments/docker.service.yaml +++ b/fragments/docker.service.yaml @@ -29,4 +29,37 @@ write_files: [Install] WantedBy=multi-user.target + - path: /usr/local/bin/wait-for-flanneld + owner: "root:root" + permissions: "0755" + content: | + #!/bin/sh + + # This script waits for flannel to provide the /run/flannel/subnet.env + # file. This can be used to synchronize docker startup with the + # availability of this file. + + while ! [ -f /run/flannel/subnet.env ]; do + echo "waiting for flanneld" + sleep 1 + done + + echo "flanneld is active" + + exit 0 + - path: /etc/systemd/system/wait-for-flanneld.service + owner: "root:root" + permissions: "0644" + content: | + [Unit] + Description=Wait for flanneld to provide subnet/mtu information + After=network.target flanneld.service + Requires=flanneld.service + + [Service] + Type=oneshot + ExecStart=/usr/local/bin/wait-for-flanneld + + [Install] + WantedBy=multi-user.target diff --git a/fragments/wait-for-flanneld.yaml b/fragments/wait-for-flanneld.yaml deleted file mode 100644 index ae73af1..0000000 --- a/fragments/wait-for-flanneld.yaml +++ /dev/null @@ -1,37 +0,0 @@ -#cloud-config -merge_how: dict(recurse_array)+list(append) -write_files: - - path: /usr/local/bin/wait-for-flanneld - owner: "root:root" - permissions: "0755" - content: | - #!/bin/sh - - # This script waits for flannel to provide the /run/flannel/subnet.env - # file. This can be used to synchronize docker startup with the - # availability of this file. - - while ! [ -f /run/flannel/subnet.env ]; do - echo "waiting for flanneld" - sleep 1 - done - - echo flanneld is active - - exit 0 - - path: /etc/systemd/system/wait-for-flanneld.service - owner: "root:root" - permissions: "0644" - content: | - [Unit] - Description=Wait for flanneld to provide subnet/mtu information - After=network.target flanneld.service - Requires=flanneld.service - - [Service] - Type=oneshot - ExecStart=/usr/local/bin/wait-for-flanneld - - [Install] - WantedBy=multi-user.target - diff --git a/kubenode.yaml b/kubenode.yaml index 8952e76..ddd9959 100644 --- a/kubenode.yaml +++ b/kubenode.yaml @@ -121,12 +121,6 @@ resources: group: ungrouped config: {get_file: fragments/docker.service.yaml} - wait_for_flanneld: - type: "OS::Heat::SoftwareConfig" - properties: - group: ungrouped - config: {get_file: fragments/wait-for-flanneld.yaml} - enable_services: type: "OS::Heat::SoftwareConfig" properties: @@ -156,7 +150,6 @@ resources: - config: {get_resource: add_to_docker_group} - config: {get_resource: configure_kubernetes_minion} - config: {get_resource: docker_service} - - config: {get_resource: wait_for_flanneld} - config: {get_resource: enable_services} - config: {get_resource: cfn_signal}