How does Pod to Pod communication work in Kubernetes?
How does the traffic reach the pod?
Let's dive into how low-level networking works in Kubernetes.
1/
When you deploy a Pod, the following things happen:
➀ The pod gets its own network namespace
➁ An IP address is assigned
➂ Any containers in the pod share the same networking namespace and can see each other on localhost
2/
A pod must first have access to the node's root namespace to reach other pods
This is achieved using a virtual eth pair connecting the 2 namespaces: pod and root
The bridge allows traffic to flow between virtual pairs and traverse through the common root namespace