2015-10-15 07:40:02 +00:00
|
|
|
[Unit]
|
2016-12-05 11:06:16 +00:00
|
|
|
Description=calico-node
|
|
|
|
After=docker.service
|
|
|
|
Requires=docker.service
|
2015-10-15 07:40:02 +00:00
|
|
|
|
|
|
|
[Service]
|
2016-12-05 11:06:16 +00:00
|
|
|
EnvironmentFile=/etc/calico/calico.env
|
2016-12-23 14:44:44 +00:00
|
|
|
ExecStartPre=-{{ docker_bin_dir }}/docker rm -f calico-node
|
|
|
|
ExecStart={{ docker_bin_dir }}/docker run --net=host --privileged \
|
2016-12-05 11:06:16 +00:00
|
|
|
--name=calico-node \
|
2016-12-06 12:56:34 +00:00
|
|
|
-e HOSTNAME=${CALICO_HOSTNAME} \
|
2016-12-05 11:06:16 +00:00
|
|
|
-e IP=${CALICO_IP} \
|
|
|
|
-e IP6=${CALICO_IP6} \
|
|
|
|
-e CALICO_NETWORKING_BACKEND=${CALICO_NETWORKING_BACKEND} \
|
|
|
|
-e AS=${CALICO_AS} \
|
|
|
|
-e NO_DEFAULT_POOLS=${CALICO_NO_DEFAULT_POOLS} \
|
|
|
|
-e CALICO_LIBNETWORK_ENABLED=${CALICO_LIBNETWORK_ENABLED} \
|
|
|
|
-e ETCD_ENDPOINTS=${ETCD_ENDPOINTS} \
|
|
|
|
-e ETCD_CA_CERT_FILE=${ETCD_CA_CERT_FILE} \
|
|
|
|
-e ETCD_CERT_FILE=${ETCD_CERT_FILE} \
|
|
|
|
-e ETCD_KEY_FILE=${ETCD_KEY_FILE} \
|
|
|
|
-v /var/log/calico:/var/log/calico \
|
|
|
|
-v /run/docker/plugins:/run/docker/plugins \
|
|
|
|
-v /lib/modules:/lib/modules \
|
|
|
|
-v /var/run/calico:/var/run/calico \
|
|
|
|
-v {{ calico_cert_dir }}:{{ calico_cert_dir }}:ro \
|
2016-12-23 14:44:44 +00:00
|
|
|
--memory={{ calico_node_memory_limit|regex_replace('Mi', 'M') }} --cpu-shares={{ calico_node_cpu_limit|regex_replace('m', '') }} \
|
2016-12-05 11:06:16 +00:00
|
|
|
{{ calico_node_image_repo }}:{{ calico_node_image_tag }}
|
2016-11-23 06:48:12 +00:00
|
|
|
|
2015-11-21 12:20:39 +00:00
|
|
|
Restart=always
|
2016-08-08 10:06:32 +00:00
|
|
|
RestartSec=10s
|
2015-10-15 07:40:02 +00:00
|
|
|
|
2016-12-23 14:44:44 +00:00
|
|
|
ExecStop=-{{ docker_bin_dir }}/docker stop calico-node
|
2016-12-05 11:06:16 +00:00
|
|
|
|
2015-10-15 07:40:02 +00:00
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|