Overlay networks

We only briefly touched on this in Chapter 4, Scaling the Containers, but in order to get our containers to work with the Swarm service discovery, we had to create this type of network though we didn't really spend much time explaining what it is. In the context of Docker Swarm, containers on one machine cannot reach containers on a different machine as their networks are routed directly to the next hop as they traverse the network and a bridge network prevents each container from reaching its neighbor on the same node. To hook all of the containers together in this multi-host setup seamlessly, you can create an overlay network that spans any Swarm nodes that are part of the cluster. Sadly, this type of network is only available in Docker Swarm clusters, so in general, it has limited portability across the orchestration tooling but you can create one with docker network create -d overlay network_name. Since we have already covered an example of a deployment using this type of a network in Chapter 4, Scaling the Containers, you can look it up there to see it in action.

Caution! Overlay networks do not communicate data securely by default with other nodes, so using the --opt encrypted flag when creating one is highly encouraged where network transport cannot be trusted fully. Using this option will incur some processing cost and will require you to allow port 50 communication within your cluster, but in most cases, it should be worth it turning it on.
..................Content has been hidden....................

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