Hi,
We have a situation where we want to deploy multiple stacks at different paths using the same compose file using Traefik v2.
For example:
...
traefik.http.routers.my-app-router.rule: "PathPrefix(`/my-app/${BRANCH_NAME}`)"
traefik.http.routers.my-app-router.middlewares: "my-app-middleware1"
traefik.http.middlewares.my-app-middleware1.stripprefix.prefixes: "/my-app/${BRANCH_NAME}"
traefik.http.routers.my-app-router.service: "my-app-service"
traefik.http.services.my-app-service.loadbalancer.server.port: "8080"
...
That doesn't seem to work, though, since the deployment labels translate to a global configuration in traefik and the two stacks end up clashing.
It isn't possible to use variables in the label keys (i.e. traefik.http.routers.my-app-${BRANCH_NAME}-router.rule
). Is there some way to accomplish this declaratively without resorting to adding the labels in a post deployment process using the cli or something similar? Is it possible to scope or namespace the labels per stack?