BretFisher / dogvscat

Sample Docker Swarm cluster stack of tools
http://dogvs.cat
MIT License
504 stars 127 forks source link

Adjust ports to use ingress mode to allow cluster-wide access #25

Closed mikesir87 closed 4 years ago

mikesir87 commented 4 years ago

I just finished working with someone who was struggling getting their app running in their cluster, basing their compose files on what you have here. It worked when it worked on the manager, but they moved the containers to a worker node and it stopped working. Realized it was because the ports were binding using host mode, not on the ingress network.

This fixes that 😄

BretFisher commented 4 years ago

Hey, thanks for the PR but host driver is on purpose, and should work fine, assuming the traefik global service is running on the nodes that your traffic is going to. I recommend host for multiple reasons:

  1. Improved performance by avoiding the hop and NAT (I haven't tested but hear 10% better or more on high traffic).
  2. Traefik will see the real client IP
mikesir87 commented 4 years ago

Gotcha and that makes a lot of sense. I'll go ahead and close this then.

Might be helpful to have somewhere (I'm not sure where) a notice that all requests should go to worker nodes since they are running Traefik. In my particular use case, the individual was still requests to the managers.