Jorge Turbica / blog · Blog ← All articles ES · Leer en español
Technologies

Kubernetes will drop kube-proxy's IPVS mode in 1.40: time to move to nftables

SIG Network sets ipvs removal for Kubernetes 1.40. On 1.36+ with kernel 5.13+, switch to nftables; otherwise iptables, with a reboot per node.

Kubernetes now has a date for removing kube-proxy's ipvs mode: it goes away in 1.40. It has been deprecated since 1.35, but until November 16, 2026 there was no timeline. If your nodes route Services through IPVS, you have three minor releases after 1.37 to move to nftables or iptables.

What changes and when

SIG Network announced it on the Kubernetes blog: the ipvs backend is still available, with a deprecation warning, and will be removed in Kubernetes 1.40. The full plan lives in KEP-5495. The official advice is straightforward: on Kubernetes 1.36 or later with kernel 5.13 or newer, use nftables; if either condition fails, use iptables.

Why IPVS never quite worked out

IPVS arrived in 2017 to fix two iptables problems: one rule per service IP (a linear scan on every new connection) and rewriting the whole ruleset on every change, which in large clusters kept kube-proxy pinned at a full CPU. IPVS uses hash tables and incremental updates, so it solved both.

The trouble came later. The kernel IPVS API has no batch operations, so when lots of things change at once it can be slower than iptables. It also can't express everything a Service does, so kube-proxy falls back to iptables and ipset for the rest and inherits their scaling problems. It never handled every Service edge case, and its original authors moved on.

The part I found most interesting is about schedulers. Plenty of teams picked IPVS for algorithms like Maglev (mh) instead of random selection. According to SIG Network, because each node decides without knowing what the others are doing, those schedulers generally do no better than random in kube-proxy. If that was your reason, you lose nothing.

nftables, iptables, or staying on ipvs

nftablesiptablesipvs
StatusGA since 1.33SupportedDeprecated, removed in 1.40
Recommended baselineKubernetes ≥ 1.36, kernel ≥ 5.13Any version—
Connection latencySame as or slightly better than ipvsWorse than ipvs, far better than in 2017Baseline
SwitchingRestart kube-proxyReboot each node—
Future on RHELYesNo: Red Hat plans to drop the iptables APINo, it depends on iptables

The minimum version matters: nftables has been GA since 1.33, but later performance and scaling fixes were not backported before 1.36.

Switching to nftables on a kubeadm cluster

With kubeadm, kube-proxy's configuration lives in the kube-proxy ConfigMap in kube-system, under the config.conf key. Change mode: ipvs to mode: nftables and recreate the pods:

bash
# Change mode: ipvs to mode: nftables in data.config.conf
kubectl edit cm -n kube-system kube-proxy

# Recreate the kube-proxy pods with the new configuration
kubectl delete po -n kube-system -l k8s-app=kube-proxy

If you override options in the ipvs block (scheduler, timeouts and so on), map them to their nftables equivalents; they don't carry over.

If you can't use nftables and go with iptables, the ConfigMap change is the same, but SIG Network recommends rebooting each node rather than just restarting kube-proxy. That turns a config change into a rolling reboot you need to schedule.

The catch

It looks like a one-line change, but it sits on the path of every connection to a Service. I'd do it first on a staging cluster with real traffic, watching connection latency and errors, and then node by node if your tooling lets you configure kube-proxy per node (kubeadm doesn't: it ships kube-proxy as a DaemonSet). What I wouldn't do is wait for 1.40: if the version upgrade and the mode switch land together, a networking failure gets much harder to pin down.

Sources

Jorge Turbica

Software Engineer and SRE. I write about the real challenges I run into in production.

See portfolio ↗