Understanding the Kubernetes networking model
The Kubernetes networking model is based on a flat address space. All pods in a cluster can directly see each other. Each pod has its own IP address. There is no need to configure any Network Address Translation (NAT). In addition, containers in the same pod share their pod’s IP address and can communicate with each other through localhost
. This model is pretty opinionated, but once set up, it simplifies life considerably both for developers and administrators. It makes it particularly easy to migrate traditional network applications to Kubernetes. A pod represents a traditional node and each container represents a traditional process.
We will cover the following:
- Intra-pod communication
- Pod-to-service communication
- External access
- Lookup and discovery
- DNS in Kubernetes
Intra-pod communication (container to container)
A running pod is always scheduled on one (physical or virtual...