Kubernetes Networking
Pod networking model
- Each Pod gets its own IP address in the cluster network.
- Pod-to-pod communication is expected to be direct (no port mapping required between pods).
- Implemented by a CNI plugin (how IPs are assigned/routes programmed depends on CNI).
Services
- A Service provides a stable virtual IP/DNS name over a set of pods (endpoints).
- Types: ClusterIP, NodePort, LoadBalancer; plus headless services for direct discovery.
Ingress controllers
- Ingress defines HTTP(S) routing into the cluster (host/path rules).
- An Ingress controller implements it (often L7 proxy) and may handle TLS termination.
CNI plugins concept
- CNI is the interface Kubernetes uses to configure networking for pods.
- CNIs decide: IPAM, routing, encapsulation (VXLAN/Geneve), policies, and integration with cloud networks.
DNS inside Kubernetes
- Cluster DNS resolves service and pod names (e.g.,
svc.namespace.svc.cluster.local).
- Many app “can’t connect” issues are actually DNS misconfig, search path, or stub resolver behavior.