providers/proxy: set traefik labels using object_naming_template instead of UUID

This commit is contained in:
Jens Langhammer 2022-02-01 17:13:27 +00:00
parent 0232c4e162
commit 88603fa4f7
2 changed files with 7 additions and 7 deletions

View File

@ -23,7 +23,7 @@ class ProxyDockerController(DockerController):
proxy_provider: ProxyProvider proxy_provider: ProxyProvider
external_host_name = urlparse(proxy_provider.external_host) external_host_name = urlparse(proxy_provider.external_host)
hosts.append(f"`{external_host_name.netloc}`") hosts.append(f"`{external_host_name.netloc}`")
traefik_name = f"ak-outpost-{self.outpost.pk.hex}" traefik_name = self.name
labels = super()._get_labels() labels = super()._get_labels()
labels["traefik.enable"] = "true" labels["traefik.enable"] = "true"
labels[ labels[

View File

@ -23,12 +23,12 @@ The container is created with the following hardcoded properties:
Additionally, the proxy outposts have the following extra labels to add themselves into traefik automatically. Additionally, the proxy outposts have the following extra labels to add themselves into traefik automatically.
- `traefik.enable`: "true" - `traefik.enable`: "true"
- `traefik.http.routers.ak-outpost-<outpost-id>-router.rule`: `Host(...)` - `traefik.http.routers.ak-outpost-<outpost-name>-router.rule`: `Host(...)`
- `traefik.http.routers.ak-outpost-<outpost-id>-router.service`: `ak-outpost-<outpost-id>-service` - `traefik.http.routers.ak-outpost-<outpost-name>-router.service`: `ak-outpost-<outpost-name>-service`
- `traefik.http.routers.ak-outpost-<outpost-id>-router.tls`: "true" - `traefik.http.routers.ak-outpost-<outpost-name>-router.tls`: "true"
- `traefik.http.services.ak-outpost-<outpost-id>-service.loadbalancer.healthcheck.path`: "/akprox/ping" - `traefik.http.services.ak-outpost-<outpost-name>-service.loadbalancer.healthcheck.path`: "/akprox/ping"
- `traefik.http.services.ak-outpost-<outpost-id>-service.loadbalancer.healthcheck.port`: "9300" - `traefik.http.services.ak-outpost-<outpost-name>-service.loadbalancer.healthcheck.port`: "9300"
- `traefik.http.services.ak-outpost-<outpost-id>-service.loadbalancer.server.port`: "9000" - `traefik.http.services.ak-outpost-<outpost-name>-service.loadbalancer.server.port`: "9000"
## Permissions ## Permissions