No device owns the Service IP A client Pod connects to 10.96.12.34:80, the ClusterIP of Service web. No network interface answers on that address, and no proxy process sits in between. Rules in the kernel of Node A rewrite the destination to one Pod IP.
This lesson is about who writes those rules and what they look like. Name lookup is in the Service DNS lesson; the path after the rewrite is in the packet lesson.
kube-proxy watches and programs, it does not forward kube-proxy runs on every node, usually as a DaemonSet. It watches Services and EndpointSlices through the API server. When an endpoint becomes ready or goes away, it updates the rules on its own node.
Packets never pass through the kube-proxy process. If kube-proxy stops, existing rules keep working, but new Services and endpoint changes are not applied on that node.
Key idea Stale routing on one node only, while others are fine, often means kube-proxy there is down or failing to sync. Check its logs and sync metrics.
iptables mode: a chain per Service, a coin flip per endpoint In the nat table, KUBE-SERVICES has a rule per Service IP and port that jumps to a KUBE-SVC-... chain. That chain has one rule per endpoint, each jumping to a KUBE-SEP-... chain that DNATs to the Pod IP and port.
The choice is random. With three endpoints, the first rule matches with probability 1/3, the second with 1/2 of the rest, and the last always. Each endpoint gets about a third of new connections.
Key idea iptables-save -t nat | grep KUBE-SVC shows the chain for a Service, and each statistic --probability rule in it.
Thousands of Services mean tens of thousands of rules Rules grow with Services times endpoints. Matching walks KUBE-SERVICES in order, and a change rewrites large parts of the table. In clusters with tens of thousands of Services and Pods, each sync gets slow, and endpoint changes reach the kernel late.
kube-proxy batches changes with minSyncPeriod to cope, which trades freshness for less CPU. That limit is why the other modes exist.
Watch out Watch the kube-proxy sync duration metrics. Long syncs mean traffic can still go to Pods that are already gone.
IPVS mode: hash tables, but deprecated IPVS is the kernel load balancer. kube-proxy binds every ClusterIP to a dummy interface, kube-ipvs0, and creates a virtual server per Service with the endpoints as real servers. Lookup is a hash table, and you can pick a scheduler such as rr (the default), lc or sh.
The IPVS API never matched every Service edge case. The mode is deprecated since v1.35; it is planned to be off by default from v1.40 and removed in v1.43.
Watch out Running IPVS today? Plan a move to nftables. ipvsadm -Ln shows the current virtual servers.
nftables mode: maps instead of long chains nftables mode went GA in v1.33 and needs Linux kernel 5.13 or later. kube-proxy keeps its rules in its own table (ip kube-proxy and ip6 kube-proxy). Service IPs sit in a verdict map, so finding the Service is one lookup instead of a walk.
Updates touch only what changed. The default mode is still iptables, and the docs say it will move to nftables in a future release, so set mode explicitly in the kube-proxy config to avoid a surprise on upgrade.
Key idea nft list table ip kube-proxy shows the maps and per-Service chains. iptables-save does not show these rules.
eBPF datapaths replace kube-proxy entirely Some CNIs, for example Cilium with kube-proxy replacement, run no kube-proxy at all. Their agent watches the same Services and EndpointSlices and fills eBPF maps.
For Pod traffic, a hook on the socket picks the backend when the app calls connect(), so the connection is opened to the Pod IP and later packets need no NAT. Traffic from outside to NodePorts is handled by eBPF programs at tc or XDP on the node interface.
Key idea With an eBPF replacement, iptables-save shows almost no KUBE- rules. Ask the CNI instead, for example cilium-dbg service list in the agent Pod.
conntrack remembers the choice, even after the Pod is gone With iptables, IPVS or nftables, only the first packet of a flow goes through the rules. The kernel records the DNAT in conntrack, and later packets follow that entry. That is why one TCP connection stays on one Pod.
When Pod 2 is deleted, its entries can linger. TCP clients see resets or timeouts and must reconnect. For UDP there is no connection to break, so kube-proxy deletes conntrack entries for removed UDP endpoints. Without that cleanup, DNS queries could keep going to a dead CoreDNS Pod.
Watch out conntrack -L -d 10.96.12.34 lists flows to a Service. Long-lived connections do not rebalance when you scale up; clients must reconnect.
externalTrafficPolicy: Local keeps the client IP External traffic arrives at a NodePort or load balancer. With the default policy Cluster, any node may forward it to any endpoint, even on another node, and SNATs it to the node IP on the way. The Pod sees the node address, not the client.
With Local, the node only forwards to endpoints on itself, without SNAT, so the Pod sees the real client IP. A node with no local endpoint drops it. The load balancer avoids such nodes by checking healthCheckNodePort, where kube-proxy answers 200 only if a local endpoint exists.
Key idea Local preserves client IP and saves a hop, but traffic is spread per node, not per Pod. Keep endpoints evenly spread across nodes.
Same Service, different machinery kube-proxy or an eBPF agent watches Services and EndpointSlices and programs each node. iptables walks chains, IPVS uses hash tables and is on its way out, nftables uses maps and is the recommended path, and eBPF can pick the backend at the socket.
conntrack pins each flow to the endpoint chosen first, so endpoint changes need cleanup and clients need to reconnect. Traffic policy decides whether external traffic may hop and lose its source IP.
Summary Debug from the node: find the mode first, then read the rules with the matching tool, then check conntrack for the flow.