kube-proxy iptables vs IPVS vs nftables vs Cilium eBPF: Kubernetes Service Routing Modes Compared

kube-proxy iptables vs IPVS vs nftables vs Cilium eBPF: Kubernetes Service Routing Modes Compared

kube-proxy iptables vs IPVS vs nftables vs Cilium eBPF: Kubernetes Service Routing Modes Compared

Every Kubernetes Service you create is a small lie. The ClusterIP has no host behind it, and some piece of node software has to catch packets addressed to it and redirect them to a real pod. For most of the project’s history that software was kube-proxy writing iptables rules. That era is closing. kube-proxy nftables mode has been GA since Kubernetes 1.33. The IPVS backend was deprecated in 1.35. SIG Network’s November 2026 blog post now schedules IPVS to be switched off by default in 1.40. Meanwhile, many teams have already removed kube-proxy entirely in favour of Cilium’s eBPF replacement. Choosing a mode used to be a performance tweak. In late 2026 it is a migration decision with a deadline. This guide explains how each of the four datapaths actually translates a ClusterIP. It covers what breaks when you switch, and how to pick one by cluster size and constraints.

What this covers: rule data structures, sync behaviour, conntrack, session affinity, source IP, DSR, NodePort and dual-stack differences, debugging commands, a decision matrix, and a step-by-step migration to nftables.

Context and Background

kube-proxy runs on every node. It watches Service and EndpointSlice objects and programs the kernel so that traffic to a Service’s virtual IP lands on one of its endpoints. The official Virtual IPs and Service Proxies reference lists three Linux kube-proxy modes today: iptables, ipvs and nftables. Windows has one, kernelspace. As of Kubernetes 1.37 the default on Linux is still iptables, and the docs warn that “a future version of Kubernetes will change the default to nftables.”

The history explains the current shape. The iptables backend came first and is the reference implementation of Service semantics. IPVS mode arrived around 2017 (kube-proxy support was introduced in v1.8) to fix iptables’ scaling problems. It did fix them, but it never reached full feature parity. It also kept a hidden dependency on iptables and ipset for everything beyond basic load balancing. The nftables backend was introduced as alpha in 1.29, beta in 1.31 and GA in 1.33, under KEP-3866. It was designed from the start to replace both older backends.

Running alongside all three is a fourth option that is not kube-proxy at all. Cilium, and some other eBPF-based CNIs, can implement Services in eBPF programs attached at the socket layer and at the tc and XDP hooks. That lets you skip installing the kube-proxy DaemonSet. If you already run Cilium for networking or policy, our Cilium sidecarless eBPF service mesh deep dive covers the wider datapath. For the upgrade calendar that frames this decision, see the Kubernetes 1.38 preview of tracked enhancements and deprecations. Kubernetes 1.38 is planned for 16 December 2026.

The thesis of this post is simple. Most comparisons still treat IPVS as “the fast mode” and nftables as “the new mode”. In 2026 that framing is wrong. IPVS is the mode with a removal date. nftables is the upstream default-in-waiting. The real choice for most clusters is between kube-proxy nftables and a full eBPF replacement, and it should be driven by features and operational fit, not microbenchmarks.

How kube-proxy nftables, iptables, IPVS and eBPF Translate a ClusterIP

Direct answer: iptables mode matches each packet against one rule per Service, so first-packet lookup cost is O(n). IPVS uses kernel hash tables but still needs iptables helpers. kube-proxy nftables uses a single verdict-map rule with a roughly O(1) lookup and incremental updates. Cilium’s eBPF replacement rewrites the destination at socket connect() time, before a packet even exists.

kube-proxy nftables verdict map compared with iptables chains, IPVS hash table and Cilium eBPF socket-LB for ClusterIP translation

Figure 1: The same ClusterIP connection handled by four datapaths. Only the lookup structure and the point of translation differ.

Figure 1 traces one connection from a client pod to a ClusterIP. In all four modes the endpoint pod receives traffic addressed to its own IP. What differs is where the decision happens and which data structure the kernel walks to make it. The iptables path walks a chain. The IPVS path hashes into a virtual-server table but detours through iptables for marking and masquerade. The nftables path does one map lookup. The eBPF path does a map lookup inside a cgroup socket hook, so the packet never needs DNAT on the wire.

iptables: a linear chain that was never meant for this

In iptables mode, kube-proxy writes a top-level KUBE-SERVICES chain with one rule per Service IP and port. Each rule jumps to a per-Service KUBE-SVC-* chain. That chain picks an endpoint using the statistic match in random mode and jumps to a per-endpoint KUBE-SEP-* chain, which performs DNAT. Session affinity uses the recent match, one set per endpoint. The kube-proxy nftables blog post by Dan Winship states the consequence plainly. The time it takes the kernel to check a packet against all Service rules is O(n) in the number of Services. Best, average and worst case also diverge depending on where a Service sits in the chain.

That cost is paid only on the first packet of a connection. After DNAT, conntrack remembers the translation and later packets skip the chain. So the data-plane penalty is real but bounded. It shows up as connection-setup latency in clusters with many thousands of Services, not as throughput loss. AWS’s EKS best-practices guide uses “over 1,000 services” as the point where it starts recommending nftables for this reason.

IPVS: hash tables with an iptables shadow

IPVS mode assigns every Service IP to a dummy interface called kube-ipvs0. It then creates an IPVS virtual server per Service IP and port, with real servers for each endpoint. IPVS looks up virtual servers in hash tables, which fixed the data-plane scaling issue. It also offered schedulers such as rr, lc, sh and mh (Maglev hashing).

The catch is that the kernel IPVS API cannot express all of Kubernetes Service semantics. kube-proxy’s IPVS backend therefore also uses iptables and ipset for masquerade, NodePort handling, externalTrafficPolicy, and load-balancer source ranges. KEP-3866 has a section titled “The ipvs mode of kube-proxy will not save us” that makes exactly this point. The schedulers are also less useful than they look. The IPVS removal post notes that kube-proxy instances on different nodes do not share scheduler state. Even mh therefore behaves no better than random selection in this architecture. The docs add that, in kube-proxy, mh effectively works as source hashing with ports.

kube-proxy nftables: one rule, one verdict map

The kube-proxy nftables backend expresses the dispatch as a single rule. It builds a tuple from destination IP, L4 protocol and destination port, then looks that tuple up in a verdict map called service-ips. A match jumps straight to the per-Service chain. Endpoint selection uses numgen random mod N with an inline verdict map. Session affinity uses one nftables set per Service, keyed on source IP, destination IP and port, with a timeout. That replaces the iptables approach of one recent set per endpoint.

kube-proxy owns its own private tables, one in the ip family and one in the ip6 family. It therefore does not contend for the global iptables lock with other components. That matters on nodes where a CNI, a firewall daemon and a service mesh all touch netfilter. Updates are transactional: kube-proxy sends only the elements that changed since the last sync.

Cilium eBPF: translate at the socket, not the packet

Cilium’s kube-proxy replacement depends on its socket-LB feature. When an application calls connect() for TCP or connected UDP, or sendmsg()/recvmsg() for UDP, an eBPF program on the cgroup hook checks whether the destination is a Service IP. If it is, the program picks a backend and connects the socket directly to it. The Cilium kube-proxy-free documentation puts it this way: the application assumes it is connected to the Service address, but the kernel socket is “actually connected to the backend address”. No per-packet NAT is needed for east-west traffic.

North-south traffic (NodePort, LoadBalancer, externalIPs) is handled by eBPF programs at tc. Optionally it can be handled at XDP on drivers with native XDP support. Service, backend and affinity state live in BPF maps. The default bpf.lbMapMax is 65,536 entries, and it is tunable for high-scale clusters.

Deeper Analysis: Control Plane, Conntrack, Source IP and NodePort Behaviour

Data-plane lookup cost gets the attention, but the control plane is where clusters actually break. The IPVS removal post makes the case bluntly. Before kube-proxy’s iptables optimisations, very large clusters could see kube-proxy “use 100% of one CPU all the time just to process iptables updates”. The control-plane problem was bad enough that most users could not grow clusters to the size where the data-plane problem became visible.

kube-proxy modes control plane sync path from EndpointSlice watch to iptables-restore, IPVS netlink, nft transaction and BPF map update

Figure 2: How each mode turns an EndpointSlice change into kernel state. The cost of an update differs far more than the cost of a lookup.

Figure 2 shows the sync paths side by side. All four consume the same watch stream. kube-proxy batches changes according to minSyncPeriod (default 1s) and then calls a backend-specific writer. Cilium’s agent updates BPF maps entry by entry.

Sync cost per mode

iptables. The iptables-restore API forces kube-proxy to send a payload that is O(n) in the number of Services on each sync. Since Kubernetes 1.26 (and as the documented behaviour since 1.28), kube-proxy skips rewriting most unchanged rules. That cut the constant factor a lot. It also now assumes the current state is correct and only reads it back if a restore fails, because even reading a large ruleset is slow. The 2026 iptables backend is far better than the 2017 one. It still cannot escape the O(n) payload.

IPVS. IPVS had no batch API, so kube-proxy updates virtual and real servers one netlink call at a time. That is fast for a handful of changes and potentially slower than iptables for a large burst, such as a rolling restart of a big Deployment. ipset updates have the same lack of batching. Because IPVS mode still writes iptables rules, it inherits part of the iptables cost too.

nftables. A kube-proxy nftables transaction is O(n) only in the Services and endpoints that changed since the last sync. One caveat matters for large clusters. AWS’s EKS guide reports that before kube-proxy v1.36.0, clusters with hundreds of thousands of endpoints could see very slow nftables syncs and CPU soft lockups. The cause is the kernel’s loop-checking of generated chains and jumps. Kubernetes 1.36 cut the number of chains and jump/goto rules, and AWS says related kernel improvements landed in Linux 6.18, with backports to some stable kernels in progress. That is why the IPVS removal post recommends nftables specifically on 1.36 or later.

Cilium. BPF map updates are per entry and independent of total map size, so there is no full-ruleset payload. The cost moves elsewhere: to agent memory, to map sizing, and to the need to keep agent and datapath versions in step.

Benchmarks: what has actually been published

The only upstream latency data comes from the KubeCon North America 2024 talk “From Observability to Performance”. It is summarised in the kubernetes.io nftables post. The published charts show three things. At 5,000 and 10,000 Services, nftables p50 first-packet latency is about the same as iptables p01. At 30,000 Services, nftables p99 beats iptables p01 “by a few microseconds”. The 2026 IPVS removal post adds a chart showing nftables is “very slightly” faster than IPVS. The author notes the point is that nftables is not slower, not that it is noticeably faster.

Neither post gives exact microsecond values in its text. I am not reproducing numbers read off a chart. Treat the table below as a qualitative summary of those sources, not a benchmark.

Property iptables IPVS kube-proxy nftables Cilium eBPF KPR
Service lookup structure Linear chain, one rule per Service port Kernel hash table plus iptables/ipset helpers Verdict map, single rule BPF hash maps
First-packet lookup cost O(n) in Services ~O(1) ~O(1) ~O(1), at socket connect for E-W
Update size per sync O(all Services) via iptables-restore Per object, no batching O(changed objects), transactional Per map entry
Endpoint selection Random Schedulers: rr, lc, sh, mh and others Random Random or Maglev (N-S only)
Session affinity Per-endpoint recent sets IPVS persistence Per-Service set with timeout BPF affinity map
Upstream status, Nov 2026 Default; supported Deprecated since 1.35 GA since 1.33; planned default in 1.40 Separate project (Cilium 1.20.x)
Minimum kernel Very old kernels fine Needs IPVS modules 5.13 Cilium recommends 5.10+

Methodology caveat: the complexity classes come from the upstream design documents. Real latency depends on kernel version, CPU, NIC offloads and conntrack state. Measure in your own cluster before claiming a win.

Conntrack and the “Connection reset by peer” workaround

All three kube-proxy modes rely on netfilter conntrack for DNAT state. kube-proxy sizes the table using --conntrack-max-per-core, which defaults to 32,768, with a floor of --conntrack-min 131,072. One migration difference is easy to miss. Linux kernels before 6.1 have a bug that can close long-lived TCP connections to Service IPs with “Connection reset by peer”. iptables mode installs a workaround that drops conntrack-INVALID packets. nftables mode does not install it by default.

The docs tell you to check the iptables_ct_state_invalid_dropped_packets_total metric before you migrate. If it is non-zero, run nftables mode with --conntrack-tcp-be-liberal (or conntrack.tcpBeLiberal: true). Cilium keeps its own BPF connection-tracking tables for the traffic it handles. Its docs recommend BPF-based masquerading over iptables when using BPF NodePort, to avoid SNAT port collisions between the two (Cilium GitHub issue 23604).

Source IP, externalTrafficPolicy and DSR

Kubernetes service load balancing for NodePort traffic showing SNAT with Cluster policy, source IP preservation with Local policy, and Cilium DSR

Figure 3: Three ways a NodePort request reaches a backend, and what happens to the client source IP in each.

Figure 3 is where the modes really diverge for edge and IoT ingress, where client identity often matters. With externalTrafficPolicy: Cluster (the default), the receiving node may forward to a pod on another node. It SNATs the packet so replies return through it, and the backend sees the node IP, not the client IP. With externalTrafficPolicy: Local, traffic goes only to pods on the receiving node. The source IP is preserved, and nodes without a local pod fail the Service’s health-check NodePort so that external load balancers skip them. The iptables, IPVS and nftables modes all implement these semantics, though IPVS has historically had edge-case bugs here.

Cilium adds a third option, direct server return. In DSR mode the backend replies straight to the client using the Service IP and port as its source. That avoids the extra hop and preserves the client IP even under Cluster policy. Cilium encodes the Service address in the SYN packet, using an IPv4 option or IPv6 extension header, or Geneve. That lowers the advertised MTU, which is why “hybrid” mode exists: DSR for TCP, SNAT for UDP. Two documented constraints apply. Clouds that check source and destination addresses, such as AWS, need that check disabled. DSR also does not work well with TCP Fast Open. kube-proxy has no DSR on Linux; the Windows kernelspace mode supports it.

NodePort addresses and the localhost trap

The most common kube-proxy nftables migration surprise is NodePort reachability. In iptables and IPVS mode, nodePortAddresses defaults to all. In kube-proxy nftables mode it defaults to primary, meaning only the node’s primary IPv4 and IPv6 addresses. Loopback NodePorts (127.0.0.1:<nodePort>) work in iptables mode through the route_localnet sysctl. They did not work in nftables mode at all, because nftables has no equivalent of route_localnet.

KEP-6032 fixes this with an opt-in userspace TCP proxy. It is alpha in 1.37 behind the KubeProxyNFTablesLocalhostNodePorts feature gate, targeted for beta in 1.38 and stable in 1.40. You enable it by setting nodePortAddresses to primary,localhost. It is TCP only. The KEP’s motivating user story is air-gapped clusters that run an in-cluster image registry on a localhost NodePort, because containerd and CRI-O allow insecure pulls from localhost.

Before migrating, check iptables_localhost_nodeports_accepted_packets_total. A non-zero value means something depends on this behaviour. Also note that iptables mode adds accept rules for NodePorts to work around aggressive local firewalls. nftables mode does not, so a host firewall must allow the NodePort range explicitly.

Dual stack and IPv6

kube-proxy nftables keeps IPv4 and IPv6 in separate ip and ip6 family tables. KEP-3866 explains that Kubernetes’ dual-stack Service semantics are easiest to implement by treating the families independently. Loopback NodePorts on IPv6 were never available in iptables mode. KEP-6032’s proxy is the first kube-proxy path that serves them, on both families. Cilium supports dual stack in its BPF datapath, and IPv6 BIG TCP requires kernel 5.19 or later according to its system requirements page.

Debugging commands for each mode

Each of the kube-proxy modes, and Cilium, needs different inspection tools, and knowing them is half the operational cost.

# iptables mode: dump the NAT table and find a Service's chain
iptables-save -t nat | grep -E 'KUBE-SERVICES|KUBE-SVC' | head
iptables-save -t nat | grep "default/my-svc"

# IPVS mode: list virtual servers and real servers with counters
ipvsadm -Ln --stats
ip addr show kube-ipvs0        # every ClusterIP is assigned here
ipset list | head

# nftables mode: kube-proxy owns its own tables per family
nft list table ip kube-proxy
nft list map ip kube-proxy service-ips
nft list table ip6 kube-proxy

# Cilium kube-proxy replacement
kubectl -n kube-system exec ds/cilium -- cilium-dbg status --verbose | grep -A12 KubeProxyReplacement
kubectl -n kube-system exec ds/cilium -- cilium-dbg service list
kubectl -n kube-system exec ds/cilium -- cilium-dbg bpf lb list --frontends

# Any kube-proxy mode: confirm which mode is configured
kubectl -n kube-system get configmap kube-proxy -o jsonpath='{.data.config\.conf}' | grep 'mode:'

For kube-proxy, sync_proxy_rules_duration_seconds is the first metric to graph. If its average is well above minSyncPeriod, the backend cannot keep up with churn. Note that iptables-save on a kube-proxy nftables node shows nothing from kube-proxy. Monitoring scripts that grep the iptables NAT table will silently report an empty cluster after migration.

The IPVS Deprecation Timeline and the Road to an nftables Default

The dates come from two KEPs and two kubernetes.io posts, and they are easy to misquote. KEP-5495 deprecates IPVS in stages:

  • 1.35: deprecation notice in the docs, and kube-proxy logs a warning when started in ipvs mode. nftables fixes were backported to 1.34 and 1.33 so older clusters can migrate.
  • 1.37: a KubeProxyIPVS feature gate is added, default true.
  • 1.40: the gate flips to default false. kube-proxy in ipvs mode exits with an error listing the valid modes unless you override the gate.
  • 1.43: the gate is locked and pkg/proxy/ipvs is deleted.
  • 1.46: the feature gate itself is removed.

The 16 November 2026 blog post summarises this as “plan to remove it in Kubernetes 1.40”. In practice that means disabled by default in 1.40, with the code gone in 1.43. The current Virtual IPs reference page states exactly that. KEP-5495 also suggests keeping IPVS-specific flags as warning-only no-ops, so a forgotten ipvs.scheduler line will not break a migrated node.

In parallel, KEP-5343 plans to make nftables the default kube-proxy backend. Its plan has three stages. In 1.37 (alpha), kube-proxy warns when the mode is defaulted rather than set, and kubeadm writes iptables explicitly into new configs. In 1.39 (beta), kubeadm’s validator drops 5.4 and 5.10 kernels. In 1.40 (GA), the default flips to nftables, with an action-required release note.

The kernel argument is what makes this feasible. KEP-5495 notes that all kernels too old for nftables mode “will be out of LTS by the end of 2026”. KEP-5343 lists the distribution baselines: Debian 12 ships 6.1, Ubuntu 22.04 ships 5.15, RHEL 9 nominally ships 5.14, and SLE 15 SP6 and SLE 16 ship 6.x. RHEL 8’s 4.18 kernel probably lacks the backports nftables mode needs.

One more pressure applies. The IPVS removal post points out that Red Hat plans to remove the iptables API from RHEL. That affects both iptables mode and IPVS mode, since IPVS mode depends on iptables too. kube-proxy nftables is the only kube-proxy backend without that exposure.

Decision matrix by cluster size and constraints

Situation Recommended mode Why
Small cluster (<1,000 Services), modern kernel, vanilla CNI kube-proxy nftables, set explicitly Future default; removes iptables lock contention; low risk
Small cluster on old kernel (<5.13) or RHEL 8 iptables nftables mode will not run; IPVS is being removed
Large cluster (thousands of Services, 100k+ endpoints) on K8s ≥1.36 kube-proxy nftables on a recent kernel, or Cilium KPR Incremental sync; check the pre-1.36 soft-lockup issue
Currently on IPVS for schedulers nftables (random) or Cilium Maglev for N-S IPVS schedulers do not coordinate across nodes in kube-proxy
Need client source IP under Cluster policy, or lower N-S latency Cilium KPR with DSR or hybrid kube-proxy has no Linux DSR
Air-gapped edge cluster using localhost NodePort registry iptables today; nftables with KEP-6032 gate (beta 1.38) Loopback NodePorts need the userspace proxy
Managed EKS nftables via add-on config on 1.33+, ideally 1.36+ AWS documents the flow; VPC CNI supports it from v1.23.0
Managed AKS nftables in preview via --kube-proxy-config Microsoft announced preview in November 2025
Already running Cilium for policy and observability Cilium KPR One datapath, one debugging toolset

For a broader look at CNI choice, the Cilium vs Calico industrial Kubernetes networking ADR and the CNI comparison of Calico, Cilium, Flannel and Multus cover the policy and routing side of the trade.

Migration How-To: From IPVS or iptables to kube-proxy nftables

Decision flow for kube-proxy modes migration from IPVS to nftables, iptables or Cilium kube-proxy replacement with the 1.35, 1.40 and 1.43 deprecation milestones

Figure 4: A migration decision tree, anchored to the KEP-5495 timeline.

Figure 4 reduces the choice to three questions: kernel and Kubernetes version, CNI compatibility, and whether you need eBPF-only features. The steps below assume the answer is kube-proxy nftables on a kubeadm-style cluster. Managed platforms expose the same mode field through their own add-on configuration.

  1. Confirm prerequisites. kube-proxy nftables nodes need kernel 5.13 or later. Avoid host nft binaries older than 1.0.0, which early nft bugs make unsafe to mix with kube-proxy. Run Kubernetes 1.36 or later where possible, because some nftables scaling fixes were not backported earlier.
  2. Check your CNI and policy engine. Anything that edits kube-proxy’s iptables chains directly will break. Components that leave kube-proxy’s rules alone generally do not care. AWS documents VPC CNI support from v1.23.0. Some CNIs need masqueradeAll: true.
  3. Read the compatibility metrics. Look at iptables_localhost_nodeports_accepted_packets_total and iptables_ct_state_invalid_dropped_packets_total across all nodes for at least a week.
  4. Update the configuration. Edit the kube-proxy ConfigMap in kube-system. Replace any ipvs: overrides with their nftables: equivalents.
  5. Roll kube-proxy one node pool at a time. On restart in nftables mode, kube-proxy deletes leftover iptables or IPVS rules, so no reboot is needed. Mixed iptables and nftables nodes during the rollout are a supported configuration.
  6. Verify and update tooling. Run nft list table ip kube-proxy, check the sync-duration metric, and fix dashboards or scripts that grep iptables.
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
mode: "nftables"
nodePortAddresses: ["primary"]      # nftables default; use "primary,localhost" only with the KEP-6032 gate
conntrack:
  maxPerCore: 32768
  min: 131072
  tcpBeLiberal: false               # set true if ct_state_invalid metric was non-zero on kernels < 6.1
nftables:
  masqueradeAll: false              # some CNIs require true
  masqueradeBit: 14
  minSyncPeriod: 1s
  syncPeriod: 30s
kubectl -n kube-system edit configmap kube-proxy        # set mode: nftables
kubectl -n kube-system rollout restart daemonset kube-proxy
kubectl -n kube-system rollout status daemonset kube-proxy
# On a node:
nft list map ip kube-proxy service-ips | head

Going the other way, from IPVS to iptables, is mostly the same config change. The upstream post recommends rebooting each node afterwards rather than just restarting kube-proxy. For a Cilium migration, the Cilium docs warn that removing kube-proxy on a live cluster breaks existing Service connections, because the two NAT tables are unaware of each other. Do it on fresh node pools, or accept a maintenance window. Whatever you choose, set mode explicitly now. KEP-5343 exists precisely because clusters that rely on the default will silently change backend at 1.40.

Trade-offs, Gotchas, and What Goes Wrong

nft version skew can crash the tool. KEP-5343 calls nft itself crashing “the biggest remaining stability problem”. It happens notably when nft meets rules created by a much newer nft version than the one in the kube-proxy image. Upstream is building a patched nft (kubernetes #136786). Until that lands, keep host nftables tooling and kube-proxy versions within a reasonable range of each other.

Large-cluster node bootstrap. KEP-5343 also notes that starting a new node in a cluster with many Services and endpoints “used to take a long time” in nftables mode. Later PRs may have fixed this. If you autoscale aggressively in a large cluster, test cold-start sync time before you commit.

Observability gaps. After a move to kube-proxy nftables, tools that parse iptables counters for per-Service traffic will report less, or nothing. Budget time to move dashboards to nft counters, kube-proxy metrics or flow logs.

IPVS-specific habits. Teams that set ipvs.strictARP for MetalLB in L2 mode, or relied on sh scheduling for stickiness, need replacements. Use sessionAffinity: ClientIP (default timeout 10,800 seconds) for stickiness. Check your load-balancer controller’s own docs for ARP requirements under nftables mode.

Cilium is a bigger commitment. The eBPF replacement is not a drop-in mode switch. Socket-LB interacts badly with workloads that need the original ClusterIP inside the pod, such as Istio sidecars, KubeVirt, Kata Containers and gVisor. Those need socketLB.hostNamespaceOnly=true. SCTP support is limited. hostPorts that overlap the NodePort range are ignored. Socket termination for deleted backends needs CONFIG_INET_DIAG, CONFIG_INET_UDP_DIAG and CONFIG_INET_DIAG_DESTROY in the kernel. Maglev uses more memory than random selection, and every agent must share the same hash seed.

Anti-pattern: tuning around the old iptables. If you set a large minSyncPeriod or a syncPeriod of an hour years ago, remove those overrides. The docs say large syncPeriod values are no longer recommended and are “likely to hurt functionality more than it improves performance”.

Practical Recommendations

For most clusters in late 2026, the right default is kube-proxy nftables, set explicitly in configuration, on Kubernetes 1.36 or later and the newest kernel your distribution supports. It is the backend upstream is converging on. It removes the RHEL iptables exposure. It also gives you incremental sync without adopting a new networking stack.

Choose Cilium’s kube-proxy replacement when you need what kube-proxy cannot do: DSR, Maglev for north-south traffic, XDP acceleration, or socket-level load balancing that removes per-packet NAT for east-west traffic. It is also the natural choice when Cilium is already your CNI and policy engine. Stay on iptables only when kernels are too old for nftables. Treat that as a holding position, and make the kernel upgrade the real project.

If you are on IPVS today, do not wait for 1.40 to force the issue. Migrate during your 1.38 or 1.39 upgrade cycle while the deprecation is still just a warning.

Checklist:

  • [ ] Inventory each cluster’s kube-proxy mode, and set it explicitly everywhere.
  • [ ] Confirm node kernels are 5.13 or later (ideally much newer) and host nft is 1.0.0 or later.
  • [ ] Confirm CNI, policy engine and MetalLB-style controllers support nftables mode.
  • [ ] Check the localhost-NodePort and ct-invalid metrics for a week before switching.
  • [ ] Migrate one node pool at a time, and watch sync_proxy_rules_duration_seconds.
  • [ ] Rewrite runbooks and dashboards from iptables-save/ipvsadm to nft or cilium-dbg.
  • [ ] Remove legacy minSyncPeriod/syncPeriod overrides and IPVS-only flags.

Frequently Asked Questions

Is kube-proxy nftables mode production ready?

Yes. The kube-proxy nftables backend has been GA since Kubernetes 1.33, and SIG Network describes it as fully supported and feature-complete. The upstream IPVS removal post still recommends running it on Kubernetes 1.36 or later, because some performance and scaling fixes were not backported earlier. AWS’s EKS guidance says the same, citing slow syncs and CPU soft lockups before kube-proxy v1.36.0 in clusters with hundreds of thousands of endpoints. Nodes need kernel 5.13 or later, and you should avoid host nft binaries older than 1.0.0.

When will IPVS mode be removed from kube-proxy?

Under KEP-5495, IPVS was deprecated in 1.35 and now logs a warning at startup. A KubeProxyIPVS feature gate arrived in 1.37, defaulting to true. In 1.40 the gate defaults to false, so ipvs mode refuses to start unless you re-enable it. In 1.43 the code is deleted, and the gate itself goes in 1.46. The November 2026 kubernetes.io post describes 1.40 as the removal point, because that is when IPVS stops working by default.

Is nftables faster than IPVS in kube-proxy?

Upstream data says only “very slightly”. The 2026 IPVS removal post shows nftables connection-setup latency marginally below IPVS. The author stresses that the point is that nftables is not slower, unlike iptables. The bigger differences are elsewhere. nftables updates are transactional and incremental, while IPVS has no batch API and still leans on iptables and ipset. IPVS schedulers also do not share state across nodes, so they rarely beat random selection in kube-proxy.

Should I use Cilium kube-proxy replacement instead of kube-proxy nftables?

Use the Cilium kube-proxy replacement if you already run Cilium, or need features kube-proxy lacks on Linux. Those include direct server return, Maglev consistent hashing for external traffic, XDP acceleration, and socket-level load balancing for east-west traffic. Choose kube-proxy nftables if you want the upstream default with minimal moving parts, or your CNI is not Cilium. Removing kube-proxy from a running cluster breaks existing Service connections, so plan Cilium adoption on fresh node pools or during a maintenance window.

Why don’t NodePorts work on localhost after switching to nftables?

nftables mode defaults nodePortAddresses to primary, so NodePorts listen only on the node’s primary IPs. iptables mode served loopback NodePorts through the route_localnet sysctl, which has no nftables equivalent. KEP-6032 adds an opt-in userspace TCP proxy. It is alpha in 1.37 behind KubeProxyNFTablesLocalhostNodePorts, targeted for beta in 1.38 and stable in 1.40. Enable the gate and set nodePortAddresses to primary,localhost. Check the iptables_localhost_nodeports_accepted_packets_total metric first to see whether anything depends on it.

Do I need to reboot nodes when changing kube-proxy modes?

Not when moving to nftables. On restart in nftables mode, kube-proxy deletes existing iptables or IPVS rules, and switching back deletes its nftables rules. Restarting the kube-proxy DaemonSet is enough. The upstream IPVS removal post recommends rebooting each node when moving from IPVS to iptables, for technical reasons. Moving from kube-proxy to Cilium’s eBPF replacement is different again. Both NAT tables are unaware of each other, so existing connections break during the handover.

Further Reading

By Riju — about

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *