I have a small docker swam setup with 3 nodes.
Traefik is running on the manager node with this stack file:
version: '3.8'
services:
traefik:
image: traefik:v2.6
command:
- --configFile=/traefik.yml
ports:
- 80:80
- 8080:8080
- 443:443
deploy:
mode: global
placement:
constraints:
- node.role == manager
labels:
- traefik.enable=true
- traefik.docker.network=traefik-public
- traefik.http.routers.traefik-public-https.middlewares=admin-auth
- traefik.http.middlewares.admin-auth.basicauth.users=admin:kttMoHm$$ZeaIvc8uDXZaapr1$$xsez8wWG$$2O0
- traefik.http.middlewares.https-redirect.redirectscheme.scheme=https
- traefik.http.middlewares.https-redirect.redirectscheme.permanent=true
- traefik.http.routers.traefik-public-http.rule=Host(`traefik-test.mydomain.com`)
- traefik.http.routers.traefik-public-http.entrypoints=http
- traefik.http.routers.traefik-public-http.middlewares=https-redirect
- traefik.http.routers.traefik-public-https.rule=Host(`traefik-test.mydomain.com`)
- traefik.http.routers.traefik-public-https.entrypoints=https
- traefik.http.routers.traefik-public-https.tls=true
- traefik.http.services.traefik-public.loadbalancer.server.port=8080
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- traefik-public-certificates:/certificates
- /certs:/certs
- /logs:/logs
- /configs/traefik.yml:/traefik.yml
- /configs/tls-cert.yml:/etc/traefik/tls-cert.yml
networks:
- traefik-public
volumes:
traefik-public-certificates:
networks:
traefik-public:
external: true
I also have Portainer deployed with the following stack file:
version: '3.8'
services:
agent:
image: portainer/agent:latest
environment:
AGENT_CLUSTER_ADDR: tasks.agent
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /var/lib/docker/volumes:/var/lib/docker/volumes
networks:
- agent_network
deploy:
mode: global
placement:
constraints: [node.platform.os == linux]
portainer:
image: portainer/portainer-ce:latest
command: -H tcp://tasks.agent:9001 --tlsskipverify
ports:
- 9000:9000
volumes:
- portainer_data:/data
networks:
- agent_network
- traefik-public
deploy:
mode: replicated
replicas: 1
placement:
constraints: [node.role == manager]
labels:
- traefik.enable=true
- traefik.http.routers.portainer.rule=Host(`portainer-test.mydomain.com`)
- traefik.http.services.portainer.loadbalancer.server.port=9000
- traefik.http.routers.portainer.entrypoints=https
- traefik.http.routers.portainer.tls=true
networks:
agent_network:
driver: overlay
attachable: true
traefik-public:
external: true
volumes:
portainer_data:
For some reason, Traefik is skipping my Portainer container.
time="2023-04-08T23:55:17Z" level=debug msg="Filtering disabled container" providerName=docker container=portainer-agent-h8m7kqdzqh8ik4rahjmbc7qw2
time="2023-04-08T23:55:17Z" level=debug msg="Filtering disabled container" providerName=docker container=portainer-agent-rs2l6xaem2l4dztb8kvf4iqrh
time="2023-04-08T23:55:17Z" level=debug msg="Filtering disabled container" container=portainer-agent-ytot9erq29a7zfh2d4o9p7z1b providerName=docker
time="2023-04-08T23:55:17Z" level=debug msg="Filtering disabled container" providerName=docker container=portainer-portainer-bispq34jvxyk8roxv7hndb28b
To double-check that my setup and labels are correct I created this stack and deployed it
version: '3.8'
services:
my-app:
image: containous/whoami:v1.3.0
networks:
- traefik-public
command:
- --port=8082
ports:
- 8082:8082
deploy:
labels:
- traefik.enable=true
- traefik.http.routers.my-app.rule=Host(`whoami.mydomain.com`)
- traefik.http.services.my-app.loadbalancer.server.port=8082
- traefik.http.routers.my-app.entrypoints=https
- traefik.http.routers.my-app.tls=true
networks:
traefik-public:
external: true
And I am able to access it on "whoami.mydomain.com"; however, I am unable to access Portainer on "portainer-test.mydomain.com".
PS: I am able to access Portainer directly using EXTERNAL_IP:9000
Any idea why this might be the case?