haproxy.docker.service.j2 953 B

1234567891011121314151617
  1. [Unit]
  2. After={{ openshift.docker.service_name }}.service
  3. Requires={{ openshift.docker.service_name }}.service
  4. PartOf={{ openshift.docker.service_name }}.service
  5. [Service]
  6. ExecStartPre=-/usr/bin/docker rm -f openshift_loadbalancer
  7. 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.common.router_image }}:{{ openshift_image_tag }} -f /etc/haproxy/haproxy.cfg
  8. ExecStartPost=/usr/bin/sleep 10
  9. ExecStop=/usr/bin/docker stop openshift_loadbalancer
  10. LimitNOFILE={{ openshift_loadbalancer_limit_nofile | default(100000) }}
  11. LimitCORE=infinity
  12. Restart=always
  13. RestartSec=5s
  14. [Install]
  15. WantedBy={{ openshift.docker.service_name }}.service