I'm very puzzled by the following, hopefully someone can shine a light on why this happening:
Traefik works but only if I include the label:
traefik.http.services.random-xbcz.loadbalancer.server.port: "80"
But this label should not be needed...
Without this label, going to the Traefik url results in
404 page not found
Whatever I use as an service name it works. The service name itself is nowhere used/referenced in the compose file or traefik configurations files.
I don't understand why I can't leave out the label:
traefik.http.services.random-xbcz.loadbalancer.server.port: "80"
Anybody knows what could be the reason?
Setup information
Network macvlan.
Ping from the host to the traefik IP 192.168.1.231 works.
The traefik dashboard shows (if it works):
|| status || name || type || servers || providers ||
| ok | api@internal | - | 0 | ae |
| ok | random-xbcz | loadbalancer | 1 | docker |
Going to the random-xbcz service page shows:
status: down (red)
url: http://192.168.1.231
weight: 1
Although the added link refers to service that is down, Traefik is working...
The relevant compose parts
labels:
traefik.enable: "true"
traefik.http.middlewares.sslheader.headers.customrequestheaders.X-Forwarded-Proto: https
traefik.http.routers.traefik01-web-club-secure.entrypoints: https
traefik.http.routers.traefik01-web-club-secure.middlewares: traefik-auth,sslheader
traefik.http.routers.traefik01-web-club-secure.rule: Host(`traefik01.web.example.com`)
traefik.http.routers.traefik01-web-club-secure.service: api@internal
traefik.http.routers.traefik01-web-club-secure.tls: "true"
traefik.http.routers.traefik01-web-club-secure.tls.certresolver: mijnhost
traefik.http.services.random-xbcz.loadbalancer.server.port: "80"
networks:
macvlan01:
ipv4_address: 192.168.1.231
networks:
macvlan01:
name: macvlan01
external: true
Traefik config:
$ cat config/traefik.yml
api:
dashboard: true
debug: true
entryPoints:
http:
address: ":80"
http-external:
address: ":81"
https:
address: ":443"
https-external:
address: ":444"
serversTransport:
insecureSkipVerify: true
providers:
docker:
endpoint: "unix:///var/run/docker.sock"
exposedByDefault: false
file:
filename: /config.yml
watch: true
redis:
endpoints:
- "redis:6379"
Hopefully someone can shine a light on why this happening.