traefik + ssl everywhere + swarm mode + docker-compose.yml
jagbarcelo opened this issue · 0 comments
I've been following your step-by-step instructions on how to install traefik + portainer through Put Wildcard Certificates and SSL on EVERYTHING and also your related video https://www.youtube.com/watch?v=liV3c9m_OX8
Everything went fine but now I'm struggling to make it work after having created a Swarm with 3 Raspberry Pi's: I want traefik to work as proxy for containers running on any node of the swarm/cluster.
According to Traefik documentation, for it to work in a Swarm, it must be deployed on a master node (no problem since my 3 nodes are managers). Thus, I included this in the docker-compose.yml:
deploy:
#mode: global #Should it be installed on every manager node or will it suffice with just one?
placement:
constraints:
- node.role == manager
I've also created a new overlay network (instead of the regular bridge mode network you used, called proxy) and modify the docker-compose accordingly.
Besides, it seems that the labels must be nested one level deeper, under the deploy
tag, thus:
[...]
deploy:
placement:
constraints:
- node.role == manager
labels:
- traefik.enable=true
- traefik.docker.network=proxy-overlay
[more labels here]
networks:
proxy-overlay:
external: true
I've also modified the data/traefiik.yml
file to include:
providers:
docker:
swarmMode: true
endpoint: "unix:///var/run/docker.sock"
watch: true
exposedByDefault: false
I'm using your file as template, tried every possible combination but I still cannot make it work:
Everytime, every possible change that has come to my mind leads me to a 404 File not found error page when the docker-compose file is deployed.
Can you shed some light on what changes would be needed in your template to make it work on a swarm mode cluster?
Thank you.