openshift.docker.node.service 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. [Unit]
  2. After={{ openshift_service_type }}-master.service
  3. After={{ openshift_docker_service_name }}.service
  4. After=chronyd.service
  5. After=ntpd.service
  6. PartOf={{ openshift_docker_service_name }}.service
  7. Requires={{ openshift_docker_service_name }}.service
  8. Wants={{ openshift_service_type }}-master.service
  9. Requires={{ openshift_service_type }}-node-dep.service
  10. After={{ openshift_service_type }}-node-dep.service
  11. Wants=dnsmasq.service
  12. After=dnsmasq.service
  13. [Service]
  14. EnvironmentFile=/etc/sysconfig/{{ openshift_service_type }}-node
  15. EnvironmentFile=/etc/sysconfig/{{ openshift_service_type }}-node-dep
  16. ExecStartPre=-/usr/bin/docker rm -f {{ openshift_service_type }}-node
  17. ExecStartPre=/usr/bin/cp /etc/origin/node/node-dnsmasq.conf /etc/dnsmasq.d/
  18. 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
  19. ExecStart=/usr/bin/docker run --name {{ openshift_service_type }}-node \
  20. --rm --privileged --net=host --pid=host --env-file=/etc/sysconfig/{{ openshift_service_type }}-node \
  21. --entrypoint /usr/local/bin/openshift-node \
  22. -v /:/rootfs:ro,rslave -e CONFIG_FILE=${CONFIG_FILE} -e OPTIONS=${OPTIONS} -e DEBUG_LOGLEVEL=${DEBUG_LOGLEVEL}\
  23. -e HOST=/rootfs -e HOST_ETC=/host-etc \
  24. -v {{ openshift_node_data_dir }}:{{ openshift_node_data_dir }}:rslave \
  25. -v {{ openshift.common.config_base }}/node:{{ openshift.common.config_base }}/node \
  26. {% if openshift_cloudprovider_kind | default('') != '' -%} -v {{ openshift.common.config_base }}/cloudprovider:{{ openshift.common.config_base}}/cloudprovider {% endif -%} \
  27. -v /etc/localtime:/etc/localtime:ro -v /etc/machine-id:/etc/machine-id:ro \
  28. -v /run:/run -v /sys:/sys:rw -v /sys/fs/cgroup:/sys/fs/cgroup:rw \
  29. -v /usr/bin/docker:/usr/bin/docker:ro -v /var/lib/docker:/var/lib/docker \
  30. -v /lib/modules:/lib/modules \
  31. -v /etc/cni:/etc/cni:ro -v /opt/cni:/opt/cni:ro \
  32. -v /etc/systemd/system:/host-etc/systemd/system -v /var/log:/var/log \
  33. {% if openshift_use_nuage | default(false) -%} $NUAGE_ADDTL_BIND_MOUNTS {% endif -%} \
  34. -v /dev:/dev $DOCKER_ADDTL_BIND_MOUNTS -v /etc/pki:/etc/pki:ro \
  35. {% if l_bind_docker_reg_auth %} -v {{ oreg_auth_credentials_path }}:/root/.docker:ro{% endif %}\
  36. {{ osn_image }}:${IMAGE_VERSION}
  37. ExecStartPost=/usr/bin/sleep 10
  38. ExecStop=/usr/bin/docker stop {{ openshift_service_type }}-node
  39. ExecStopPost=/usr/bin/rm /etc/dnsmasq.d/node-dnsmasq.conf
  40. ExecStopPost=/usr/bin/dbus-send --system --dest=uk.org.thekelleys.dnsmasq /uk/org/thekelleys/dnsmasq uk.org.thekelleys.SetDomainServers array:string:
  41. SyslogIdentifier={{ openshift_service_type }}-node
  42. Restart=always
  43. RestartSec=5s
  44. [Install]
  45. WantedBy={{ openshift_docker_service_name }}.service