The docs are very very sparse on the traefik consul integeration.
For the Nomad job I have configured the following:
args = [
# "--log.level=DEBUG",
# "--api.insecure=true",
# consul
"--providers.consulCatalog=true",
"--providers.consulCatalog.prefix=nodejs",
"--providers.consulCatalog.exposedByDefault=false",
# ports
"--entrypoints.web.address=:80",
"--entrypoints.websecure.address=:443",
"--entrypoints.websecure.http.tls=true",
# redirects
"--entrypoints.web.http.redirections.entrypoint.to=websecure",
"--entrypoints.web.http.redirections.entrypoint.scheme=https",
# certificats
"--entrypoints.websecure.http.tls.certResolver=le",
"--certificatesresolvers.le.acme.email=tcurdt@foo.com",
"--certificatesresolvers.le.acme.storage=/acme.json",
"--certificatesresolvers.le.acme.tlschallenge=true",
"--certificatesresolvers.le.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory",
]
and the content of consul looks like this:
{
"consul": [],
"mongodb": [],
"nodejs": [
"traefik.enable=true",
"traefik.http.services.nodejs.loadbalancer.server.port=80",
"traefik.http.routers.nodejs.rule=HostRegexp(`{host:.+}`)",
"traefik.http.routers.nodejs.tls=true",
"traefik.http.routers.nodejs.tls.certresolver=le",
"traefik.http.routers.nodejs.entrypoints=websecure"
],
"nomad": [
"serf",
"rpc",
"http"
],
"nomad-client": [
"http"
],
"traefik": []
}
IIUC the prefix points to the node in consul - but it does not seem to pick up the service for the catalog. What am I missing?