What does kube-proxy do?
Short answer
kube-proxy runs on every node and sets up networking rules so that traffic sent to a Service reaches one of the Pods behind it. It's what makes a Service's stable IP actually work.
Explained in simple words
Pods come and go, and their IPs change every time. A Service gives a group of Pods one fixed address (the ClusterIP). But that IP doesn't belong to any real machine — it's virtual. kube-proxy is the traffic police on each node: when it sees traffic heading to the Service IP, it redirects it to one of the healthy Pod IPs.
How it works
- kube-proxy watches the API server for Services and their endpoints (the list of Pod IPs behind each Service).
- It writes rules into the node's Linux kernel networking — using iptables, IPVS or nftables, depending on the mode.
- When a Pod sends traffic to
10.96.45.12:80(a Service IP), the kernel rule rewrites the destination to a real Pod IP, for example10.244.2.7:8080.
Example
kubectl get svc web
# NAME TYPE CLUSTER-IP PORT(S)
# web ClusterIP 10.96.45.12 80/TCP
kubectl get endpointslices -l kubernetes.io/service-name=web
# shows the Pod IPs behind the Service
kubectl -n kube-system get ds kube-proxy # one kube-proxy Pod per node
Note: some network plugins, like Cilium, can replace kube-proxy completely using eBPF, which is faster on very large clusters.
What to say in the interview
"kube-proxy runs as a DaemonSet on every node. It watches Services and EndpointSlices and programs the node's networking rules — iptables, IPVS or nftables — so traffic to a Service's ClusterIP is load-balanced to one of the backing Pods. The ClusterIP is virtual; kube-proxy's rules make it work. In large clusters, some teams replace kube-proxy with an eBPF-based CNI like Cilium."
Follow-up questions you may get
- Does kube-proxy actually forward packets itself? In iptables/IPVS mode, no — it just writes kernel rules, and the kernel forwards the packets.
- Does it balance per request? No, per connection — which matters for long-lived connections like gRPC.