From c27d60a7a7158bc2fe8523e153d040611036c69f Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 29 Oct 2021 15:12:31 +1300 Subject: [PATCH 1/2] Fix traefik --- manuscript/ha-docker-swarm/traefik.md | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/manuscript/ha-docker-swarm/traefik.md b/manuscript/ha-docker-swarm/traefik.md index eb203197..55c04fb2 100644 --- a/manuscript/ha-docker-swarm/traefik.md +++ b/manuscript/ha-docker-swarm/traefik.md @@ -34,7 +34,7 @@ To deal with these gaps, we need a front-end load-balancer, and in this design, While it's possible to configure traefik via docker command arguments, I prefer to create a config file (`traefik.toml`). This allows me to change traefik's behaviour by simply changing the file, and keeps my docker config simple. -Create `/var/data/traefikv2/traefik.toml` as follows: +Create `/var/data/config/traefikv2/traefik.toml` as follows: ```bash [global] @@ -140,17 +140,9 @@ services: # original source IP, which would impact logging. If you don't care about this, you can expose ports the # "minimal" way instead ports: - - target: 80 - published: 80 - protocol: tcp - mode: host - - target: 443 - published: 443 - protocol: tcp - mode: host - - target: 8080 - published: 8080 - protocol: tcp + - "80:80" + - "8080:8080" # traefik dashboard + - "443:443" volumes: - /var/run/docker.sock:/var/run/docker.sock:ro - /var/data/config/traefikv2:/etc/traefik @@ -171,7 +163,7 @@ services: - "traefik.http.routers.api.tls=true" - "traefik.http.routers.api.tls.certresolver=main" - "traefik.http.routers.api.service=api@internal" - - "traefik.http.services.dummy.loadbalancer.server.port=9999" + - "traefik.http.services.api.loadbalancer.server.port=8080" # uncomment this to enable forward authentication on the traefik api/dashboard #- "traefik.http.routers.api.middlewares=forward-auth" From 4f0af2a786b010b30c747604305eeb838756a18b Mon Sep 17 00:00:00 2001 From: Benjamin Durham <33912370+Bencey@users.noreply.github.com> Date: Wed, 3 Nov 2021 15:57:42 +1300 Subject: [PATCH 2/2] Readd hostmode --- manuscript/ha-docker-swarm/traefik.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/manuscript/ha-docker-swarm/traefik.md b/manuscript/ha-docker-swarm/traefik.md index 55c04fb2..7ef23b4f 100644 --- a/manuscript/ha-docker-swarm/traefik.md +++ b/manuscript/ha-docker-swarm/traefik.md @@ -140,9 +140,17 @@ services: # original source IP, which would impact logging. If you don't care about this, you can expose ports the # "minimal" way instead ports: - - "80:80" - - "8080:8080" # traefik dashboard - - "443:443" + - target: 80 + published: 80 + protocol: tcp + mode: host + - target: 443 + published: 443 + protocol: tcp + mode: host + - target: 8080 + published: 8080 + protocol: tcp volumes: - /var/run/docker.sock:/var/run/docker.sock:ro - /var/data/config/traefikv2:/etc/traefik