Using latest traefik; and frontend Rules are working; hooked up automatically via tagging as per below via Nomad scheduler.
...
tags = [
"traefik.tag=blue",
"traefik.frontend.rule=Host:www.10.0.2.5.xip.io;Path:/whoami",
"traefik.frontend.entryPoints=http"
]
...
However, when running with simple constraints; it does not seem to work (everything is pruned).
sudo ./traefik --constraints="tag==blue" --debug
Debug log:
...
DEBU[2016-12-09T13:01:31Z] Service global-whoami pruned by 'tag==blue' constraint
DEBU[2016-12-09T13:01:31Z] Service global-whoami pruned by 'tag==blue' constraint
DEBU[2016-12-09T13:01:31Z] Service global-whoami pruned by 'tag==blue' constraint
DEBU[2016-12-09T13:01:31Z] Service global-whoami pruned by 'tag==blue' constraint
DEBU[2016-12-09T13:01:31Z] Service global-whoami pruned by 'tag==blue' constraint
...
Try changing "traefik.tag=blue" to "traefik.tags=blue"
You can add more tags: "traefik.tags=blue,external,lolcats"
@freefood89 Thanks; it works! For reference, the below setup works for me:
Only route to containers tagged 'lolcats':
sudo ./traefik --constraints="tag==lolcats"
Jobs with multiple traefik.tags (including the 'lolcats' tag):
...
tags = [
"traefik.tags=blue,lolcats",
"traefik.frontend.rule=Host:www.10.0.2.5.xip.io;Path:/whoami",
"traefik.frontend.entryPoints=http"
]
..
@freefood89 from docs it's not very evident that traefik will only parse consul tags that start with traefik.tags=, e.g.
{
"services": [
{
"name": "web-srv",
"port": 8080,
"tags": [
"traefik.tags=trk"
]
}
]
}
it will be more user-friendly if traefik consumes ordinary consul tags, e.g
{
"services": [
{
"name": "web-srv",
"port": 8080,
"tags": [
"trk"
]
}
]
}
as shown in consul docs
Most helpful comment
@freefood89 from docs it's not very evident that traefik will only parse consul tags that start with
traefik.tags=, e.g.it will be more user-friendly if traefik consumes ordinary consul tags, e.g
as shown in consul docs