CertGrid CertGrid
Hands-on Lab·Certified Kubernetes Administrator

kube-proxy: iptables and IPVS Modes

Trace one Service from its ClusterIP through three iptables chains to the DNAT rule that rewrites the packet, then switch a cluster to IPVS and read the same routing out of ipvsadm. Two implementations of the same abstraction, both visible.

Services and Networking Guide 53 of 103 Advanced

Chain names contain a hash of the Service identity, so yours will differ. The structure will not.

iptables on the four-node cluster; the IPVS switch is done on the single-node cluster, where a mode change affects nothing else.
Server NameIP AddressOSRolesCPURAMHDD
CKA1001192.168.0.175Ubuntu 26.04 LTSControl Plane Node2 Core4 GB50 GB
CKA1001-NODE01192.168.0.176Ubuntu 26.04 LTSWorker Node2 Core4 GB50 GB
CKA1001-NODE02192.168.0.177Ubuntu 26.04 LTSWorker Node2 Core4 GB50 GB
CKA4001192.168.0.191Ubuntu 26.04 LTSControl Plane Node (single-node cluster)2 Core4 GB50 GB

This guide includes

Use this when a Service works, or fails, and you want to see the actual rule deciding it. This matters because kube-proxy turns every Service into packet-filter rules, and being able to trace one ClusterIP to its DNAT rule ends most Service debugging outright.

Before you start

  1. Which mode is kube-proxy in, and how to tell reliably

  2. Follow one ClusterIP through three chains

  3. Session affinity, visible as a different rule

  4. Switch to IPVS

  5. The same routing, in a table you can actually read

  6. Switch back

Official sources