openshift.docker.node.service 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. [Unit]
  2. After={{ openshift_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_node_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_service_type }}-master.service
  14. Requires={{ openshift_service_type }}-node-dep.service
  15. After={{ openshift_service_type }}-node-dep.service
  16. Wants=dnsmasq.service
  17. After=dnsmasq.service
  18. [Service]
  19. EnvironmentFile=/etc/sysconfig/{{ openshift_service_type }}-node
  20. EnvironmentFile=/etc/sysconfig/{{ openshift_service_type }}-node-dep
  21. ExecStartPre=-/usr/bin/docker rm -f {{ openshift_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_service_type }}-node \
  25. --rm --privileged --net=host --pid=host --env-file=/etc/sysconfig/{{ openshift_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 \
  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. {% if openshift_use_nuage | default(false) -%} $NUAGE_ADDTL_BIND_MOUNTS {% endif -%} \
  38. -v /dev:/dev $DOCKER_ADDTL_BIND_MOUNTS -v /etc/pki:/etc/pki:ro \
  39. {% if l_bind_docker_reg_auth %} -v {{ oreg_auth_credentials_path }}:/root/.docker:ro{% endif %}\
  40. {{ osn_image }}:${IMAGE_VERSION}
  41. ExecStartPost=/usr/bin/sleep 10
  42. ExecStop=/usr/bin/docker stop {{ openshift_service_type }}-node
  43. ExecStopPost=/usr/bin/rm /etc/dnsmasq.d/node-dnsmasq.conf
  44. ExecStopPost=/usr/bin/dbus-send --system --dest=uk.org.thekelleys.dnsmasq /uk/org/thekelleys/dnsmasq uk.org.thekelleys.SetDomainServers array:string:
  45. SyslogIdentifier={{ openshift_service_type }}-node
  46. Restart=always
  47. RestartSec=5s
  48. [Install]
  49. WantedBy={{ openshift_docker_service_name }}.service