1

How does Traefik work in Docker Swarm Mode? From what I'm reading here and here, Traefik will be installed as part of the managers.

If there's 3 managers and each Docker Swarm manager is setup on a different host with different IP, what is the IP address of Traefik that domain DNS records need to point to? Is it the leader of all the managers? If so, if the leader fails and another manager gets appointed leader, then the IP address of Traefik needs to be updated in the domain DNS records?

j7an
  • 104
  • 2
  • 11

1 Answers1

1

The DNS may point to any of the nodes in the swarm and docker mesh will forward the requests to the node that runs the container/service in that moment.

enter image description here

You can read more about docker routing mesh here.

Constantin Galbenu
  • 16,951
  • 3
  • 38
  • 54
  • Make sure docker version is V1.12+ – Light.G Sep 15 '18 at 06:53
  • Thanks for explaining mesh network. But if DNS record points to one IP in the network and the container of that IP fails or stops responding, then other nodes within the network won't be reachable either, right? – j7an Sep 17 '18 at 21:41
  • 1
    @j7an other nodes are reachable if they are alive. If you need HA then add more nodes in your DNS record. A client will try all of them unril it finds a node that's responding. – Constantin Galbenu Sep 17 '18 at 23:29
  • @constantin-galbenu Thanks. Looks like all the options for HA are listed here: [What's the common practice of managing the external IP of a docker swarm?](https://serverfault.com/a/869506) – j7an Sep 18 '18 at 18:00
  • 1
    @j7an there are other solutions, like Linux Virtual Server https://www.slashroot.in/lvs-linux-virtual-server-different-methods-of-load-balancing – Constantin Galbenu Sep 18 '18 at 18:22