openshift.docker.node.service 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. [Unit]
  2. After={{ openshift.common.service_type }}-master.service
  3. After={{ openshift.docker.service_name }}.service
  4. After=openvswitch.service
  5. PartOf={{ openshift.docker.service_name }}.service
  6. Requires={{ openshift.docker.service_name }}.service
  7. {% if openshift_use_openshift_sdn %}
  8. Wants=openvswitch.service
  9. PartOf=openvswitch.service
  10. After=ovsdb-server.service
  11. After=ovs-vswitchd.service
  12. {% endif %}
  13. Wants={{ openshift.common.service_type }}-master.service
  14. Requires={{ openshift.common.service_type }}-node-dep.service
  15. After={{ openshift.common.service_type }}-node-dep.service
  16. Requires=dnsmasq.service
  17. After=dnsmasq.service
  18. [Service]
  19. EnvironmentFile=/etc/sysconfig/{{ openshift.common.service_type }}-node
  20. EnvironmentFile=/etc/sysconfig/{{ openshift.common.service_type }}-node-dep
  21. ExecStartPre=-/usr/bin/docker rm -f {{ openshift.common.service_type }}-node
  22. ExecStartPre=/usr/bin/cp /etc/origin/node/node-dnsmasq.conf /etc/dnsmasq.d/
  23. ExecStartPre=/usr/bin/dbus-send --system --dest=uk.org.thekelleys.dnsmasq /uk/org/thekelleys/dnsmasq uk.org.thekelleys.SetDomainServers array:string:/in-addr.arpa/127.0.0.1,/{{ openshift.common.dns_domain }}/127.0.0.1
  24. ExecStart=/usr/bin/docker run --name {{ openshift.common.service_type }}-node \
  25. --rm --privileged --net=host --pid=host --env-file=/etc/sysconfig/{{ openshift.common.service_type }}-node \
  26. -v /:/rootfs:ro,rslave -e CONFIG_FILE=${CONFIG_FILE} -e OPTIONS=${OPTIONS} \
  27. -e HOST=/rootfs -e HOST_ETC=/host-etc \
  28. -v {{ openshift_node_data_dir }}:{{ openshift_node_data_dir }}{{ ':rslave' if openshift.docker.gte_1_10 | default(False) | bool else '' }} \
  29. -v {{ openshift.common.config_base }}/node:{{ openshift.common.config_base }}/node \
  30. {% if openshift_cloudprovider_kind | default('') != '' -%} -v {{ openshift.common.config_base }}/cloudprovider:{{ openshift.common.config_base}}/cloudprovider {% endif -%} \
  31. -v /etc/localtime:/etc/localtime:ro -v /etc/machine-id:/etc/machine-id:ro \
  32. -v /run:/run -v /sys:/sys:rw -v /sys/fs/cgroup:/sys/fs/cgroup:rw \
  33. -v /usr/bin/docker:/usr/bin/docker:ro -v /var/lib/docker:/var/lib/docker \
  34. -v /lib/modules:/lib/modules -v /etc/origin/openvswitch:/etc/openvswitch \
  35. -v /etc/origin/sdn:/etc/openshift-sdn -v /var/lib/cni:/var/lib/cni \
  36. -v /etc/systemd/system:/host-etc/systemd/system -v /var/log:/var/log \
  37. -v /dev:/dev $DOCKER_ADDTL_BIND_MOUNTS -v /etc/pki:/etc/pki:ro \
  38. {% if l_bind_docker_reg_auth %} -v {{ oreg_auth_credentials_path }}:/root/.docker:ro{% endif %}\
  39. {{ openshift.node.node_image }}:${IMAGE_VERSION}
  40. ExecStartPost=/usr/bin/sleep 10
  41. ExecStop=/usr/bin/docker stop {{ openshift.common.service_type }}-node
  42. ExecStopPost=/usr/bin/rm /etc/dnsmasq.d/node-dnsmasq.conf
  43. ExecStopPost=/usr/bin/dbus-send --system --dest=uk.org.thekelleys.dnsmasq /uk/org/thekelleys/dnsmasq uk.org.thekelleys.SetDomainServers array:string:
  44. SyslogIdentifier={{ openshift.common.service_type }}-node
  45. Restart=always
  46. RestartSec=5s
  47. [Install]
  48. WantedBy={{ openshift.docker.service_name }}.service