Networking and exposing applications with Docker Swarm
We already learned how container runtimes provide network capabilities to our containers by setting network namespaces and virtual interfaces attached to the host’s bridge network interfaces. All these features and processes will also work with Docker Swarm but communication between hosts is also required, and this is where overlay networks come in.
Understanding the Docker Swarm overlay network
To manage all communications cluster-wide, a new network driver, overlay, will be available. The overlay network works by setting UDP VXLAN tunnels between all the cluster’s hosts. These communications can be encrypted with some overhead and Docker Swarm sets the routing layer for all containers. Docker Swarm only takes care of overlay networks while the container runtime will manage all other local scope networks.
Once we have initialized a Docker Swarm cluster, two new networks will appear, docker_gwbridge
(bridge...