Interview Prep/Networking/Kubernetes, Containers, MTU & Performance Basics

How does kube-proxy implement Services?

AdvancedConceptKubernetes, Containers, MTU & Performance Basics
Answer

kube-proxy watches Services and EndpointSlices and programs the node's datapath: iptables mode (default, rules per service and endpoint, random probability load balancing), IPVS mode (kernel L4 balancer with real algorithms, scales better) or nftables mode (newer). A packet to ClusterIP is DNAT'd to a pod IP before routing.

iptables -t nat -L KUBE-SERVICES -n | head
ipvsadm -Ln

Cilium can replace kube-proxy entirely with eBPF.

All Networking questions Roadmap: Networking for DevOps

More on Kubernetes, Containers, MTU & Performance Basics