Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Service placement on different node makes it unreachable #69

Closed
dorinclisu opened this issue Jan 25, 2021 · 2 comments
Closed

Service placement on different node makes it unreachable #69

dorinclisu opened this issue Jan 25, 2021 · 2 comments

Comments

@dorinclisu
Copy link

I installed the basic traefik stack on 1 node and I was pleased with how it works.
Then I installed a custom application based on this config https://dockerswarm.rocks/thelounge/
All working well, dashboard available at https://traefik.mydomain.com, app available at https://app.mydomain.com

Then I added one more node to the swarm, and the next stack update placed the app container on the worker node. Traefik still runs on master node according to placement constraints, and the dashboard still runs fine and reports no errors.
However, trying to access the app doesn't work and the browser gets a Bad Gateway message (probably from traefik?)

The log line traefik produces for every request to access the app at https://app.mydomain.com

2021-01-25T18:16:07.965245081Z **client-ip** - - [25/Jan/2021:18:16:04 +0000] "GET / HTTP/2.0" 502 11 "-" "-" 419 "app-https@docker" "http://10.0.1.8:8000" 3057ms

Again, I didn't change anything except that I added a worker node and redeployed the stack.

@dorinclisu dorinclisu changed the title Service placement on different node makes it unaccessible Service placement on different node makes it unreachable Jan 25, 2021
@dorinclisu
Copy link
Author

I think the problem was the firewall not allowing the docker mesh network to work properly between the nodes.
https://www.digitalocean.com/community/tutorials/how-to-configure-the-linux-firewall-for-docker-swarm-on-ubuntu-16-04

After opening ports 4789 and 7946 (2377 was already open, otherwise I couldn't join nodes to the swarm), the service works as expected regardless of placement.

@tiangolo
Copy link
Owner

Thanks for reporting back and closing the issue 👍

Sorry for the long delay! 🙈 I wanted to personally address each issue/PR and they piled up through time, but now I'm checking each one in order.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants