What Is kube-proxy in Kubernetes?

What Is kube-proxy in Kubernetes?

Meet the small program on every Kubernetes machine that turns a stable service name into real, healthy pods, explained from zero with everyday analogies, diagrams and real-world examples.

Imagine a big office building with hundreds of employees. Visitors do not know who sits where, and employees change desks every week. Yet every visitor can walk in, say “I need the billing team,” and a receptionist instantly points them to a free, working person. The visitor never memorises desks, and the company never worries about people moving around.

In Kubernetes, kube-proxy is that receptionist, and it is placed at every entrance of the building, meaning on every machine in the cluster. Programs in Kubernetes keep moving, dying and being replaced, and their addresses keep changing. kube-proxy makes sure that a stable service address always leads to a working destination.

This guide assumes you know nothing about the topic. Each new word is explained the first time it appears, and every big idea comes with an analogy from normal life. By the end you will know what kube-proxy is, why it exists, how it works inside, what its different modes mean, and where it fits among the other parts of Kubernetes.

1The Problem: Pods Keep Changing Addresses

To understand kube-proxy, first understand the headache it cures.

A quick refresher on pods

Kubernetes is a system that runs your applications across many computers. A node is one of those computers. A pod is the smallest unit Kubernetes manages, a small wrapper around one or more containers, and each pod receives its own network address, called an IP address.

Pods are disposable by design. If a pod crashes, is updated, or its node fails, Kubernetes does not repair it. It creates a fresh replacement, and the replacement gets a brand new address.

Why this breaks simple connections

Suppose your website needs to call a payment program. The payment program runs as three pods, so there are three addresses. If your website wrote those addresses down, they would go out of date within hours, maybe minutes. Every deployment, every crash and every scaling event would make the notes wrong.

There is a second problem. With three copies running, who decides which copy receives each request? Somebody must spread the work fairly and avoid sending visitors to a pod that is broken or still starting.

Simple Analogy

Think of a taxi company. Customers do not memorise the mobile numbers of individual drivers, because drivers change shifts and cars break down. Customers call one company number, and the dispatcher connects them with an available driver. Kubernetes needs the same idea for pods.

Kubernetes gives a two-part answer

The first part is the Service: a steady name and a steady virtual address placed in front of a group of pods. The second part is the machinery that makes that steady address actually work on every machine. That machinery is kube-proxy.

!
Common Misconception

A Service is not a running program. It is a description, a record saying “this name maps to pods with this label.” Something else must turn that record into real network behaviour, and that job belongs to kube-proxy.

Changing
pod addresses, every replacement
Stable
service address, for its lifetime
Every node
where kube-proxy runs

2So, What Exactly Is kube-proxy?

kube-proxy is a network agent that runs on each node and keeps that node’s traffic rules in sync with Kubernetes Services.

Let us unpack the sentence. An agent is a small helper program that does a job on behalf of a bigger system. Traffic rules are instructions stored inside the machine’s operating system that say “packets going to this address should be redirected to that address.” In sync means the rules always match the current list of Services and healthy pods.

So kube-proxy does not carry your data itself in the common modes. Instead, it writes a set of rules into the Linux kernel, the core of the operating system, and the kernel does the fast work of redirecting packets. It is more like a traffic planner who paints the road signs than a police officer who stands in the road directing every car.

Simple Analogy

Consider a city road department. When a road is closed or a new bridge opens, the department updates the signposts everywhere. Drivers then follow the signs without asking anyone. kube-proxy updates the signposts on every node, and the kernel’s networking code is the driver who follows them.

The three things kube-proxy always does

Job 1

Watches

Keeps an eye on the Kubernetes control plane for any change to Services and to the list of pods behind them.

Job 2

Translates

Converts each Service into a set of network rules describing which real pod addresses can receive its traffic.

Job 3

Programs

Installs and updates those rules inside the node’s operating system, and removes old ones that are no longer valid.

“kube-proxy does not move your traffic. It teaches every machine where your traffic should go.”

Why it is called a proxy

A proxy is a middleman that stands between a caller and the real destination. In the earliest versions of Kubernetes, kube-proxy really did sit in the middle, receiving each connection and forwarding it by itself. Later designs moved the forwarding into the kernel for speed, but the original name stuck. Today the name is slightly misleading, because in the modern modes kube-proxy mostly programs rules rather than proxying traffic.

3What kube-proxy Is Not

Half of the confusion about kube-proxy comes from mixing it up with its neighbours.

Kubernetes networking involves many cooperating parts, and beginners often blame or credit the wrong one. Here is a clear map of who does what.

ComponentMain JobWorks AtIs It kube-proxy?
kube-proxyMakes Service addresses lead to healthy podsEach node, in the operating systemYes, this is it
CNI network pluginGives pods addresses and connects pods across nodesEach node, pod networkingNo
CoreDNSTurns service names into service addressesInside the cluster, as podsNo
Ingress or GatewayRoutes web requests by address and pathApplication layer, HTTPNo
kubeletStarts and watches pods on its nodeEach node, pod lifecycleNo
Load balancer from cloudBrings outside traffic to the clusterOutside the clusterNo
!
Common Mistake

If two pods cannot reach each other by pod address, kube-proxy is usually not the cause. That path belongs to the CNI plugin. kube-proxy only matters when traffic is aimed at a Service address.

The relay race view

Think of a request as a baton in a relay race. CoreDNS runs the first leg by converting a name into a Service address. kube-proxy runs the second leg, using node rules to swap that Service address for a real pod address. The CNI plugin runs the final leg, carrying the packet across the network to that pod. Each runner is essential, and none replaces the others.

flowchart LR
  A[App asks for name payments] --> B[CoreDNS returns Service address]
  B --> C[Packet leaves the pod]
  C --> D[kube-proxy rules swap Service address for pod address]
  D --> E[CNI plugin carries packet to the target pod]
  E --> F[Payment pod answers]
        
FIG 1 — Who handles which leg of a service call
i
Good to Know

kube-proxy does not understand web addresses, paths or cookies. It works at the level of network connections, not web pages. Anything smarter, such as routing by URL, belongs to an Ingress or Gateway.

4Where kube-proxy Lives in the Cluster

A cluster has two halves: a control plane that decides and worker nodes that work. kube-proxy sits with the workers.

The control plane is the brain of the cluster. It includes the API server, the front desk that every request passes through, and etcd, the reliable database that remembers the state of everything. The worker nodes are the machines that run your pods.

kube-proxy runs on every node. In most clusters it is deployed as a DaemonSet, a Kubernetes object that places exactly one copy of a pod on each node and automatically adds one to any new node. In some setups it runs directly as a system service instead. Either way, the goal is identical: one kube-proxy per machine.

flowchart TB
  subgraph CP[Control Plane]
    API[API Server]
    ETCD[(etcd)]
  end
  subgraph N1[Worker Node 1]
    KP1[kube-proxy]
    RULES1[Kernel network rules]
    PODA[Pods]
  end
  subgraph N2[Worker Node 2]
    KP2[kube-proxy]
    RULES2[Kernel network rules]
    PODB[Pods]
  end
  API  ETCD
  API -->|Service and endpoint updates| KP1
  API -->|Service and endpoint updates| KP2
  KP1 --> RULES1
  KP2 --> RULES2
        
FIG 2 — One kube-proxy per node, each writing its own local rules
Simple Analogy

Think of a national chain of shops with a head office. The head office announces a new price list. Each shop has its own clerk who updates the labels on that shop’s shelves. Customers in any shop see the correct prices without phoning head office. kube-proxy is the clerk in each shop.

Why every node needs its own copy

A pod on any node may call any Service at any moment. The redirect must happen on the very node where the call starts, because that is the first place the packet appears. So every node must know about every Service. That is why kube-proxy is distributed rather than centralised, and why a problem in one node’s kube-proxy usually affects only the pods on that node.

i
Managed Clusters

On managed services such as Amazon EKS, kube-proxy is commonly installed as a cluster add-on that you keep updated. Some platforms, such as Google’s Dataplane V2, skip it entirely and use a different technology. We meet that idea in a later chapter.

5The Vocabulary You Need First

Eight simple terms make the rest of the story easy to follow.

Term 1

Service

A Kubernetes object that gives a group of pods one stable name and one stable virtual address.

Term 2

ClusterIP

The virtual address given to a Service. It is reachable only from inside the cluster and does not belong to any real network card.

Term 3

Selector and label

A label is a small tag on a pod. A Service uses a selector to pick every pod carrying a matching tag.

Term 4

Endpoint

The real address and port of one pod that stands behind a Service and can accept traffic.

Term 5

EndpointSlice

A compact record that lists a batch of endpoints for a Service. Large Services get several slices to keep updates small.

Term 6

NAT

Network Address Translation: rewriting the destination or source address of a packet while it travels.

Term 7

Kernel

The core of the operating system. It handles memory, files and networking, and does so far faster than ordinary programs.

Term 8

Conntrack

The kernel’s memory of active connections, so that replies follow the same path as the original request.

The virtual address mystery

A ClusterIP is a strange thing. No machine has it, no network card answers for it, and you cannot find it by looking at any pod. It exists only as a promise written into rules. When a packet is addressed to it, the rules on the sending node rewrite the destination to a real pod before the packet goes anywhere. If the rules were missing, the packet would simply wander off and be dropped.

Simple Analogy

A ClusterIP is like a company’s toll-free number. No phone is physically attached to that number. The phone system quietly forwards each call to whichever real desk phone is free. kube-proxy is the person who keeps the phone system’s forwarding list up to date.

Why EndpointSlices matter

Older Kubernetes stored all endpoints of a Service in one big record. With thousands of pods, every small change forced the whole giant record to be sent to every node. EndpointSlices split the list into small chunks, so a change to one pod triggers only a tiny update. kube-proxy watches these slices, and this is one reason modern clusters scale so much better.

6How kube-proxy Works Inside

Watch, translate, program, and repeat forever. That is the entire heartbeat.

kube-proxy follows the same idea that drives all of Kubernetes: desired state versus actual state. The desired state says “Service payments should reach these three healthy pods.” The actual state is whatever rules currently exist on the node. kube-proxy keeps comparing the two and fixes any gap, again and again.

sequenceDiagram
  participant U as You
  participant A as API Server
  participant K as kube-proxy on Node
  participant N as Node Kernel
  U->>A: Create Service and pods
  A-->>K: Notify of new Service
  A-->>K: Notify of endpoint list
  K->>K: Build rules from Services and endpoints
  K->>N: Install or update rules
  Note over K,N: A pod later crashes
  A-->>K: Endpoint list changed
  K->>N: Remove dead pod from rules
        
FIG 3 — kube-proxy reacting to changes announced by the API server
1

Connect and watch

On startup, kube-proxy connects to the API server and asks to be told about every Service and EndpointSlice, now and in the future.

2

Build a picture

It keeps a local, in-memory picture of all Services and their ready endpoints. Only endpoints that report ready are counted.

3

Translate into rules

From that picture, it works out the exact set of rules the node should have, using the chosen mode such as iptables, IPVS or nftables.

4

Apply the rules

It writes the rules into the kernel. Changes are grouped together and applied in a batch, not one at a time, to stay efficient.

5

Repeat and repair

Whenever something changes, and also on a regular refresh schedule, it repeats the process, restoring any rule that was lost or altered.

i
Key Insight

Because the kernel holds the rules, already-established traffic keeps flowing even if kube-proxy itself restarts for a moment. What pauses is the updating of rules, not the forwarding of packets that the current rules already cover.

Why only ready endpoints are used

A pod that has just started may not be ready to serve. Kubernetes uses a readiness check to tell whether a pod can take visitors. kube-proxy includes only ready pods in its rules, so a pod that is still warming up, or one that is unhealthy, receives no traffic until it recovers.

7The Journey of a Single Request

Let us follow one message from a website pod to a payment pod, step by step.

1

The website asks for the service by name

The website pod wants to reach “payments”. It asks the cluster’s internal phone book, CoreDNS, which answers with the Service’s virtual ClusterIP address.

2

The packet leaves the pod

The website pod sends its request to the ClusterIP. At this moment the packet is aimed at an address no machine really owns.

3

Node rules catch the packet

Before the packet is sent onto the network, the kernel checks its rules. The rules written by kube-proxy match the Service address and port.

4

A healthy pod is chosen

The rules pick one of the ready payment pods, spreading choices across all of them so that no single pod carries all the load.

5

The destination is rewritten

The kernel replaces the virtual Service address with the chosen pod’s real address. This rewrite is the DNAT step, short for destination network address translation.

6

The packet travels and the reply returns

The pod network delivers the packet. The kernel remembers the translation through conntrack, so the reply is translated back and the website pod believes it spoke to the Service all along.

flowchart LR
  W[Website pod] -->|to Service address| R[Node kernel rules]
  R -->|rewrite to pod A| PA[Payment pod A]
  R -.->|other calls| PB[Payment pod B]
  R -.->|other calls| PC[Payment pod C]
  PA -->|reply| R
  R -->|reply appears from Service| W
        
FIG 4 — One request being redirected and answered
Simple Analogy

Imagine posting a letter to “Customer Care, Main Street”. The local sorting office has a card that says which real branch is open today, and it relabels your envelope with that branch’s exact address. When the branch replies, the reply is stamped so it appears to come from Customer Care. You never learn the branch address.

!
Important Detail

The choice of pod happens when a connection starts. Once a connection is established, all its packets keep going to the same pod. Load spreading therefore works per connection, not per message inside a long-lived connection.

8Service Types and What kube-proxy Does for Each

Different Service types open different doors, and kube-proxy builds the rules behind each door.

ClusterIP: the inside-only door

The default type. kube-proxy writes rules on every node so that any pod can reach the Service’s virtual address. It is ideal for internal parts such as databases and payment programs that only other pods should call.

NodePort: a door on every machine

Kubernetes picks a high port number, by default in the range 30000 to 32767, and kube-proxy opens it on every node. Anyone who can reach any node on that port is redirected to a pod of the Service, even if that pod lives on a different node.

LoadBalancer: a public door built on top

On a cloud, Kubernetes asks the provider for a real external load balancer. That balancer sends traffic to the nodes’ NodePorts, and kube-proxy takes it from there to the pods. So a LoadBalancer Service quietly includes a NodePort and a ClusterIP.

ExternalIPs: manually attached addresses

An administrator can attach an outside address to a Service. kube-proxy then treats traffic to that address like Service traffic. It is rarely used because it needs careful manual control and has security implications.

Headless Service: no virtual address at all

When a Service is created with no ClusterIP, there is nothing for kube-proxy to program. DNS instead returns the pod addresses directly. It is popular with databases and clustered programs that need to talk to specific members.

ExternalName: only a DNS nickname

This type simply maps a Service name to an outside DNS name. No pods are involved, so kube-proxy has nothing to redirect.

flowchart TB
  EXT[Outside user] --> LB[Cloud load balancer]
  LB --> NP[NodePort on a node]
  NP --> CIP[ClusterIP rules by kube-proxy]
  INT[Pod inside cluster] --> CIP
  CIP --> P1[Pod 1]
  CIP --> P2[Pod 2]
        
FIG 5 — LoadBalancer, NodePort and ClusterIP stacked together
Service TypeWho Can Reach Itkube-proxy Involved?
ClusterIPOnly pods inside the clusterYes, on every node
NodePortAnyone who can reach a nodeYes, opens the port on nodes
LoadBalancerThe public, through a cloud balancerYes, from node to pod
HeadlessPods via direct DNS answersNo
ExternalNamePods, via a DNS nicknameNo

9The Proxy Modes: Different Ways to Build the Rules

kube-proxy can speak more than one dialect of Linux networking. Each dialect is called a mode.

A mode decides which kernel feature kube-proxy uses to hold its rules. The end result, redirecting Service traffic to pods, is the same. What differs is speed, scale and complexity. Choosing the mode is a decision made when the cluster is set up or upgraded.

Mode 1

iptables

The long-standing Linux default. Uses chains of rules that the kernel reads from top to bottom. Simple and reliable, but slower at very large scale.

Mode 2

IPVS

Uses the kernel’s built-in load balancer with fast hash tables. Better for clusters with many Services and offers more balancing choices.

Mode 3

nftables

The modern successor to iptables, using more efficient data structures. It became generally available in recent Kubernetes versions.

Mode 4

Windows kernelspace

The mode used on Windows nodes, where kube-proxy uses the Windows networking stack instead of Linux features.

i
History Note

The very first design, called userspace mode, made kube-proxy carry every packet itself. It was slow because data had to travel up into an ordinary program and back down. It has been retired, which is why modern kube-proxy mostly programs the kernel instead.

FeatureiptablesIPVSnftables
Rule lookup styleSequential, top to bottomHash table lookupEfficient maps and sets
Speed with few ServicesExcellentExcellentExcellent
Speed with thousands of ServicesSlows downStays fastStays fast
Balancing choicesRandom spreadRound robin, least connections, hashing and moreRandom spread
Extra kernel needsNone specialIPVS kernel modulesRecent kernel with nftables
MaturityLongest track recordLong track recordNewer, growing adoption

10iptables Mode in Depth

The mode most people meet first, and the easiest one to picture.

iptables is a Linux feature that lets an administrator define lists of rules for network packets. Rules are grouped into chains, which work like checklists. A packet is compared against the entries of a chain, and the first matching entry decides what happens.

How kube-proxy arranges the checklists

In this mode, kube-proxy builds a small hierarchy. A main entry chain lists every Service address. Each Service then has its own chain that chooses among its pods, and each pod has a tiny chain that performs the actual address rewrite. So a packet first finds its Service, then its pod choice, then its rewrite.

flowchart TB
  IN[Packet to Service address] --> ENTRY[Main entry chain lists all Services]
  ENTRY --> SVC[Chain for this Service]
  SVC -->|one third chance| E1[Pod A rewrite]
  SVC -->|one half of the rest| E2[Pod B rewrite]
  SVC -->|remaining| E3[Pod C rewrite]
        
FIG 6 — How iptables mode chains rules from Service to pod

How it spreads the load

iptables has no built-in idea of round robin. Instead, kube-proxy uses probabilities. With three pods, the first rule says “take this pod one time in three.” If that roll fails, the second rule says “take this one half of the time,” and the last rule takes whatever remains. The mathematics works out so that each pod receives an equal share over many connections.

Simple Analogy

Picture a teacher choosing a volunteer from three students by rolling dice in a fixed order: first student gets a one-in-three chance, then the second gets a fifty-fifty chance, and the third is chosen if nobody else was. Everyone ends up equally likely to be picked.

Strengths

  • Very mature, widely understood and heavily tested.
  • Needs no special kernel modules.
  • Very fast for clusters with a modest number of Services.
  • Rules stay in place even if kube-proxy restarts briefly.

Weaknesses

  • Rule matching is sequential, so cost grows as Services grow.
  • Updating a huge rule set can take noticeable time and processor effort.
  • Only random spread is available for balancing.
  • Hard to read and debug once thousands of rules exist.
i
Good Practice

For most clusters with a few hundred Services, iptables mode is perfectly fine. Switch modes only when you measure a real problem, not because a newer option exists.

11IPVS Mode in Depth

A mode built on a real load balancer that lives inside the Linux kernel.

IPVS stands for IP Virtual Server. It is a load balancing feature in the Linux kernel that was designed from the start to spread connections across a group of servers. Instead of long checklists, it stores Services in a hash table, a structure that finds an entry almost instantly no matter how many entries exist.

How kube-proxy uses it

kube-proxy creates one virtual server in IPVS for each Service address and port, and adds each ready pod as a real server behind it. When a packet arrives for the Service, the kernel finds the virtual server by direct lookup and picks a pod using the chosen scheduling method. A few helper rules still exist in iptables or in address sets for supporting jobs such as masquerading.

Scheduler

Round robin

Takes turns: pod A, then B, then C, then A again. Simple and fair when requests are similar.

Scheduler

Least connection

Sends new connections to the pod currently holding the fewest. Good when requests vary greatly in length.

Scheduler

Source hashing

Uses the caller’s address to pick a pod, so the same caller tends to reach the same pod.

Scheduler

Destination hashing

Uses the destination to choose, useful for certain caching patterns.

Simple Analogy

Compare a shop with a paper list of clerks that a manager reads line by line, against a shop with a numbered ticket machine and a board showing which counter is free. The board lets the manager decide in an instant, however many counters exist. IPVS is the board and iptables is the paper list.

Strengths

  • Constant-time lookups keep performance steady for very large Service counts.
  • Several balancing methods to fit different workloads.
  • Rule updates are quicker for big clusters.

Weaknesses

  • Nodes must have the IPVS kernel modules available.
  • One more moving part to learn, monitor and debug.
  • Still relies on some iptables or set rules for supporting tasks.
!
Common Mistake

Turning on IPVS mode on machines that lack the required kernel modules can lead kube-proxy to fall back or fail. Always check the node images before switching modes across a cluster.

12nftables Mode and Beyond kube-proxy

Linux networking is moving forward, and Kubernetes is following it.

nftables: the successor to iptables

nftables is the newer Linux packet filtering framework meant to replace iptables. It stores rules in structures such as maps and sets, which allow a lookup without walking a long checklist. The kube-proxy nftables mode brings this design to Services, giving good speed at large scale while keeping the familiar random-spread balancing approach. It became generally available in the Kubernetes 1.33 release, and many distributions are moving toward it over time.

Simple Analogy

iptables is a paper phone book that you read from page one. nftables is a modern contacts app with instant search. Both give you the number, but one stays quick as the list gets enormous.

Replacing kube-proxy altogether

Some network plugins can take over the job of kube-proxy entirely. The best-known example is Cilium, which uses eBPF, a technology that lets small safe programs run inside the Linux kernel. With eBPF, Service lookups can happen at a very early point in packet handling, skipping much of the traditional rule machinery. Clusters that do this are said to run in kube-proxy replacement mode, and kube-proxy is simply not installed.

flowchart LR
  A[Standard path] --> B[kube-proxy writes rules]
  B --> C[Kernel rules redirect packets]
  D[Replacement path] --> E[CNI plugin with eBPF]
  E --> F[Kernel programs redirect packets]
        
FIG 7 — Standard kube-proxy path versus an eBPF replacement

Why teams choose a replacement

Very large clusters, strict performance targets and desire for richer visibility into traffic are the usual reasons. Some managed platforms ship this design by default.

Why many teams stay with kube-proxy

It is simple, built into nearly every distribution, understood by most engineers and good enough for the majority of clusters. Fewer moving parts means fewer surprises.

i
Key Insight

Even if a cluster uses no kube-proxy, the job it does still exists. Something must always turn Service addresses into pod addresses. Only the worker changes, not the responsibility.

13Traffic Policies and Session Affinity

Sometimes “spread traffic evenly everywhere” is not what you want. Kubernetes offers a few dials.

Session affinity: sticking to one pod

Some programs remember a visitor between requests, for example a shopping cart kept in a pod’s memory. If the next request lands on a different pod, the cart is gone. Session affinity, set to client address, tells kube-proxy to keep sending the same caller to the same pod for a limited time. It is a workaround, and the healthier long-term design is to keep such memory outside the pod.

External traffic policy

When outside traffic enters through a NodePort or load balancer, the node that receives it may not host a pod of the Service. Two choices exist.

Policy

Cluster

The default. The node may forward traffic to a pod on any node. Load spreads well, but the visitor’s original address may be hidden by translation and an extra network hop may occur.

Policy

Local

The node sends traffic only to pods on the same node. The visitor’s address is preserved and no extra hop is added, but nodes with no matching pod must not receive traffic.

With the Local choice, the cloud load balancer needs to know which nodes actually hold a pod. Kubernetes assigns a special health check port for this, and kube-proxy answers on it, saying “yes, I have a local pod” or “no, skip me.” That is one more small job of kube-proxy that beginners rarely notice.

Internal traffic policy and topology hints

Similar ideas exist for traffic inside the cluster. An internal policy can keep calls on the same node when possible. Topology-aware routing can prefer pods in the same availability zone as the caller. Staying close reduces delay and, on many clouds, cuts the cost of data crossing zones.

Simple Analogy

Think of a pizza chain with delivery from any branch in the city. Spreading orders across every branch is fair but slow for distant customers. Preferring the nearest branch is quicker and cheaper, though a branch with no pizza cooks should be skipped. That is the trade-off between Cluster and Local policies.

!
Common Mistake

Using the Local policy without enough pods spread across nodes can leave some nodes with no pods and the rest overloaded. Pair it with sensible pod spreading rules.

14Connection Tracking and Common Gotchas

A few quirks explain most of the strange bugs people report.

Conntrack: the kernel’s notebook

After the kernel rewrites a packet’s destination, it must remember that translation so replies can be reversed. It writes an entry in its connection tracking table, called conntrack. The table has a size limit. On busy nodes handling huge numbers of short connections, it can fill up, and new connections may then fail in confusing ways.

Gotcha 1

Full conntrack table

Symptoms include random timeouts and dropped connections under load. The cure is monitoring the table and increasing its size or reducing connection churn.

Gotcha 2

Stale UDP entries

UDP has no connection ending signal, so old entries can point to pods that no longer exist. kube-proxy cleans these, but timing gaps can cause short outages.

Gotcha 3

Long-lived connections

Because balancing happens at connection start, a few long connections can keep one pod busy while new pods sit idle after scaling up.

Gotcha 4

Hairpin traffic

A pod calling its own Service and being routed back to itself needs special handling. Modern setups handle it, but misconfigured networks may not.

flowchart TB
  A[New connection arrives] --> B{Conntrack has room?}
  B -->|Yes| C[Entry created and packet forwarded]
  B -->|No| D[Packet dropped]
  D --> E[User sees timeouts]
        
FIG 8 — How a full conntrack table causes mysterious failures
Simple Analogy

Conntrack is the receptionist’s visitor log. If the log book fills up and no new pages are available, new visitors cannot be signed in, however many empty desks the building has. The building looks fine, but people are turned away at the door.

i
Good Practice

Treat conntrack usage as a first-class metric on busy nodes. Problems here look like application bugs, but the cause sits in the operating system.

15Configuration, Health and Lifecycle

How kube-proxy is set up, kept alive and upgraded.

How it is configured

kube-proxy reads a configuration document, usually stored in a ConfigMap, which is a Kubernetes object for holding settings separately from programs. Typical choices include the proxy mode, how often rules are refreshed, the range of pod addresses in the cluster and the balancing method for IPVS. Changing these settings normally requires restarting the kube-proxy pods so that they pick up the new values.

Health and metrics endpoints

Each kube-proxy exposes two small network endpoints for operators. A health endpoint, by default on port 10256, reports whether the agent is working and up to date. A metrics endpoint, by default on port 10249, publishes numbers about its activity in a format that monitoring tools such as Prometheus can collect.

Metric

Rule sync duration

How long each rule update takes. Rising values point to a growing rule set or a busy node.

Metric

Sync failures

Counts of times rules could not be applied. Any steady growth deserves attention.

Metric

Last successful sync

A timestamp showing when rules last matched the cluster. A stale value means the node may be using old routes.

Metric

Pending changes

Shows how many Service or endpoint updates are waiting to be applied.

Logging

kube-proxy writes logs describing which mode it selected, which Services it processed and any errors while applying rules. Because pods are replaced, these logs should be shipped to a central logging system so that they survive restarts. Raising the log detail level temporarily can help during investigations, but it should be lowered afterwards because verbose logs on large clusters are noisy.

Upgrades and version matching

kube-proxy is released together with Kubernetes and is expected to stay close in version to the rest of the cluster. Nodes are commonly allowed to run a slightly older version than the control plane, but not a newer one. Always follow the upgrade order recommended for your Kubernetes release, and upgrade kube-proxy along with the nodes.

!
Common Mistake

Forgetting to update kube-proxy after upgrading a managed cluster is a frequent issue. Some platforms treat it as an add-on that you must update yourself, and running a very old version can cause missed features or subtle bugs.

16Security Considerations

A component that edits network rules on every node deserves careful protection.

kube-proxy needs strong permissions on the node, because writing kernel network rules is a privileged action. It therefore typically runs with elevated rights, usually as a privileged container or a system service. On the cluster side, it needs only permission to read Services and endpoints, which Kubernetes grants through a narrow role.

Layer 1

Least privilege in the API

Give kube-proxy only read access to Services and EndpointSlices. It should never be able to change or delete cluster objects.

Layer 2

Protect the node

Because kube-proxy runs with high privileges on each node, keep nodes patched, limit login access and restrict who can start privileged pods.

Layer 3

Secure the endpoints

Keep the health and metrics endpoints reachable only by the nodes and monitoring systems that need them.

Layer 4

Restrict NodePort exposure

NodePorts open on every node. Use firewalls or security groups so only intended sources can reach them.

Simple Analogy

Think of the road department worker who has keys to every signboard in the city. Such a person must be trusted, trained and monitored, because wrong signs could send traffic anywhere. The same care applies to the account and the machine where kube-proxy runs.

kube-proxy is not a firewall

It is easy to assume that kube-proxy decides who may talk to whom. It does not. It only decides where Service traffic goes, not whether it is allowed. Rules that permit or deny communication between pods are written as Network Policies, and they are enforced by the network plugin. Relying on kube-proxy for access control would leave the cluster wide open.

i
Good Practice

Layer your protection: Network Policies for who can talk, firewalls for which nodes and ports are open, and encryption for sensitive traffic. kube-proxy does its own job well when the other layers do theirs.

17Advantages and Trade-offs

An honest look at what the kube-proxy design gives you and what it costs.

Advantages

  • Provides stable Service addresses over constantly changing pods.
  • Spreads connections across healthy pods with no extra servers to buy.
  • Distributed by design, so no single central load balancer becomes a bottleneck.
  • Uses fast kernel forwarding, so packets do not pass through an ordinary program.
  • Included in nearly every Kubernetes distribution and widely understood.
  • Choice of modes lets teams match performance needs to their cluster size.

Disadvantages / Trade-offs

  • Balancing is per connection, so long-lived connections can be uneven.
  • Only connection-level intelligence: no awareness of web requests or paths.
  • iptables mode slows down and updates slowly at very large scale.
  • Conntrack limits and rule complexity create hard-to-diagnose failures.
  • Rules on the node are hard for beginners to read and debug.
  • Basic algorithms only, with no built-in awareness of pod load.

When the default is enough

For small and medium clusters, the standard kube-proxy in iptables mode is dependable and requires almost no attention. Spend effort on application design first, and revisit networking when measurements show a problem.

When to look further

Clusters with thousands of Services, very high connection rates, need for detailed traffic visibility or strict latency targets may benefit from IPVS, nftables or an eBPF-based replacement. Such choices should follow careful testing, since the network layer touches everything.

SituationSuggested Approach
Small or medium cluster, few hundred ServicesDefault kube-proxy, iptables mode
Thousands of Services on LinuxConsider IPVS or nftables mode
Need deep visibility and top performanceEvaluate an eBPF-based replacement
Windows worker nodeskube-proxy Windows mode
Web routing by path or hostAdd an Ingress or Gateway on top

18Design Patterns and Anti-Patterns

Habits that help kube-proxy do its job, and traps that make its life hard.

Helpful patterns

Pattern 1

Always call Services by name

Applications should use the Service name and let DNS and kube-proxy do the rest. Never hard-code pod addresses.

Pattern 2

Readiness checks everywhere

Accurate readiness reports keep unready pods out of kube-proxy’s rules, preventing visitors from hitting half-started programs.

Pattern 3

Graceful shutdown

Let pods finish current work and leave the endpoint list before stopping, so rules are updated before traffic disappears.

Pattern 4

Spread pods across nodes and zones

Distributing replicas reduces the impact of one node failure and works well with traffic policies.

Traps to avoid

ANTI-PATTERN-01 Avoid
Problem

Hard-coding pod addresses in application settings.

Why It’s Harmful

Pod addresses change with every replacement, so connections break unpredictably and bypass all of kube-proxy’s balancing and health awareness.

Correct Approach

Connect through the Service name and let the cluster resolve it.

ANTI-PATTERN-02 Avoid
Problem

Manually editing iptables rules on nodes to “fix” a networking issue.

Why It’s Harmful

kube-proxy owns these rules and will overwrite or fight manual edits, leading to confusing, temporary results and hidden drift between nodes.

Correct Approach

Fix the Service, endpoints or kube-proxy configuration, and let kube-proxy regenerate the rules.

ANTI-PATTERN-03 Avoid
Problem

Sending a few very long-lived connections and expecting perfect balancing after scaling up.

Why It’s Harmful

Balancing happens only when a connection starts, so new pods stay idle while old connections keep the original pods overloaded.

Correct Approach

Have clients reconnect periodically, or use an application-aware balancer such as a service mesh or gateway where fair spreading of requests matters.

ANTI-PATTERN-04 Avoid
Problem

Ignoring kube-proxy version and mode during cluster upgrades.

Why It’s Harmful

Old versions miss fixes, and unexpected mode changes may need kernel features that some nodes lack.

Correct Approach

Include kube-proxy in the upgrade plan, check its configuration, and test on a small group of nodes first.

19Troubleshooting Thinking for Beginners

When a Service does not work, follow the chain from name to pod, and check each link.

1

Does the name resolve?

Check that CoreDNS returns the Service address. If not, the problem is DNS, not kube-proxy.

2

Does the Service have endpoints?

If the label selector does not match any ready pod, the Service has an empty list and kube-proxy has nothing to route to. This is the most common cause.

3

Are the pods ready?

Pods failing readiness checks are removed from rules on purpose. Fix the pod, not the proxy.

4

Is kube-proxy healthy on that node?

Check that its pod is running, its health endpoint is green, and its logs show recent successful syncs.

5

Do the node rules exist?

Confirm that rules for the Service are present on the affected node. Missing rules point to a failed sync or wrong mode.

6

Can pods reach each other at all?

If direct pod-to-pod traffic fails, investigate the network plugin, firewalls and routes. Also check policies and conntrack usage.

i
Rule of Thumb

Empty endpoints, failing readiness and mismatched labels explain far more Service outages than any bug in kube-proxy. Check them first.

Step 1
name resolution
Step 2
endpoints and readiness
Step 3
node rules and network

20kube-proxy in the Real World

You rarely notice kube-proxy, and that is exactly the point.

An online shop during a festival sale

Traffic surges, the autoscaler adds many product-catalog pods, and kube-proxy on every node quickly learns the new endpoints. Requests spread across the larger crowd without anyone editing addresses.

A rolling update with zero downtime

While Kubernetes replaces old pods with new ones step by step, endpoint lists change constantly. kube-proxy keeps rules matching, so users are always sent to ready pods and rarely see an error.

A microservices platform with hundreds of services

Dozens of teams deploy small services that call each other by name. kube-proxy provides the shared foundation that makes those names work on every node.

A very large cluster switching modes

An organisation with many thousands of Services notices slow rule updates in iptables mode, tests IPVS or nftables mode on a subset of nodes, measures the improvement and then rolls the change out gradually.

A managed cloud cluster

On services such as EKS, GKE and AKS, kube-proxy is installed for you or replaced by the platform’s own data plane. Teams benefit from Services working immediately without configuring anything by hand.

EnvironmentTypical Service Data Path
Self-built cluster with common toolskube-proxy in iptables mode, sometimes IPVS or nftables
Amazon EKSkube-proxy delivered as a managed add-on
Google GKE with Dataplane V2eBPF-based data plane, no kube-proxy
Azure AKSkube-proxy by default, with options for other data planes
Clusters using Cilium replacement modeeBPF programs replace kube-proxy

21Frequently Asked Questions

Q1Does all my traffic pass through the kube-proxy program?

In the modern modes, no. kube-proxy writes rules and the kernel forwards packets. The program itself is not in the path of your data, which is why traffic keeps flowing during a brief kube-proxy restart.

Q2Do I need kube-proxy if I use an Ingress?

Usually yes. An Ingress controller itself is reached through a Service, and traffic from the controller to your application pods commonly uses Service rules too. Ingress handles web routing, while kube-proxy handles Service-to-pod redirection.

Q3What happens if kube-proxy stops on one node?

Existing rules remain in the kernel, so current routing still works for a while. But changes such as new pods, removed pods or new Services will not reach that node, and its rules slowly become out of date, leading to traffic sent to dead pods or missing new ones.

Q4Can I see the ClusterIP on any network card?

No. A ClusterIP is virtual and lives only in the rules. In IPVS mode, kube-proxy may add the address to a special dummy network interface for its own use, but it is still not a real machine address.

Q5Which mode should I choose?

Start with the default for your platform. Consider IPVS or nftables if you have very many Services and measure slow updates. Choose an eBPF replacement when you have deeper performance or visibility goals and the team can support it.

Q6Is kube-proxy the same as a service mesh?

No. A service mesh works at the request level with features such as retries, encryption between services and detailed request metrics. kube-proxy works at the connection level and offers only basic redirection and spreading.

Q7Does kube-proxy handle DNS?

No. Name resolution is handled by CoreDNS. kube-proxy acts after DNS has returned the Service address.

Q8Why is my Service reachable from some nodes but not others?

Because each node has its own rules. If kube-proxy is unhealthy or out of date on one node, only pods on that node are affected. Comparing kube-proxy health and logs across nodes usually reveals the odd one out.

Q9Does kube-proxy balance traffic based on pod load?

No. It spreads connections by simple methods such as random choice, and in IPVS mode by chosen schedulers like round robin or least connections. It does not know how busy a pod’s application really is.

Q10Can a cluster run without kube-proxy?

Yes, if another component such as an eBPF-based network plugin implements Service routing. The function is still required, but a different program performs it.

Q11Is kube-proxy a single point of failure?

Not in the usual sense. There is one per node, each independent, and the kernel keeps rules working even if it briefly stops. Failure affects updates on that node rather than the entire cluster.

22Summary and Key Takeaways

Pods in Kubernetes are short-lived and their addresses keep changing, so applications need a steady way to reach each other. A Service provides the stable name and virtual address, and kube-proxy makes that address real on every node. It watches the control plane for changes to Services and endpoints, translates them into network rules, and installs those rules in the operating system so that the kernel can redirect Service traffic to healthy pods.

The mode you choose, whether iptables, IPVS or nftables, changes how those rules are stored and how well they scale, but not what they achieve. Around this core sit useful details: traffic policies, session affinity, connection tracking, health and metrics endpoints, and security choices. And for special needs, eBPF-based network plugins can replace kube-proxy while carrying out the same responsibility.

Keep the receptionist picture in mind. kube-proxy does not carry visitors around the building. It makes sure every entrance has an up-to-date directory, so that each visitor is quietly pointed to someone who is present and ready to help.

Key Takeaways

  • kube-proxy makes Services work — it turns a stable Service address into real, ready pod addresses on every node.
  • It programs the kernel, it does not carry traffic — in the modern modes, the operating system forwards the packets using rules kube-proxy writes.
  • It runs on every node — usually as a DaemonSet, each copy watches the API server and maintains its own node’s rules.
  • Modes trade simplicity for scale — iptables is the dependable default, IPVS and nftables handle very large Service counts better.
  • It is one link in the chain — CoreDNS resolves names, kube-proxy redirects Services, and the network plugin moves packets between pods.
  • Balancing is per connection and basic — long-lived connections, conntrack limits and lack of request awareness are the main gotchas.
  • It is not a firewall — use Network Policies and node firewalls for access control, and protect the privileged node account it runs under.