Special case for the shinyproxy metrics.

This commit is contained in:
Andrea Dell'Amico 2021-04-11 19:11:23 +02:00
parent 3ad7a0168f
commit 587bfa537c
2 changed files with 17 additions and 2 deletions

View File

@ -5,7 +5,7 @@ docker_swarm_haproxy_installation_type: 'global'
# I did not find any way to make it dependant on docker_swarm_haproxy_installation_type
docker_swarm_haproxy_keepalive_installation: False
docker_swarm_haproxy_swarm_port: '{{ docker_api_port }}'
docker_swarm_haproxy_plain_http_api: True
#
docker_swarm_expose_api_via_haproxy: True
docker_swarm_expose_api_hostname: 'swarm.example.com'
@ -19,6 +19,9 @@ docker_swarm_portainer_hostname: 'portainer-swarm.example.com'
docker_swarm_portainer_additional_constraints: []
# - 'node.hostname != docker01'
# This is ugly
docker_swarm_haproxy_shinyproxy_metrics: False
docker_swarm_portainer_network: 'agent_network'
docker_swarm_portainer_http_port: '9000'
docker_swarm_portainer_service_port: '8000'

View File

@ -106,7 +106,11 @@ frontend http
{% if docker_swarm_expose_api_via_haproxy %}
frontend docker_ft
bind :{{ docker_swarm_haproxy_swarm_port }} ssl crt {{ haproxy_cert_dir }} alpn h2,http/1.1 {% if docker_swarm_haproxy_installation_type == 'global' %}accept-proxy{% endif %}
{% if docker_swarm_haproxy_plain_http_api: %}
bind :{{ docker_swarm_haproxy_swarm_port }} {% if docker_swarm_haproxy_installation_type == 'global' %}accept-proxy{% endif %}
{% else %}
bind :{{ docker_swarm_haproxy_swarm_port }} ssl crt {{ haproxy_cert_dir }} alpn h2,http/1.1 {% if docker_swarm_haproxy_installation_type == 'global' %}accept-proxy{% endif %}
{% endif %}
mode http
acl swarm_api hdr_dom(host) -i {{ docker_swarm_expose_api_hostname }}
@ -143,6 +147,14 @@ frontend docker_ft
default_backend swarm_api_bck
{% endif %}
{% if docker_swarm_haproxy_shinyproxy_metrics %}
# shinyproxy opens a second port, 9090, to expose its metrics to prometheus
frontend shinyproxy_metrics
bind :9090
mode http
default_backend shinyproxy_metrics
{% endif %}
#
# Backends
#