
요약
Hi, I’m Karin, and I’m on the Cluster squad within SRE at Karrot. Our team designs and runs the Kubernetes platform that every service at Karrot runs on. We take responsibility for everything that keeps our clusters observable and reliable, from monitoring infrastructure all the way to the service mesh and security, along with the policies and roadmaps that keep it all maintainable. In this post, I’ll share how we migrated kube-proxy from iptables mode to nftables mode.
kube-proxy runs on every node in a Kubernetes cluster and programs network rules into the Linux kernel so that traffic sent to a Service reaches the actual Pods. For years, our clusters ran kube-proxy in iptables mode to provide this core feature. Below, I’ll walk through how we moved to nftables, its more efficient successor, and what we learned along the way.
1. kube-proxy latency was hurting service reliability
In Kubernetes, nodes come and go and Pods spin up all the time. That’s just how it works. But when a Pod lands on a fresh node and the app starts up, is it actually ready to talk to other services?
kube-proxy manages the network rules (just “rules” from here on) on each node that let traffic headed for a Service reach the actual Pods. On a new node, if an application starts up while those rules are still being prepared, its DNS lookups and calls to other services can fail.
kube-proxy rule sync lag had been creeping up for a while. We’d been watching the metrics since 2024, and latency was noticeably higher in our production cluster in the Korea region, the largest of all the regions we serve. But we judged it wasn’t serious enough to cause operational problems, and in practice, it never actually turned into an incident.
Then, in the first half of this year, we made a big change: we adopted Karpenter. Now that we could scale out nodes quickly, we stopped using the Overprovisioner that used to keep spare nodes ready for Pods. As a result, Pods were landing on freshly created nodes much more often, which also raised the odds that an application would try to talk to something before rule sync had finished.
Soon after, we started getting reports like the ones below, and most of them boiled down to “my Pod can’t talk to anything.”


Putting our kube-proxy metrics from 2024 and 2026 side by side made it obvious how much heavier kube-proxy’s workload had gotten in just two years. Our service footprint and NAT rule count had grown noticeably, and Pods were being created and terminated far more often. Every time a Pod changes, the Service’s Endpoints (the IPs of the Pods that receive its traffic) change with it, so the number of changes kube-proxy had to apply grew right along with it. Rule sync latency got several times worse, and endpoint changes pending, which tracks Endpoint changes not yet reflected in the rules, went from occasional brief spikes to a steady backlog.




In the first half of 2026, our service cluster had roughly 1,400 Services and 27,000 Pods, with about 80,000 iptables NAT rules. With Endpoints constantly churning from deploys and autoscaling, and nodes repeatedly being torn down and spun up, the initial rule sync on a new node sometimes took as long as 4 minutes and 20 seconds. (That’s over four minutes with no working Service or DNS traffic!)
Once we confirmed this was actually affecting production, we had to fix it. After some intense discussion with the team, we decided to try switching kube-proxy from iptables mode to nftables mode. Here’s how the two modes differ.

In iptables mode, kube-proxy creates rules for every Service and every Endpoint. When a packet comes in, it’s first matched against the Service rules one by one, top to bottom, to find the destination Service, and then against that Service’s Endpoint rules, again one by one, to pick a Pod. Both steps are sequential scans, so the more Services and Endpoints behind them you have, the more rules a packet has to walk through. That makes lookup cost O(N): it grows linearly with the number of Services and Endpoints.
The bigger problem is updating those rules. The total rule count grows with the number of Services and Endpoints, and the more rules there are, the longer each update takes. Since Endpoints change every time a Pod does, updates happen constantly, and changes that hadn’t been applied yet kept piling up. On top of that, right after kube-proxy starts, it does a full sync that rewrites every rule from scratch, and at the scale Karrot’s clusters had grown to, that sometimes took over four minutes.
nftables mode uses maps for both steps: finding the Service and picking an Endpoint. It looks up destination IP . protocol . port in a map to jump straight to the right Service, and it picks an Endpoint directly from that Service's own map, instead of scanning a list. So lookup cost stays close to O(1) no matter how many Services or Endpoints you add. Updates only apply the Services and Endpoints that changed since the last sync, so the cost scales with the amount of change, not the total size. The more Endpoints you have and the more often they change, the bigger the difference.
But before switching modes, we had some questions. What exactly was slowing down rule sync? Was it the sheer number of Services and Endpoints? The frequency of changes? How much would nftables actually help? And could we switch to nftables safely?
To answer these, we set up experiments on a test cluster: vary the conditions, measure latency, and compare iptables against nftables. We figured initial sync needed to come in under 20 seconds to actually solve the problem, and we set out to verify that through experiments.
2. Four goals for the experiment
Before diving in, we nailed down four things we wanted to learn.
1. Find out which conditions slow rule sync down, and by how much
Having lots of Services and Endpoints is a different condition from having Endpoints that change constantly. And deploying the same number of Pods might have a different impact depending on whether you replace them gradually or all at once. We decided to isolate scale, change frequency, and deployment pattern, and measure how each one affects latency.
2. Compare iptables and nftables under identical conditions
nftables has a reputation for better performance, but we wanted to see for ourselves how much it would help in Karrot’s environment. So we generated the same load on a test cluster and compared the two.
3. Confirm it’s safe for production
Getting faster in a test doesn’t mean you flip the switch in prod. We needed to make sure it would play nicely with our add-ons like the VPC CNI and Istio, and check whether any known issues applied to our setup.
4. Decide whether to keep the current kube-proxy version or upgrade alongside
At the time, our EKS clusters were on v1.34, but we had pinned kube-proxy at v1.31 because of an issue (https://github.com/kubernetes/kubernetes/issues/135323) we’d found in v1.34 (more on this in section 6). Since nftables mode was also available in v1.31, we considered two options: switch only the mode, or upgrade to v1.34 and switch at the same time. Performance and known issues can vary by version, so we wanted to weigh the improvement against the operational risk before deciding.
3. First, defining what we’re measuring
Before getting into the experiments, let’s go over what kube-proxy does and what the metrics we tracked actually mean.
When Endpoints change, node rules have to change too
kube-proxy watches Services and EndpointSlices for changes and updates the network rules on each node. That’s what makes a request to a Service address reach an actual destination Pod.
But the moment an Endpoint changes and the moment that change lands in a node’s rules are not the same. It takes time to receive the change and update the rules, and kube-proxy may also batch several changes together.

We split our experiments into two scenarios: applying changes on a node that’s already running, and kube-proxy performing its initial sync on a freshly started node. Since the initial sync is directly tied to the connectivity problems on new nodes, we measured it separately.

The kube-proxy metrics we watched
rule sync latency is how long a single sync run takes. network programming latency is the delay from the recorded time of the triggering change until the rules are applied, so time spent delivering the change and waiting to be processed counts toward it too. The trigger time is taken from the endpoints.kubernetes.io/last-change-trigger-time annotation of an EndpointSlice resource.
addressType: IPv4
apiVersion: discovery.k8s.io/v1
kind: EndpointSlice
endpoints:
- addresses:
- 10.10.10.10
nodeName: ip-10-11-11-11.ap-northeast-2.compute.internal
targetRef:
kind: Pod
name: test-server-7d6969fdd-xf9w2
namespace: test-server
zone: ap-northeast-2a
metadata:
annotations:
endpoints.kubernetes.io/last-change-trigger-time: '2026-03-27T00:00:00Z'
...
Normally the EndpointSlice controller sets it, but if you create EndpointSlices yourself for a selector-less Service, as we did in these experiments, you have to set the annotation yourself.
For example, if a change waits 10 seconds before a sync picks it up and the rules take 2 seconds to apply, it took about 12 seconds for the change to take effect. If you only look at sync duration, you miss those first 10 seconds.

pending is the number of Endpoint changes kube-proxy has received but hasn't yet picked up for a sync.
We measured initial sync time from the elapsed value in each kube-proxy Pod's first SyncProxyRules complete log line. kube-proxy writes this line every time it applies the cluster's Service and Endpoint state to the node's rules, and elapsed records how long that took. When kube-proxy first starts, it has to build every rule from scratch, so the very first log line tells you how long it took to build the entire rule set.
I0301 12:02:44.082722 1 proxier.go:822] “SyncProxyRules complete” ipFamily=”IPv4" elapsed=”1m24.368581138s”
Some metrics couldn’t capture the real maximum
During the experiments, rule sync latency kept topping out at 16.4 seconds. Yet the initial sync logs showed runs taking over a minute, and in one experiment, 5 minutes 33 seconds. A flat 16.4s while syncs were clearly taking much longer seemed off, so we dug in.

The bucket layout of the kube-proxy metric explained it. The largest finite bucket boundary in the classic histogram we were using was 16.384 seconds. Anything longer lands in the +Inf bucket, and when the quantile falls there, histogram_quantile() simply returns 16.384 seconds.
In other words, 16.4 seconds was not the actual maximum. Long syncs were still being recorded; the bucket layout just couldn’t tell them apart. Going deeper would take us off topic, so for the rest of this post, just read “16.4s” as “at least 16.4s, probably more.”
(Reference: kube-proxy metrics docs: https://pkg.go.dev/k8s.io/[email protected]/pkg/proxy/metrics)
So we compared recurring syncs using metrics, and tracked initial sync time, the one that mattered most here, separately through logs.
With our dashboards set up, we ran and observed the experiments many times over, across a bunch of different scenarios 💪🏻
4. What slows rule sync down? (Goal 1)
We started by looking for the conditions that make latency climb in iptables mode. Is it the number of Services and Endpoints? Or a big batch of Endpoints changing at once?
To find out, we wrote a benchmarking tool in Go for load-testing kube-proxy and set it up on a test EKS cluster. Instead of running tens of thousands of real Pods, we created selector-less Services with test EndpointSlices. Adding or swapping IPs in those EndpointSlices makes kube-proxy detect the change and update its rules. This let us generate pure rule-management load with no application traffic involved.
What happens as scale grows? (iptables mode)
The first round varied the number of Services and Endpoints and how they were distributed, for example, putting 5,000 Endpoints behind a single Service versus spreading them across many. With around 16,000 NAT rules, p99 sync latency mostly stayed under a second.
But that didn’t explain what we were seeing in production. So we mixed small and large Services and gradually scaled up.


Once we scaled up, the difference became clear. p99 went from 1.7s at around 29,000 NAT rules to 14.6s at around 79,000. At around 96,000, peak pending also jumped to 600.
Latency that barely registered at small scale showed up once we got close to production scale.
Same number of Endpoints, different latency
Next, we simulated deployments on top of an existing rule set, mimicking a real environment where workloads are constantly being rolled out. We ran new deployments (adding Endpoints incrementally) and rolling updates (replacing existing IPs with new ones) separately. Combining three baseline loads with nine deployment conditions gave us 27 test cases in total.
The factor that stood out most was how many Endpoints were added at once. Holding steady at about 84,000 NAT rules, we added 500 Endpoints in total, n at a time, every 2 seconds.


The total was 500 Endpoints either way. But adding them 250 at a time made sync times balloon and let far more changes pile up.
This showed us that it’s not just overall scale that matters, but also the pattern in which changes arrive. Next, we ran the same load in nftables mode.
5. How much faster does nftables handle the same load? (Goal 2)
To see how the two modes compare, we first switched kube-proxy to nftables mode on v1.34 (up from v1.31) and reran the 27 deployment cases. (Note that this comparison includes both the mode change and the version change. I’ll cover the experiment that keeps the version and only switches the mode later on.)
Adding many Endpoints at once
Let’s start with the condition that showed the biggest gap. We kept the same Service and Endpoint setup that had produced about 84,000 iptables rules, and added 500 Endpoints, 250 at a time.

Sync time dropped dramatically, and far fewer changes piled up. That said, nftables wasn’t faster in every scenario. In the 10-at-a-time case, nftables p99 sync latency hit 15.6s at one point.
So rather than judging on a single deployment pattern, we also measured the thing that mattered most for this project: initial rule sync time.
How much did initial sync time improve?
Here we kept a configuration equivalent to about 83,000 NAT rules and restarted the kube-proxy Pod. Comparing elapsed from the first SyncProxyRules complete log line, iptables took about 66 seconds and nftables about 1.3 seconds.
Since we restarted kube-proxy on an existing node, this doesn’t reproduce the full new-node bootstrapping process. What we compared here is the initial sync kube-proxy performs after it starts.
Overlapping deployments with initial sync
So what happens when deployments are in flight at the same time? Next, we recreated a production-like situation with lots of overlapping changes. While keeping the baseline load, we ran all of the following at once:
- Rolling update of Service A (1,000 Endpoints)
- Rolling update of Service B (500 Endpoints)
- New deployment of Service C (500 Endpoints)
- Restarting kube-proxy on a different node roughly 15, 30, and 60 seconds after the deployments began

The initial sync times tell a clear story.

iptables took over a minute all three times, with the worst run at 5 minutes 33 seconds. nftables came in around 1.3 seconds every time. In this experiment, initial sync wasn’t just faster. It was also far more consistent.
Change propagation latency during the deployments dropped as well.

p99 change propagation latency improved by about 12x, from 84.5s to 6.8s. Beyond the initial sync, nftables was also applying changes that came in during deployments much faster.
A quick note on methodology: early versions of our benchmarking tool set the wrong annotation key for the change timestamp, so network programming latency wasn’t recorded in the earlier runs. We fixed it before this experiment, which is why this is the first place those numbers show up.
That wraps up confirming the benefits. Next, we looked at whether we could get these gains safely in production.
6. Is it safe for production? (Goals 3 and 4)
We’d confirmed the performance gap between iptables and nftables. But before rolling it out to production, we needed to make sure existing traffic paths would keep working and that no new issues would bite us. This was also where we decided whether to bump kube-proxy from v1.31 to v1.34.
Checking compatibility with our existing setup
First, we checked the Service configuration on a dev cluster that mirrors production. We paid special attention to ingress-nginx and the Istio ingress gateway, where inbound traffic first reaches our cluster. Both Services use NodePort with externalTrafficPolicy: Local, and requests come in through an NLB to the node's primary IP and NodePort.
We checked this path because NodePort behaves a bit differently in nftables mode. By default, nftables mode only handles NodePort requests that arrive on the node’s primary IP, and it doesn’t support access via localhost. Both Services receive traffic from the NLB on the node's primary IP, so they weren't affected.
We didn’t find any compatibility concerns with the other components either.

But a conntrack issue shaped our version choice
There were conditions our benchmarks couldn’t reproduce. The big one was conntrack, the kernel’s connection tracking. Our test environment had about 4,000 entries, while production had about 166,000. Even with comparable Endpoint counts, the actual connection state differed by roughly 40x.
So separately from the experiments, we reviewed known issues, and that’s where we found a critical one.
https://github.com/kubernetes/kubernetes/issues/135323
The biggest factor in our version decision was a conntrack cleanup performance regression introduced after v1.32. With lots of UDP connections piled up, cleanup could take a long time whenever Endpoints changed. And if cleanup drags on, subsequent rule updates can get delayed too. The fix landed in v1.36, but kube-proxy can’t run a newer version than the control plane, so it wasn’t an option on our EKS v1.34 clusters.
The public issue confirmed the impact in both iptables and nftables modes, so switching to nftables alone wouldn’t fix it. And since our test environment’s conntrack table was small, we couldn’t judge the production risk from benchmark results alone.
So we had one more question to answer: would keeping v1.31 and switching only the mode be good enough?
v1.31 or v1.34?
In kube-proxy v1.31, nftables mode was still in beta, so we needed to validate its performance and stability.
We reused the high-load scenario from earlier and ran it multiple times on each setup: v1.31 iptables, v1.31 nftables, and v1.34 nftables.

v1.34 nftables was faster on initial sync. But even on v1.31, a sync that used to take over 100 seconds dropped to about 5 seconds. Peak pending and peak CPU came down too.
p99 programming latency varied quite a bit, anywhere from 5.7s to 15.9s. We didn’t try to rank the two nftables versions based on this alone. What we wanted to know was whether v1.31 could deliver a meaningful improvement on its own, and we had the evidence for that.
Based on these results, I decided to stay on v1.31 and switch to nftables mode. It let us sidestep the conntrack regression, and even in beta, it delivered more than enough performance.

Preparing for the switch and day-2 operations
The rollout procedure was simple: update the kube-proxy config to nftables mode and restart the kube-proxy DaemonSet. We also prepared a rollback plan: switch the mode back to iptables and restart again. Flipping the setting is easy, but each node still has to clean up the old rules and set up the new ones, so we reviewed the traffic impact during that window too.
The CLI commands engineers relied on changed as well. So we wrote a separate runbook showing how to do the familiar iptables-save | grep KUBE-, iptables -nvL, and TRACE workflows in nftables, complete with real output from our nodes, and walked the team through it in a session.
The goal was to make sure we could still find Service rules, check destination Endpoints, and trace packet paths after the switch.
7. Adding observability and rolling out in stages
To know whether the switch actually worked, we needed a direct view of the problem we were trying to fix. The key question was how long kube-proxy spends on its initial rule sync on a new node. Our existing metrics couldn’t isolate the initial sync, so we turned the value we’d been pulling from logs into a metric.
The setup is simple. A CronJob runs every minute and looks up kube-proxy Pods created within the last 120 seconds. It extracts elapsed from the first SyncProxyRules complete line in each Pod's logs and records it as a metric called kubeproxy_first_sync_seconds.
Now we can track initial sync time per node without digging through logs. We started collecting it before the switch, so we could compare iptables and nftables on the same metric.
We also widened the rollout gradually. After confirming no issues in our alpha environment, we went region by region, from lower-traffic regions to higher-traffic ones. Our production cluster in the Korea region, the most critical of them all, was switched over during an early-morning maintenance window.

The plan covered more than just the mode switch. After switching, we restarted large Deployments to make sure traffic stayed healthy under heavy Endpoint churn, just like a real deploy, and then watched the metrics for about an hour. In the end, the migration went smoothly with no major issues.
8. And the results are in!
After rolling out to our production cluster in the Korea region, the first thing we checked was initial sync time on new nodes. What used to take 70–90 seconds at peak hours dropped to around 4–5 seconds.

We saw changes on the application side too. Previously, Istio was logging tens of thousands of ca request failed errors every day while requesting certificates. From the day of the switch, that count dropped to zero.
istio-proxy requests certificates through the istiod Service’s ClusterIP, and that request has to go through the node’s kube-proxy rules to reach an istiod Pod. Requests sent before the initial sync finished on a new node were failing, and once sync time came down, those failures disappeared too.

We also checked whether day-to-day changes were being handled more smoothly, comparing dashboards for the same window (8 AM to 6 PM) on the day before and the day of the switch. Network programming volume was about the same, but latency spikes became much less frequent. Peak endpoint changes pending also dropped from about 60,000 to 14,000.
Resource usage didn’t match our experiments, though. In production, kube-proxy CPU usage roughly doubled and memory went up about 20%. But overall usage was still low, so we didn’t consider it a problem.



In the end, we safely solved the problem we set out to fix: Pod connectivity failures caused by slow kube-proxy rule sync on new nodes.
9. Wrapping up
This project started with a problem we didn’t think was urgent, until cluster growth and changes in how we run nodes turned it into a real reliability issue. From deciding on the fix through benchmarking, adding observability, and finishing the rollout, it took about a month.
Since we were changing how node networking works, the fear of “what if this breaks connectivity?” kept us running more experiments, which stretched things out. But thanks to a shared belief on the team that, as SREs, you can never be too thorough with safety checks, we were able to move carefully, one step at a time.
Personally, this was a really rewarding and fun adventure. I uncovered metric pitfalls I never knew existed and got a much deeper understanding of how kube-proxy works. Watching the metrics shift as we added new experiment scenarios was a fun little bonus, too.
The mode switch went smoothly, with none of the issues we’d worried about. If you run kube-proxy and have been thinking about making it faster, I hope this post helps.
Thanks for reading!
Why Can’t My Running Pods Be Reached? Our Journey to kube-proxy nftables Mode was originally published in 당근 기술 블로그 on Medium, where people are continuing the conversation by highlighting and responding to this story.