You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.3 KiB

  1. [Unit]
  2. Description=calico-node
  3. After=docker.service
  4. Requires=docker.service
  5. [Service]
  6. EnvironmentFile=/etc/calico/calico.env
  7. ExecStartPre=-{{ docker_bin_dir }}/docker rm -f calico-node
  8. ExecStart={{ docker_bin_dir }}/docker run --net=host --privileged \
  9. --name=calico-node \
  10. -e HOSTNAME=${CALICO_HOSTNAME} \
  11. -e IP=${CALICO_IP} \
  12. -e IP6=${CALICO_IP6} \
  13. -e CALICO_NETWORKING_BACKEND=${CALICO_NETWORKING_BACKEND} \
  14. -e FELIX_DEFAULTENDPOINTTOHOSTACTION={{ calico_endpoint_to_host_action|default('RETURN') }} \
  15. -e AS=${CALICO_AS} \
  16. -e NO_DEFAULT_POOLS=${CALICO_NO_DEFAULT_POOLS} \
  17. -e CALICO_LIBNETWORK_ENABLED=${CALICO_LIBNETWORK_ENABLED} \
  18. -e ETCD_ENDPOINTS=${ETCD_ENDPOINTS} \
  19. -e ETCD_CA_CERT_FILE=${ETCD_CA_CERT_FILE} \
  20. -e ETCD_CERT_FILE=${ETCD_CERT_FILE} \
  21. -e ETCD_KEY_FILE=${ETCD_KEY_FILE} \
  22. -v /var/log/calico:/var/log/calico \
  23. -v /run/docker/plugins:/run/docker/plugins \
  24. -v /lib/modules:/lib/modules \
  25. -v /var/run/calico:/var/run/calico \
  26. -v {{ calico_cert_dir }}:{{ calico_cert_dir }}:ro \
  27. --memory={{ calico_node_memory_limit|regex_replace('Mi', 'M') }} --cpu-shares={{ calico_node_cpu_limit|regex_replace('m', '') }} \
  28. {{ calico_node_image_repo }}:{{ calico_node_image_tag }}
  29. Restart=always
  30. RestartSec=10s
  31. ExecStop=-{{ docker_bin_dir }}/docker stop calico-node
  32. [Install]
  33. WantedBy=multi-user.target