Use new traefik_tags template

This commit is contained in:
Daniel Berteaud 2024-01-26 23:28:03 +01:00
parent 2d34a301ce
commit 58bbd552a5
3 changed files with 7 additions and 7 deletions

View File

@ -22,12 +22,9 @@ job "[[ .instance ]]" {
[[ template "common/connect" $c ]]
tags = [
"[[ $c.traefik.instance ]].enable=true",
# Note : add a fake host in the rule to prevent warnings in Traefik logs
"[[ $c.traefik.instance ]].http.routers.[[ .instance ]][[ .consul.suffix ]].rule=Host(`fake-acme-host`) || PathPrefix(`/.well-known/acme-challenge/`)",
"[[ $c.traefik.instance ]].http.routers.[[ .instance ]][[ .consul.suffix ]].priority=[[ $c.traefik.priority ]]",
"[[ $c.traefik.instance ]].http.routers.[[ .instance ]][[ .consul.suffix ]].entrypoints=[[ join $c.traefik.entrypoints "," ]]",
"[[ $c.traefik.instance ]].http.routers.[[ .instance ]][[ .consul.suffix ]].middlewares=[[ template "common/traefik_middlewares" $c ]]"
[[ template "common/traefik_tags" $c ]]
]
}

View File

@ -45,12 +45,14 @@ job "acme-to-vault" {
tags = [
"traefik.enable=true",
# Note : add a fake host in the rule to prevent warnings in Traefik logs
"traefik.http.routers.acme-to-vault.rule=Host(`fake-acme-host`) || PathPrefix(`/.well-known/acme-challenge/`)",
"traefik.http.routers.acme-to-vault.priority=2000",
"traefik.enable=true",
"traefik.http.routers.acme-to-vault.entrypoints=http,https",
"traefik.http.routers.acme-to-vault.middlewares=rate-limit-std@file,inflight-std@file,security-headers@file,hsts@file"
"traefik.http.routers.acme-to-vault.priority=2000",
"traefik.http.routers.acme-to-vault.middlewares=rate-limit-std@file,inflight-std@file,security-headers@file,hsts@file",
]
}

View File

@ -34,6 +34,7 @@ acme:
- http
- https
priority: 2000
auto_rule: false
accounts: []
# accounts: