Chapter 3. Multi-Host Networking

As long as you’re using containers on a single host, the techniques introduced in Chapter 2 are sufficient. However, if the capacity of a single host is not enough to handle your workload or you want more resilience, you’ll want to scale out horizontally.

Multi-Host Container Networking 101

When scaling out horizontally you end up with a network of machines, also known as a cluster of machines, or cluster for short. Now, a number of questions arise: How do containers talk to each other on different hosts? How do you control communication between containers, and with the outside world? How do you keep state, such as IP address assignments, consistent in a cluster? What are the integration points with the existing networking infrastructure? What about security policies?

In order to address these questions, we’ll review technologies for multi-host container networking in the remainder of this chapter. Since different use cases and environments have different requirements, I will abstain from providing a recommendation for a particular project or product. You should be aware of the trade-offs and make an informed decision.

Options for Multi-Host Container Networking

In a nutshell, Docker itself offers support for overlay networks (creating a distributed network across hosts on top of the host-specific network) as well as network plug-ins for third-party providers.

There are a number of multi-host container networking options that are often ...

Get Container Networking now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.