From 50dc7231207a0ef8e14eecd731777be346876c83 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Wed, 7 Oct 2020 18:36:02 +0200 Subject: [PATCH] Dedicated port for the docker api --- templates/haproxy-docker-stack.yml.j2 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/templates/haproxy-docker-stack.yml.j2 b/templates/haproxy-docker-stack.yml.j2 index 3b256f8..4aacbd9 100644 --- a/templates/haproxy-docker-stack.yml.j2 +++ b/templates/haproxy-docker-stack.yml.j2 @@ -32,7 +32,18 @@ services: {% else %} mode: host {% endif %} - dns: [127.0.0.11] +{% if docker_swarm_expose_api_via_haproxy %} + - target: {{ docker_swarm_haproxy_swarm_port }} + published: {{ docker_swarm_haproxy_swarm_port }} + protocol: tcp +{% if docker_swarm_haproxy_installation_type == 'mesh' %} + mode: ingress +{% else %} + mode: host +{% endif %} +{% endif %} + +dns: [127.0.0.11] deploy: {% if docker_swarm_haproxy_installation_type == 'keepalive' or docker_swarm_haproxy_installation_type == 'mesh' %} mode: replicated