The http checks can be customized.

This commit is contained in:
Andrea Dell'Amico 2020-10-21 16:50:43 +02:00
parent a2a2943812
commit d737274623
2 changed files with 10 additions and 3 deletions

View File

@ -9,6 +9,8 @@ docker_swarm_haproxy_swarm_port: '{{ docker_api_port }}'
#
docker_swarm_expose_api_via_haproxy: True
docker_swarm_expose_api_hostname: 'swarm.example.com'
docker_swarm_api_backend: 'dockersocket /var/run/docker.sock'
docker_swarm_api_check_availability: True
docker_swarm_api_networks_acl:
- '127.0.0.1/8'
# Portainer

View File

@ -147,7 +147,11 @@ frontend docker_ft
# swarm API
backend swarm_api_bck
mode http
server dockersocket /var/run/docker.sock
{% if docker_swarm_api_check_availability %}
http-check send meth HEAD uri /version ver HTTP/1.1 hdr Host localhost
http-check expect rstatus (2|3)[0-9][0-9]
{% endif %}
server {{ docker_swarm_api_backend }}
{% endif %}
{% if docker_swarm_cluster_portainer_install %}
@ -165,8 +169,9 @@ backend {{ srv.acl_name }}_bck
mode http
option httpchk
balance {{ srv.balance_type | default('roundrobin') }}
http-check send meth HEAD uri / ver HTTP/1.1 hdr Host localhost
http-check expect rstatus (2|3)[0-9][0-9]
{% if srv.http_check_enabled is defined and srv.http_check_enabled %}
http-check send {{ srv.http_check }}
http-check expect {{ srv.http_check_expect }}
{% if srv.stick_sessions %}
{% if srv.stick_on_cookie %}
cookie {{ srv.stick_cookie }}