When I navigate to Traefik dashboard and click on services, I can see Traefik service there. When I click on it, the server has an error exclamation mark next to it.
Interestingly, Traefik dashboard works even if server is not in successful state. If I navigate to /api/http/services/traefik@docker
, I don't see any error message there:
{
"loadBalancer":{
"servers":[
{
"url":"https://10.0.7.234:8080"
}
],
"passHostHeader":true
},
"status":"enabled",
"name":"traefik@docker",
"provider":"docker",
"type":"loadbalancer"
}
Here is my configuration:
docker-compose-traefik.yml
version: "3.7"
services:
traefik:
image: "traefik:v2.0"
networks:
- traefik-net
ports:
- "9000:9000"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "./config/:/etc/traefik/"
- "./cert/:/cert/"
deploy:
replicas: 1
labels:
# enable Traefik for this service
- "traefik.enable=true"
- "traefik.docker.network=traefik-net"
# dashboard
- "traefik.http.routers.traefik.rule=Host(`example.com`)"
- "traefik.http.routers.traefik.entrypoints=traefik"
- "traefik.http.routers.traefik.tls=true"
- "traefik.http.routers.traefik.service=api@internal"
# service
- "traefik.http.services.traefik.loadbalancer.server.port=8080"
- "traefik.http.services.traefik.loadbalancer.server.scheme=https"
networks:
traefik-net:
external: true
name: traefik-net
config/traefik.yml
log:
level: DEBUG
api:
dashboard: true
insecure: false
serversTransport:
insecureSkipVerify: true
providers:
file:
directory: "/etc/traefik"
watch: true
docker:
swarmMode: true
exposedByDefault: false
entrypoints:
traefik:
address: ":9000"
config/dynamic_conf.yml
tls:
stores:
default:
defaultCertificate:
certFile: /cert/example.com.crt
keyFile: /cert/example.com.key
certificates:
- certFile: /cert/example.com.crt
keyFile: /cert/example.com.key
stores:
- default
I can see in the logs that server is not created for Traefik. For other services I can see the following debug output (ex. Creating server 0 https://10.0.7.237:443
). Can this be a reason for exclamation mark? If not, how can I check what is wrong with the server? Why is server not being created?