2016-12-08 16:48:54 +00:00
|
|
|
[Unit]
|
|
|
|
Description=calico-rr
|
|
|
|
After=docker.service
|
|
|
|
Requires=docker.service
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
EnvironmentFile=/etc/calico/calico-rr.env
|
2016-12-23 14:44:44 +00:00
|
|
|
ExecStartPre=-{{ docker_bin_dir }}/docker rm -f calico-rr
|
2017-02-06 12:58:54 +00:00
|
|
|
ExecStart={{ docker_bin_dir }}/docker run --net=host --privileged \
|
2016-12-08 16:48:54 +00:00
|
|
|
--name=calico-rr \
|
|
|
|
-e IP=${IP} \
|
|
|
|
-e IP6=${IP6} \
|
|
|
|
-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-rr:/var/log/calico \
|
|
|
|
-v {{ calico_cert_dir }}:{{ calico_cert_dir }}:ro \
|
2016-12-23 14:44:44 +00:00
|
|
|
--memory={{ calico_rr_memory_limit|regex_replace('Mi', 'M') }} --cpu-shares={{ calico_rr_cpu_limit|regex_replace('m', '') }} \
|
2016-12-08 16:48:54 +00:00
|
|
|
{{ calico_rr_image_repo }}:{{ calico_rr_image_tag }}
|
|
|
|
|
|
|
|
Restart=always
|
|
|
|
RestartSec=10s
|
|
|
|
|
2016-12-23 14:44:44 +00:00
|
|
|
ExecStop=-{{ docker_bin_dir }}/docker stop calico-rr
|
2016-12-08 16:48:54 +00:00
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|