New ingress and routing

As previously mentioned, we will not use the default Docker ingress network for routing requests to the running container:

Figure 7.2: The new ingress layer built on top of Træfik, connected to underlying Swarm tasks to form a routing mesh

Yes, we will lose the routing mesh, but we will build our own instead. As shown in the previous figure, we will replace the default routing mesh with a new ingress layer built on top of an L7 load balancer, Træfik. You can choose one from the following list of stable versions:

  • Træfik v1.4.5 (traefik@sha256:9c299d9613)
  • Træfik v1.4.6 (traefik@sha256:89cb51b507)

The advantage of using Træfik is that the newly built ingress layer is better stabilized. Each service is automatically resolved to be a list of IP addresses by Træfik. So you can choose to use either an IPVS-based load balancer offered by Docker Swarm, or the built-in mechanism offered by Træfik itself.

As Træfik works with the L7 layer, we are additionally allowed to match services with the hostname, and forward the request to a certain task of the matched service. Also, with this new implementation, we could flexibly restart or re-configure the ingress layer on-the-fly without touching the running services. This has been a weak point of the Docker's ingress layer for a very long time.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset