Skip to content

Commit b4ef150

Browse files
committed
refactor(lb): Make configurable the Traefik endpoints
Instead of hard-coding them in the Traefik static config, they can be set as the polaris.traefik_endpoints variable. This means changes to the Polaris collection aren't required every time we need to change the endpoints (e.g. to temporarily provide public access to a usually private service).
1 parent c9080f1 commit b4ef150

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

playbooks/lb/templates/traefik-config.yaml.j2

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,7 @@
11
entryPoints:
2-
web:
3-
address: ":80"
4-
{% if tls_files|length %}
5-
http:
6-
redirections:
7-
entryPoint:
8-
to: websecure
9-
scheme: https
10-
{% endif %}
11-
12-
websecure:
13-
address: ":443"
14-
15-
headscale:
16-
address: ":18080"
2+
{% for id, entrypoint in (polaris.traefik_entrypoints | default({"websecure":{"address":":443"}})).items() %}
3+
{{ id }}: {{ entrypoint }}
4+
{% endfor %}
175

186
accessLog:
197
# TODO logrotation

variables.schema.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,19 @@ properties:
9696
'--login-server http://swarm-manager:18080'
9797
]
9898

99+
traefik_entrypoints:
100+
type: object
101+
description: >
102+
Entrypoints required by Traefik for its static configuration.
103+
Please see for details: https://doc.traefik.io/traefik/routing/entrypoints/
104+
additionalProperties: true
105+
examples:
106+
- http:
107+
address: ':443'
108+
default:
109+
websecure:
110+
address: ':443'
111+
99112
traefik_tls_files:
100113
type: array
101114
description: SOPS encrypted certificate and keyfile to inject into traefik for TLS offloading

0 commit comments

Comments
 (0)