haproxy.docker.service.j2 987 B

12345678910111213141516171819
  1. [Unit]
  2. After={{ openshift_docker_service_name }}.service
  3. After=chronyd.service
  4. After=ntpd.service
  5. Requires={{ openshift_docker_service_name }}.service
  6. PartOf={{ openshift_docker_service_name }}.service
  7. [Service]
  8. ExecStartPre=-/usr/bin/docker rm -f openshift_loadbalancer
  9. ExecStart=/usr/bin/docker run --rm --name openshift_loadbalancer {% for frontend in openshift_loadbalancer_frontends %} {% for bind in frontend.binds %} -p {{ bind |regex_replace('^[^:]*:(\d+).*$', '\\1') }}:{{ bind |regex_replace('^[^:]*:(\d+).*$', '\\1') }} {% endfor %} {% endfor %} -v /etc/haproxy/haproxy.cfg:/etc/haproxy/haproxy.cfg:ro --entrypoint=haproxy {{ openshift_router_image }}:{{ openshift_image_tag }} -f /etc/haproxy/haproxy.cfg
  10. ExecStartPost=/usr/bin/sleep 10
  11. ExecStop=/usr/bin/docker stop openshift_loadbalancer
  12. LimitNOFILE={{ openshift_loadbalancer_limit_nofile | default(100000) }}
  13. LimitCORE=infinity
  14. Restart=always
  15. RestartSec=5s
  16. [Install]
  17. WantedBy={{ openshift_docker_service_name }}.service