master.docker.service.j2 1.1 KB

123456789101112131415161718
  1. [Unit]
  2. After=docker.service
  3. Requires=docker.service
  4. PartOf=docker.service
  5. After=etcd_container.service
  6. Wants=etcd_container.service
  7. [Service]
  8. EnvironmentFile=/etc/sysconfig/{{ openshift.common.service_type }}-master
  9. ExecStartPre=-/usr/bin/docker rm -f {{ openshift.common.service_type }}-master
  10. ExecStart=/usr/bin/docker run --rm --privileged --net=host --name {{ openshift.common.service_type }}-master --env-file=/etc/sysconfig/{{ openshift.common.service_type }}-master -v {{ openshift.common.data_dir }}:{{ openshift.common.data_dir }} -v /var/run/docker.sock:/var/run/docker.sock -v {{ openshift.common.config_base }}:{{ openshift.common.config_base }} {% if 'cloudprovider' in openshift and 'kind' in openshift.cloudprovider and openshift.cloudprovider.kind != '' -%} -v {{ openshift.common.config_base }}/cloudprovider:{{ openshift.common.config_base}}/cloudprovider {% endif -%} {{ openshift.master.master_image }}:${IMAGE_VERSION} start master --config=${CONFIG_FILE} $OPTIONS
  11. ExecStartPost=/usr/bin/sleep 10
  12. ExecStop=/usr/bin/docker stop {{ openshift.common.service_type }}-master
  13. Restart=always
  14. RestartSec=5s
  15. [Install]
  16. WantedBy=docker.service