Migrate kube-proxy from IPVS or iptables to nftables mode

Changing kube-proxy mode is a networking cutover, not a config tweak. This page covers what changes for NodePorts and Services, how to pin the mode, and how to test before IPVS is disabled by default.

On this page

Why teams are moving kube-proxy to nftables now

A platform team running kube-proxy in iptables or IPVS mode on self-managed clusters has to plan a mode change now, because the default is moving and IPVS is on its way out. The move to nftables is a planned networking change with a short list of known behavior differences, and the effort depends on three things: how many Services each cluster carries, how much traffic depends on NodePorts, and how many clusters run the current mode. It is planning and testing work, not a single flag flip.

The timing is set by the Kubernetes docs. In Kubernetes 1.37 the default kube-proxy mode is still iptables, but a future version will change the default to nftables. The ipvs mode has been deprecated since Kubernetes v1.35 and will be disabled by default from v1.40, after which it only runs if the KubeProxyIPVS feature gate is re-enabled. A cluster that today relies on the implicit default, or on IPVS without a plan, will see its data path change during a routine upgrade unless the mode is pinned explicitly first. Confirm the exact release in which your target version changes the default against the Kubernetes virtual IPs and service proxies reference before you set a date.

Start by inventorying what each cluster actually runs: the kube-proxy mode in its configuration, the Service count by type, and any workloads that reach NodePorts through localhost. Those three facts decide whether the change is a routine rollout or a multi-week project. Pin the mode in the kube-proxy configuration on every cluster before any upgrade, then schedule the switch on a non-production cluster with a Service load that resembles production, and measure rule sync time and connection behavior before and after. Record who owns the change window for each cluster, since a mode change touches every node.

What carries over from iptables or IPVS and what needs a decision

This table compares how Service routing features behave under iptables, IPVS and nftables modes of kube-proxy. Read each row as a question to confirm in your own cluster, not as a guarantee of equivalence. The main takeaway is that localhost NodePort access does not carry over by default and needs an explicit decision before cutover.

Behavioriptables and IPVSnftablesWhat to confirm
ClusterIP routingHandled by kube-proxy rules on every node for in-cluster Service IPsHandled by kube-proxy nftables rules on every nodeTest ClusterIP reachability from pods on each node pool after the mode change
NodePort from remote clientsAccepted on node IPs and forwarded to ready endpointsAccepted on node IPs and forwarded to ready endpointsConfirm from outside the cluster network for every NodePort you publish
NodePort from localhostWorks on the node by default in the iptables modeNot accepted by default; requires the KubeProxyNFTablesLocalhostNodePorts feature gateIdentify host-local callers, such as sidecars or node agents, and decide whether to enable the gate
Session affinityClientIP affinity supported through kube-proxy rulesConfirm ClientIP affinity behavior against the virtual IPs documentation for your versionTest sticky sessions end to end, including timeouts
externalTrafficPolicyLocal policy keeps traffic on the receiving node when endpoints exist thereConfirm Local and Cluster policy behavior and source IP preservation on your versionCheck source IP logging and any allow-lists that depend on it
Topology-aware routingDepends on the Service topology hints and kube-proxy version in useConfirm whether topology hints are honored the same way in nftables modeCompare endpoint distribution across zones before and after the change
kube-proxy metricsMetric names and dashboards tied to the iptables or IPVS sync loopsMetric names and sync behavior may differ; confirm on the nftables metrics endpointUpdate alerts and dashboards that reference mode-specific metrics
Service count scaleIPVS was designed for large Service counts; iptables rule count grows with ServicesConfirm rule update behavior at your Service and endpoint count in a staging clusterLoad test with a Service count close to production before choosing the mode
CNI interactionDepends on whether your CNI replaces or augments kube-proxyDepends on CNI support for nftables rules and any CNI-managed NATConfirm with your CNI vendor's documentation for the chosen kube-proxy mode

How nftables changes localhost NodePort access

In nftables mode, NodePort connections to localhost are not accepted by default, so anything on a node that calls a NodePort on 127.0.0.1 can fail after the switch. The cards below cover how to find those callers, when the documented feature gate applies, and how to check each node group before cutover.

Why localhost NodePorts break

In nftables mode, kube-proxy does not accept NodePort connections that arrive on the loopback address by default. A process on the node that connects to 127.0.0.1 on a NodePort will time out or be refused, even though the same Service works from other hosts. Confirm this behavior against your exact kube-proxy version before planning the cutover, because it is the reason the rest of this section exists.

Virtual IPs docs

Inventory node-local callers

Build a list of everything that calls a NodePort through the node's loopback address. Check node health probes, monitoring agents, sidecar scripts, cron jobs, systemd units and configuration files that reference 127.0.0.1 or localhost with a port in the NodePort range. Search container specs and host configuration alike, since a probe defined in a pod manifest can break the same way as a host script.

The feature gate path

The documented way to restore localhost NodePort access in nftables mode is the KubeProxyNFTablesLocalhostNodePorts feature gate. Check whether the gate is available, its default state and its maturity stage for the Kubernetes version you are targeting, since gate status changes between releases. Record the decision in your change plan, and note that enabling a gate is a configuration change you must maintain across upgrades.

Verify each node group

Test on every node group separately, not only on a sample node. Control plane nodes, general workers, GPU or specialized pools and edge nodes may run different probes or scripts. For each group, confirm that a local call to a NodePort succeeds or fails as expected before and after the mode change, and that health checks report the same state. Keep the test results with the change record.

Replace loopback calls where possible

If the gate is not available or not accepted by your security review, the more durable fix is to change the caller. Point node-local probes at the Pod IP, a ClusterIP, or a host service instead of a NodePort on loopback. This removes the dependency on loopback NodePort handling altogether, and it is worth doing even if the gate works, because it makes the caller's behavior independent of the proxy mode.

Pinning the kube-proxy mode so upgrades do not change it

On a kubeadm-managed cluster, kube-proxy runs as a DaemonSet whose configuration lives in a ConfigMap named kube-proxy in the kube-system namespace. The mode is the mode field in the KubeProxyConfiguration embedded in that ConfigMap. An empty value means kube-proxy uses its built-in default for the running version, so the cluster inherits whatever default the release ships. Pinning the mode means editing that field so the value is written down rather than inferred.

  • Edit the ConfigMap: set mode: "nftables" or mode: "iptables" in the config.conf data of the kube-proxy ConfigMap, and confirm the file parses before rolling the DaemonSet.
  • Keep kubeadm in step: the kubeadm configuration used for later upgrades and node joins should carry the same KubeProxyConfiguration, so a new kube-proxy pod does not pick up a different default.
  • Restart kube-proxy deliberately: after a config change, restart the DaemonSet in a planned window and watch each node's rollout.
  • Record the change: store the ConfigMap in version control with the cluster's other kubeadm settings.

After any kubeadm upgrade, compare the live ConfigMap with your recorded value before you trust the cluster. Confirm the value with your kubeadm version and the kube-proxy documentation for your release.

Sequence for a kube-proxy mode migration with a parallel test

This sequence moves kube-proxy from IPVS or iptables to nftables with evidence at each stage, so the team knows what changed, what was compared and how to return to the prior mode. It ends with the mode pinned in configuration and the old rules removed.

  1. Inventory services, NodePorts and dependencies

    The platform team lists every Service, with a focus on NodePort and LoadBalancer Services, and records which callers reach NodePorts through localhost on a node. They also record the CNI plugin in use and whether it manages or depends on kube-proxy rules, since some CNI plugins interact with the proxy mode. The output is a written inventory with each Service's owner, its traffic path and any localhost caller that would be affected. Confirm the CNI vendor's documented support for nftables before continuing.

  2. Build a pilot pool running nftables

    The team creates a pilot cluster or a dedicated node pool and sets kube-proxy to nftables mode in its configuration, rather than relying on a default. Where a localhost NodePort caller exists, the team decides whether to enable the KubeProxyNFTablesLocalhostNodePorts feature gate or to change that caller, and records the decision with its reason. The pilot is considered ready when kube-proxy reports the expected mode on every pilot node and the feature gate decision is written into the change record.

  3. Run a parallel comparison on representative traffic

    Keep the existing mode running on the production pool while the pilot receives copies or a representative share of real Service traffic. Compare connection success, latency, error rates and NodePort reachability between the two sets of nodes, and include a large Service count in the test so rule programming time and sync behavior are visible. The check is complete when the comparison covers all services in the inventory and every difference has an owner and a disposition. Confirm the test load matches your Service count, since small test clusters will not reveal scaling problems.

  4. Cut over node by node with rollback

    The team changes the proxy mode one node at a time, draining workloads where needed, and watches each node's health and Service reachability before moving to the next. The rollback step is written in advance: it restores the prior mode configuration and restarts kube-proxy on the affected node. The step is done when every node reports nftables mode, all inventory checks pass and no node has needed rollback in the observation window agreed beforehand.

  5. Pin the mode in configuration

    Because the Kubernetes documentation advises setting the mode explicitly, the team writes the nftables mode into the kube-proxy configuration for every node pool and into the infrastructure code that builds them. This prevents a future default change from altering behavior during an upgrade. The check is a configuration review showing the mode is set explicitly in every source of truth, plus a test node built from scratch that starts in nftables mode.

  6. Decommission old rules and monitor

    After the observation period, the team removes leftover IPVS or iptables rules and any IPVS kernel modules or configuration that no longer serve a purpose, and confirms with the CNI vendor that nothing else depends on them. Monitoring is set for kube-proxy sync errors and Service connection failures, and the team keeps the cutover record with the inventory and feature gate decision. The sequence is complete when old rules are gone from every node, alerts are active and the record is filed with the kube-proxy mode in each cluster's documentation.

Testing nftables at large Service counts before cutover

Test nftables mode against a dataset that matches production Service count, endpoint churn and NodePort density before any cutover date is set. In kube-proxy, every Service and endpoint change makes the proxy rewrite rules on each node, so the time to sync and the memory held by the rule set both grow with the object count. A lab with a few dozen Services can show clean behavior while a cluster with thousands of Services, many short-lived endpoints and dense NodePort ranges behaves very differently. Ask the platform team for real counts from the current cluster: Services by type, endpoints per Service, rollout frequency and the number of NodePorts in use, then build the test data to match those numbers rather than a convenient sample.

Run load tests that change the Service layer while traffic is flowing. A useful test creates and deletes Services and scales endpoints at the rate your deployment pipelines actually produce, while a client generator opens connections to ClusterIP, NodePort and LoadBalancer addresses from inside and outside the cluster. Record two measurements side by side: connection success rate from the clients, and the time between an object change in the API and the corresponding rule update on each node. Watch kube-proxy logs and metrics on the nodes with the largest rule sets, because a cluster average can hide a slow node. Repeat the test on the current mode so the comparison uses the same workload.

No supplied figure defines an acceptable connection failure rate or sync latency, so your team must set those thresholds from its own iptables or IPVS baseline and agree them before the test runs. Record the baseline under the same load profile, decide how much regression each measurement may show, and treat any breach as a blocker for the cutover. Confirm the kube-proxy metrics and log fields available in your target version with the Kubernetes virtual IPs and service proxies reference and your own monitoring stack, since the names you alert on must exist in that version.

Questions teams ask before changing kube-proxy mode

How long does a kube-proxy mode change take and what drives the duration?

The duration depends mostly on how many Services, endpoints and node types the cluster has, how much traffic depends on localhost NodePort behavior, and how many change windows the team can use. A small cluster with few Services and no localhost callers moves through testing faster than a large multi-tenant cluster with many node pools and external load balancers. Ask for the schedule to be built from a written inventory of Services, traffic paths and rollback steps, and confirm that the plan covers a staging rehearsal before production. No fixed duration applies to every cluster, so any timeline should be tied to that inventory.

Can our in-house platform team make the kube-proxy change without a partner?

Yes, many teams can, provided they have someone who understands Service routing, node networking and the CNI plugin in use. The work requires reading the current kube-proxy configuration, testing nftables behavior in a non-production cluster, and running a controlled rollout with rollback. Teams that lack hands-on experience with packet filtering, or that run large Service counts and cannot reproduce production traffic in staging, often find an outside review useful. Compare the internal hours needed for inventory, testing and on-call coverage against the written scope of any partner proposal.

What do we need to provide to start the work?

The engagement needs administrative access to the clusters and node configuration, a current list of Services and their types, and traffic data showing which clients reach NodePorts from the node itself. Teams should also name an owner for each workload that calls a NodePort over localhost, schedule change windows with application owners, and agree on who approves the rollback decision. Without those owners, the testing cannot confirm that a changed behavior is acceptable. Confirm these inputs in the written scope before work begins.

Do we have to move off IPVS now?

Not necessarily on the day you read this, but the timing matters. IPVS mode is deprecated in Kubernetes v1.35 and is scheduled to be disabled by default from v1.40, so a cluster that depends on it will need a decision before upgrading to that release. Clusters that stay on IPVS can continue only if the KubeProxyIPVS feature gate is set, which is a decision to review with the team's risk owner. Plan the move against your own upgrade calendar and confirm the current status in the Kubernetes virtual IPs documentation.

Is it safe to keep the KubeProxyNFTablesLocalhostNodePorts feature gate enabled?

Enabling the gate restores the ability for nftables mode to accept NodePort connections on localhost, which some workloads rely on after moving from another mode. The gate is a feature gate, so it should be treated as a deliberate exception that is recorded in configuration, tested and reviewed on each upgrade. Confirm with the maintainers' documentation how the gate behaves in your target release, and check that it does not widen exposure for node-local services you did not intend to reach. Document the owner and the reason for keeping it, and remove it once the callers are fixed.

Should we pin the kube-proxy mode in configuration, and why?

Yes. The Kubernetes documentation advises setting the mode explicitly because the default is iptables in Kubernetes 1.37 and a future version will change it to nftables. An unpinned cluster can change behavior during an upgrade without a deliberate change in your own configuration. Pinning the mode in the kube-proxy configuration makes the choice visible in version control, lets reviewers see it in pull requests, and gives a clear rollback target.

What should a quote for this work contain?

A quote should follow from a written scope and list the phases: discovery of current mode and Services, a localhost NodePort inventory, a staging test plan, the production change plan with rollback, and handover documentation. It should state which environments are covered, how large Service counts are tested, who attends change windows, and what evidence is delivered at the end. Ask whether the price is fixed for the agreed scope, which additional work would be billed separately, and whether post-change support is included or offered as a retainer. Ask for the assumptions behind the quote so you can check them against your environment.

What usually goes wrong during the kube-proxy change

Most kube-proxy mode changes fail at the edges: node health checks, default settings that shift during upgrades, and tooling that still expects the old backend. The cards below cover the risks we see most often and the check that prevents each one.

Localhost NodePort breakage

In nftables mode, kube-proxy does not accept NodePort connections on localhost by default. Any health check, sidecar or local script that calls a NodePort through 127.0.0.1 will fail after the switch even though external traffic still works. Before cutover, search node-local tooling and load balancer health probes for localhost NodePort calls, then decide whether to enable the KubeProxyNFTablesLocalhostNodePorts feature gate or move those checks to node IPs. Test each one on a staging node.

Virtual IPs docs

Upgrades silently changing the mode

Kubernetes 1.37 defaults kube-proxy to iptables, and a future version will change that default to nftables. If the mode is left unset, a routine control plane or node upgrade can switch the data path without a change ticket. Set the mode explicitly in the kube-proxy configuration on every node pool so the chosen backend stays fixed across upgrades, and record the setting in your cluster as-code repository so reviewers see it.

Untested Service counts

Rule programming cost grows with the number of Services and endpoints, so a cluster that runs well with a small Service set can sync slowly once it reaches production scale. Build a test cluster with a Service and endpoint count that matches production, or a synthetic count agreed with your platform team, and measure rule sync time, memory use on each node and time to first successful connection after a Service change. Compare results against the current backend before deciding on rollout pace.

CNI and load balancer assumptions

Some CNI plugins, MetalLB-style load balancers and cloud controllers depend on kube-proxy internals, such as specific iptables chains or IPVS virtual server entries, or on the assumption that NodePort traffic follows a particular path. Ask each vendor whether their component supports nftables mode and which kube-proxy replacement settings they require. Verify external LoadBalancer and NodePort reachability from outside the cluster after the change, not only inside it.

No tested rollback path

A mode change touches every node, so a partial rollout can leave some nodes on nftables and others on the old backend, which makes traffic issues hard to attribute. Before starting, write down the exact steps to return each node pool to the previous mode, the kube-proxy restart behavior and the maintenance window needed. Rehearse the rollback on a non-production cluster and confirm that existing connections and Service VIPs recover as expected.

Dashboards and alerts reading old metrics

Alert rules and dashboards built for iptables or IPVS often query metrics or log messages that change or disappear under nftables. The result is a green dashboard during an outage, or alerts that never fire. Inventory every kube-proxy dashboard, alert rule and runbook, confirm which metrics your kube-proxy version exposes in nftables mode, and replace any panel that depends on backend-specific series before the cutover.

What drives the cost of a kube-proxy mode change

The cost of a kube-proxy mode change depends less on the switch itself than on how many clusters, node pools and Services have to be checked before anyone touches a node. Discovery is the largest one-time component. Someone has to find every cluster still on IPVS or iptables, list which Services use NodePort, which clients call those ports from the node's own loopback address, and which workloads depend on IPVS-specific behavior. That work is done by the people who know the platform, so it is usually billed as engineering time before any configuration changes are proposed.

The other one-time components are a test environment that matches production closely enough to be useful, a parallel run where both proxy modes or both clusters serve traffic for a period, and a per-node cutover with a rollback path. Each node pool multiplies the cutover work, and a large Service count makes the verification pass longer because rule programming and connection behavior must be measured, not assumed. Rollback preparation includes recording the current mode, keeping the previous configuration available and rehearsing the reversal. Staffing for the parallel run and cutover window is usually the largest variable line item, so ask who is on call and for how long.

Recurring cost comes from the checks you repeat on every Kubernetes upgrade. Because the Kubernetes documentation advises setting the mode explicitly so an upgrade does not change it silently, each upgrade needs a check that the pinned mode is still in effect, that the deprecated ipvs mode and its feature gate have not reappeared in your configuration, and that NodePort and localhost behavior still matches your tests. Before you request a quote, ask the provider for a written scope that lists every cluster, node pool, Service count and NodePort consumer in writing, and separates one-time migration work from the recurring upgrade checks. Without those counts, no fixed price can be stated honestly.

Phases of a node-by-node kube-proxy cutover

The cutover starts with an inventory of which kube-proxy mode each cluster uses and which Services depend on localhost NodePorts. A pilot cluster then runs in nftables mode alongside a parallel test cluster that carries a copy of the large Service set. Only when those checks pass does the team move nodes one at a time, with a rollback branch that returns a node to its previous mode if traffic breaks. The mode is pinned explicitly in kube-proxy configuration before the cutover is closed out and the old mode is decommissioned.

Stages and rollback branch for moving kube-proxy to nftables one node at a time.

How DeployOpen scopes and delivers a kube-proxy migration

DeployOpen plans and implements kube-proxy mode changes on self-managed clusters in infrastructure you control. We start from your current mode, your Service inventory and your upgrade plan, then test the nftables change in a non-production cluster before anything moves toward production.

How we scope

  • Inventory the current kube-proxy mode, IPVS or iptables usage, and every upgrade path that could change the default
  • Confirm which NodePort access from localhost, host-network and node-local workloads must keep working after the switch
  • Agree in writing the Service counts, cluster sizes, test environments and rollback conditions covered by a fixed scope
  • Define whether ongoing support, retesting or upgrade work after the change is handled through a retainer

How we build

  • Set the kube-proxy mode explicitly in configuration so upgrades cannot alter it silently
  • Evaluate the KubeProxyNFTablesLocalhostNodePorts feature gate against your localhost NodePort dependencies before enabling it
  • Run load tests against large Service and endpoint counts on a staging cluster that mirrors production topology
  • Record measured rule sync times, connection behavior and failure modes, then agree the go or no-go criteria with your team

How we hand over

  • Deliver the kube-proxy configuration, rollout runbook and node-by-node change sequence as version-controlled files
  • Document the chosen mode, feature gates, known behavior differences and the rollback procedure for each node pool
  • Provide test scripts and results so your platform team can repeat the Service connectivity checks after future upgrades
  • Walk your engineers through the change, verification steps and the monitoring signals that indicate kube-proxy trouble

How we support

  • Review the kube-proxy mode and feature gate settings again before each Kubernetes minor version upgrade
  • Retest Service connectivity and localhost NodePort paths after cluster version or CNI changes that touch proxying
  • Offer retainer support for upgrades, retesting and continuous checks of Service behavior as your cluster grows
  • Confirm with the Kubernetes release notes and your distribution vendor when the default mode or feature gate status changes

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.