I'm migrating from v1 to v2 and there are two things I'm concerned with:
-
In v1, I only have to specify host, and port, the rest of the labels are an unchanging template. In v2 the service name is specified two additional times. Is it possible to avoid this?
-
When specifying the port, the documentation uses
SERVICE-service
in the label. Is{container-name}-service
the required format? I found the example in the docs, but couldn't find an explanation of why{}-service
.
See this example for a service named SERVICE
running on port PORT
:
v1:
labels:
traefik.enable: "true"
traefik.frontend.rule: 'Host: SERVICE.example.com'
traefik.port: 'PORT'
v2:
labels:
traefik.enable: "true"
traefik.http.routers.SERVICE.rule: "Host(`SERVICE.exeample.com`)"
traefik.http.services.SERVICE-service.loadbalancer.server.port: "PORT"