In previous chapters, you have learned how to work with the Kubernetes Services to forward the container port internally and externally. Now, it's time to take it a step further to see how it works.
There are four networking models in Kubernetes, and we'll explore the details in the following sections:
- Container-to-container communications
- Pod-to-pod communications
- Pod-to-service communications
- External-to-internal communications
Before we go digging into Kubernetes networking, let's study the networking of Docker to understand the basic concept. Each container will have a network namespace with its own routing table and routing policy. By default, the network bridge docker0
connects the physical network interface and virtual network interfaces of containers, and the virtual network interface is the bidirectional cable for the container network namespace and the host one. As a result, there is a pair of virtual network interfaces for a single container:...