Google Kubernetes Pod Networking
A Pod is the smallest Fundamental object with a Kubernetes Cluster & it's a group of containers with shared Network & storage assigned with an Unique IP address to each of them.
All the containers with a single pod shares the same namespace and uses Local Host to interact with each other.
With in the Node this pod uses Route Network namespace which are connected to the primary NIC of the Node in order to send the traffic out of that node.
Below is the clear Networking Setup with in s Node in a GKE native cluster.
More importantly the Node get's the POD'S ip address from the Ip address ranges of the VPC in which the Kubernetes cluster is native.
Addressing done in the Pods :-
- From the Same VPC address range depending on which subnet the Nodes are running depending on that the ip address for that Node will be assigned in to it's Primary NIC.
- An extra 4000 IP address are reserved by Cluster for it's services to be deployed. This IP addresses are carved out from the alias IP address range of the same Native VPC.
- Similarly from the VPC another Alias IP address range is carved out for assigning unique IP address to all the pods with in the cluster.
- But the above range for the pod with /14 is quite a huge and practically not feasible so a /24 range is assigned to each node to distribute IP address for the pods running with in that node.
Pods to Pods Communication :-
- After The alias IP address rages are assigned each Node will assign a unique IP address to each Pod.
- Since all the IP addresses assigned to the pods are known to the VPC address range pool so no NAT is required and traffic from one Pod to another Pod is possible.