Skip to Content
Networking and Kubernetes
book

Networking and Kubernetes

by James Strong, Vallery Lancey
September 2021
Intermediate to advanced content levelIntermediate to advanced
338 pages
8h 57m
English
O'Reilly Media, Inc.
Book available
Content preview from Networking and Kubernetes

Chapter 4. Kubernetes Networking Introduction

Now that we have covered Linux and container networking’s critical components, we are ready to discuss Kubernetes networking in greater detail. In this chapter, we will discuss how pods connect internally and externally to the cluster. We will also cover how the internal components of Kubernetes connect. Higher-level network abstractions around discovery and load balancing, such as services and ingresses, will be covered in the next chapter.

Kubernetes networking looks to solve these four networking issues:

  • Highly coupled container-to-container communications

  • Pod-to-pod communications

  • Pod-to-service communications

  • External-to-service communications

The Docker networking model uses a virtual bridge network by default, which is defined per host and is a private network where containers attach. The container’s IP address is allocated a private IP address, which implies containers running on different machines cannot communicate with each other. Developers will have to map host ports to container ports and then proxy the traffic to reach across nodes with Docker. In this scenario, it is up to the Docker administrators to avoid port clashes between containers; usually, this is the system administrators. The Kubernetes networking handles this differently.

The Kubernetes Networking Model

The Kubernetes networking model natively supports multihost cluster networking. Pods can communicate with each other by default, regardless of ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Kubernetes: Up and Running, 2nd Edition

Kubernetes: Up and Running, 2nd Edition

Brendan Burns, Joe Beda, Kelsey Hightower
GitOps and Kubernetes

GitOps and Kubernetes

Todd Ekenstam, Billy Yuen, Jesse Suen, Alex Matyushentsev

Publisher Resources

ISBN: 9781492081647Errata PageSupplemental Content