Network Design Principles
Last updated
Last updated
Source:
The Node Network consists of Kubernetes worker nodes and control plane nodes. All nodes can communicate with each other.
Every node in the Kubernetes cluster should be able to communicate with every other node without NAT (Network Address Translation).
Kubernetes assumes a flat network where all nodes can talk freely.
Nodes usually have a routable IP address within the cluster.
To see Nodes IP we can use command kubectl get nodes -o wide
.
The Pod Network is where all Kubernetes pods communicate. Pods within the cluster communicate using direct IP routing.
Every pod gets a unique IP Address.
Every pod in a Kubernetes cluster gets a unique IP address.
Pod-to-pod communication happens directly without NAT.
The Container Network Interface (CNI) plugin is responsible for managing pod networking.
Container inside the same pod communicate by localhost
.
We can test pod to pod communication by ping
from a pod to other pod.
The Service Network is a virtual network used for Kubernetes Services. Services get a stable ClusterIP that does not change. Kubernetes load-balances traffic across backend pods.
Kubernetes rewrites outbound traffic from a pod if it's destined for a Service.This ensures that the request is routed correctly to a backend pod.
Services use ClusterIP (virtual IP) to route traffic to pods.
kube-proxy manages service traffic using iptables or IPVS.
Get service endpoints: