integrate wait-for-flanneld into docker.service.yaml
This commit is contained in:
parent
cb51ae97b7
commit
6595da2f66
|
@ -29,4 +29,37 @@ write_files:
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
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
|
||||||
|
|
||||||
|
|
|
@ -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
|
|
||||||
|
|
|
@ -121,12 +121,6 @@ resources:
|
||||||
group: ungrouped
|
group: ungrouped
|
||||||
config: {get_file: fragments/docker.service.yaml}
|
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:
|
enable_services:
|
||||||
type: "OS::Heat::SoftwareConfig"
|
type: "OS::Heat::SoftwareConfig"
|
||||||
properties:
|
properties:
|
||||||
|
@ -156,7 +150,6 @@ resources:
|
||||||
- config: {get_resource: add_to_docker_group}
|
- config: {get_resource: add_to_docker_group}
|
||||||
- config: {get_resource: configure_kubernetes_minion}
|
- config: {get_resource: configure_kubernetes_minion}
|
||||||
- config: {get_resource: docker_service}
|
- config: {get_resource: docker_service}
|
||||||
- config: {get_resource: wait_for_flanneld}
|
|
||||||
- config: {get_resource: enable_services}
|
- config: {get_resource: enable_services}
|
||||||
- config: {get_resource: cfn_signal}
|
- config: {get_resource: cfn_signal}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue