Explained the latest modifications of Traefik container labels

This commit is contained in:
Kartikey Tanna
2023-04-11 10:17:38 +05:30
parent 18031bc552
commit d3936363d0

View File

@@ -306,8 +306,9 @@ You can specialize the default Traefik rules by setting labels on the containers
```yaml
labels:
traefik.http.routers.hey.rule: Host(`app.hey.com`)
traefik.http.routers.hey-web.rule: Host(`app.hey.com`)
```
Traefik rules are in the "service-role-destination" format. The default role will be `web` if no rule is specified. If the destination is not specified, it is not included. To give an example, the above rule would become "traefik.http.routers.hey-web.rule" if it was for the "staging" destination.
Note: The backticks are needed to ensure the rule is passed in correctly and not treated as command substitution by Bash!