summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElizabeth Hunt <me@liz.coffee>2025-05-04 15:13:29 -0700
committerElizabeth Hunt <me@liz.coffee>2025-05-04 15:15:26 -0700
commitb15dfc4a99c066be88406df259bd6367a26b48e4 (patch)
tree7661a1caaf1ce136dd764705104c81fce514be87
parent7040a443c5973be872cdf5f3a656e9f947650b2b (diff)
downloadinfra-b15dfc4a99c066be88406df259bd6367a26b48e4.tar.gz
infra-b15dfc4a99c066be88406df259bd6367a26b48e4.zip
Whatever. Few seconds of downtime for each traefik instance isnt bad since the important stuff is on other ports
-rw-r--r--playbooks/roles/traefik/templates/stacks/docker-compose.yml18
-rw-r--r--playbooks/roles/traefik/templates/stacks/traefik.yml2
2 files changed, 12 insertions, 8 deletions
diff --git a/playbooks/roles/traefik/templates/stacks/docker-compose.yml b/playbooks/roles/traefik/templates/stacks/docker-compose.yml
index ad5e228..6362b31 100644
--- a/playbooks/roles/traefik/templates/stacks/docker-compose.yml
+++ b/playbooks/roles/traefik/templates/stacks/docker-compose.yml
@@ -29,16 +29,18 @@ services:
parallelism: 1
order: start-first
failure_action: rollback
- monitor: 8s
+ monitor: 2s
traefik:
image: traefik:v3
depends_on:
- headscale-client
ports:
- # TODO: FIGURE OUT HOW TO READ X-FORWARDED-FOR CORRECTLY
- # http
- - "80:80"
- - "443:443"
+ - target: 80
+ published: 80
+ mode: host
+ - target: 443
+ published: 443
+ mode: host # to get x-forwarded-for correctly, see https://github.com/moby/moby/issues/25526
healthcheck:
test: traefik healthcheck --ping
interval: 10s
@@ -57,12 +59,12 @@ services:
- proxy
- headnet
deploy:
- mode: replicated
+ mode: global
update_config:
parallelism: 1
- order: start-first
+ order: stop-first # only one service eating 80/443 per host, since
failure_action: rollback
- monitor: 8s
+ monitor: 2s # go go go.
labels:
- traefik.enable=true
- traefik.http.routers.dashboard.rule=Host(`{{ traefik_domain }}`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))
diff --git a/playbooks/roles/traefik/templates/stacks/traefik.yml b/playbooks/roles/traefik/templates/stacks/traefik.yml
index e677a60..3b9f680 100644
--- a/playbooks/roles/traefik/templates/stacks/traefik.yml
+++ b/playbooks/roles/traefik/templates/stacks/traefik.yml
@@ -12,6 +12,7 @@ entryPoints:
forwardedHeaders:
trustedIPs:
- "{{ homelab_network }}"
+ - "{{ docker_network }}"
http:
redirections:
entryPoint:
@@ -22,6 +23,7 @@ entryPoints:
forwardedHeaders:
trustedIPs:
- "{{ homelab_network }}"
+ - "{{ docker_network }}"
serversTransport:
insecureSkipVerify: true