2015-10-15 15:40:02 +08:00
|
|
|
[Unit]
|
2015-11-21 20:20:39 +08:00
|
|
|
Description=Calico per-node agent
|
|
|
|
Documentation=https://github.com/projectcalico/calico-docker
|
2016-11-09 18:31:12 +08:00
|
|
|
After=docker.service docker.socket
|
|
|
|
Wants=docker.socket
|
2015-10-15 15:40:02 +08:00
|
|
|
|
|
|
|
[Service]
|
|
|
|
User=root
|
|
|
|
PermissionsStartOnly=true
|
2016-11-08 04:37:12 +08:00
|
|
|
{% if legacy_calicoctl %}
|
2015-12-03 22:38:44 +08:00
|
|
|
{% if inventory_hostname in groups['kube-node'] and peer_with_router|default(false)%}
|
2016-08-27 19:08:25 +08:00
|
|
|
ExecStart={{ bin_dir }}/calicoctl node --ip={{ip | default(ansible_default_ipv4.address) }} --as={{ local_as }} --detach=false --node-image={{ calico_node_image_repo }}:{{ calico_node_image_tag }}
|
2016-11-08 04:37:12 +08:00
|
|
|
{% else %}
|
2016-08-27 19:08:25 +08:00
|
|
|
ExecStart={{ bin_dir }}/calicoctl node --ip={{ip | default(ansible_default_ipv4.address) }} --detach=false --node-image={{ calico_node_image_repo }}:{{ calico_node_image_tag }}
|
2016-11-08 04:37:12 +08:00
|
|
|
{% endif %}
|
|
|
|
{% else %}
|
|
|
|
{% if inventory_hostname in groups['kube-node'] and peer_with_router|default(false)%}
|
|
|
|
ExecStart={{ bin_dir }}/calicoctl node run --ip={{ip | default(ansible_default_ipv4.address) }} --as={{ local_as }} --node-image={{ calico_node_image_repo }}:{{ calico_node_image_tag }}
|
|
|
|
{% else %}
|
|
|
|
ExecStart={{ bin_dir }}/calicoctl node run --ip={{ip | default(ansible_default_ipv4.address) }} --node-image={{ calico_node_image_repo }}:{{ calico_node_image_tag }}
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
2015-11-21 20:20:39 +08:00
|
|
|
Restart=always
|
2016-08-08 18:06:32 +08:00
|
|
|
RestartSec=10s
|
2015-10-15 15:40:02 +08:00
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|