Interview's MateKubernetes
Interview's Mate

Kubernetes

K8s · Workloads · GitOps · Cloud

Visualizer

DSA Visualizer
All 32 lessons
Custom Playground
Try your own examples

Learning

System Design
31 architecture topics
SQL Learning
160 foundations → production topics
AI Engineering
160 LLM → backend topics
Data Science
160 Python → MLOps topics
Data Engineer
160 SQL → streaming topics
Docker
160 Docker learning topics
Kubernetes
160 K8s fundamentals → cloud
Java LearnSoon
Coming soon
Python Learn
Interview Q&A & internals
JavaScript Learn
Closures, async & DOM Q&A
Tech Learn
Search, practise & track Q&A
AI DSA Practice
Solve coding problems
Theme
Home
Kubernetes topics
Lesson 43/ 160
03. Kubernetes Networking & Traffic Management

eBPF Networking & Kube-Proxy Replacement with Cilium

Use eBPF datapaths to replace kube-proxy and accelerate service routing.

AdvancedeBPF · Cilium · kube-proxy Replacement3 quiz questions
Practice DevOps Q&A
In plain wordsDiagramTheoryStep by stepWhen to use itInterview cluesMistakes to avoidQuiz (3)Practice

In plain words

eBPF is a programmable express lane embedded in the highway itself instead of a large roadside switchboard of individual kube-proxy rules. The simple Kubernetes rule is: Cilium can attach eBPF programs to kernel networking hooks to implement Service and policy lookup without maintaining kube-proxy rules for ordinary Service paths.

Think of it like…

eBPF is a programmable express lane embedded in the highway itself instead of a large roadside switchboard of individual kube-proxy rules.

Where you’ve seen it

During a connectivity incident, the network owner runs cilium status; cilium service list; kubectl get pods -n kube-system -l k8s-app=kube-proxy. Expected evidence: Cilium can attach eBPF programs to kernel networking hooks to implement Service and policy lookup without maintaining kube-proxy rules for ordinary Service paths. If the run instead shows this symptom, stop and restore the last known state: A node with incompatible eBPF features, disabled host-routing prerequisites, or mixed kube-proxy ownership can leave stale or divergent Service forwarding state.

Words you’ll hear

eBPF
For this lesson, eBPF is the controlling idea: Cilium can attach eBPF programs to kernel networking hooks to implement Service and policy lookup without maintaining kube-proxy rules for ordinary Service paths.
Cilium
Cilium is the checkpoint; run cilium status; cilium service list; kubectl get pods -n kube-system -l k8s-app=kube-proxy and inspect the owner chain. A node with incompatible eBPF features, disabled host-routing prerequisites, or mixed kube-proxy ownership can leave stale or divergent Service forwarding state.
kube-proxy Replacement
kube-proxy Replacement is the outcome to preserve; the cost is explicit: EBPF reduces per-Service rule chains and improves visibility, but debugging depends on kernel versions, Cilium agents, maps, and explicit masquerading behavior.
Verification evidence
The evidence command is cilium status; cilium service list; kubectl get pods -n kube-system -l k8s-app=kube-proxy. It connects the declaration to this behavior: Use eBPF datapaths to replace kube-proxy and accelerate service routing.

Visual diagram

Loading interactive diagram

Theory & deep dive

How eBPF reaches the intended state

Use eBPF datapaths to replace kube-proxy and accelerate service routing. Cilium can attach eBPF programs to kernel networking hooks to implement Service and policy lookup without maintaining kube-proxy rules for ordinary Service paths.

The concrete checkpoint is cilium status; cilium service list; kubectl get pods -n kube-system -l k8s-app=kube-proxy; compare the eBPF owner, Cilium state, and kube-proxy Replacement outcome instead of treating YAML acceptance as proof.

Verify Cilium, not only object creation

Run cilium status; cilium service list; kubectl get pods -n kube-system -l k8s-app=kube-proxy after the change and correlate the result with Events and the owning object. Cilium can attach eBPF programs to kernel networking hooks to implement Service and policy lookup without maintaining kube-proxy rules for ordinary Service paths.

Key takeaway: eBPF is implemented only when this invariant remains observable: Cilium can attach eBPF programs to kernel networking hooks to implement Service and policy lookup without maintaining kube-proxy rules for ordinary Service paths.

Cilium: failure boundary and production cost

A node with incompatible eBPF features, disabled host-routing prerequisites, or mixed kube-proxy ownership can leave stale or divergent Service forwarding state. The prerequisite contract is concrete: Cilium can attach eBPF programs to kernel networking hooks to implement Service and policy lookup without maintaining kube-proxy rules for ordinary Service paths.

EBPF reduces per-Service rule chains and improves visibility, but debugging depends on kernel versions, Cilium agents, maps, and explicit masquerading behavior. A safe design limits blast radius, records the last good configuration, and uses cilium status; cilium service list; kubectl get pods -n kube-system -l k8s-app=kube-proxy as a deterministic rollback checkpoint.

Recover from Cilium drift

Capture the current state with cilium status; cilium service list; kubectl get pods -n kube-system -l k8s-app=kube-proxy, then correct the controlling manifest rather than patching a child object; the relevant divergence signal is specific: A node with incompatible eBPF features, disabled host-routing prerequisites, or mixed kube-proxy ownership can leave stale or divergent Service forwarding state.

Key takeaway: Accept the trade-off consciously: EBPF reduces per-Service rule chains and improves visibility, but debugging depends on kernel versions, Cilium agents, maps, and explicit masquerading behavior.

How it works, step by step

Step 1 of 4
Traffic author

1. Define the reachability contract

Declare selectors, listeners, routes, or policy and keep endpoint readiness explicit: Cilium can attach eBPF programs to kernel networking hooks to implement Service and policy lookup without maintaining kube-proxy rules for ordinary Service paths.

eBPF contract → owned state
Key numbers at this step
Goal
Use eBPF datapaths to replace kube-proxy and accelerate service routing.
Owner
eBPF

When to use it & trade-offs

What it is

Use eBPF datapaths to replace kube-proxy and accelerate service routing. Cilium can attach eBPF programs to kernel networking hooks to implement Service and policy lookup without maintaining kube-proxy rules for ordinary Service paths.

Why it matters: A node with incompatible eBPF features, disabled host-routing prerequisites, or mixed kube-proxy ownership can leave stale or divergent Service forwarding state. The invariant at risk is specific: Cilium can attach eBPF programs to kernel networking hooks to implement Service and policy lookup without maintaining kube-proxy rules for ordinary Service paths. The quickest fact check before changing the design is cilium status; cilium service list; kubectl get pods -n kube-system -l k8s-app=kube-proxy.

When to reach for it

  • Use eBPF to enforce this invariant: Cilium can attach eBPF programs to kernel networking hooks to implement Service and policy lookup without maintaining kube-proxy rules for ordinary Service paths.
  • Use Cilium evidence from cilium status; cilium service list; kubectl get pods -n kube-system -l k8s-app=kube-proxy in reviews and incident timelines. Use eBPF datapaths to replace kube-proxy and accelerate service routing.
  • Choose the managed ingress or mesh route only when this cost is justified by governance or scale: EBPF reduces per-Service rule chains and improves visibility, but debugging depends on kernel versions, Cilium agents, maps, and explicit masquerading behavior.

When to avoid or be careful

  • Avoid assuming eBPF is complete after YAML submission; the required behavior is concrete: Cilium can attach eBPF programs to kernel networking hooks to implement Service and policy lookup without maintaining kube-proxy rules for ordinary Service paths.
  • Avoid treating the next symptom as random; check the owner and state with cilium status; cilium service list; kubectl get pods -n kube-system -l k8s-app=kube-proxy first: A node with incompatible eBPF features, disabled host-routing prerequisites, or mixed kube-proxy ownership can leave stale or divergent Service forwarding state.
  • Avoid adopting a heavier platform wrapper before measuring its cost: EBPF reduces per-Service rule chains and improves visibility, but debugging depends on kernel versions, Cilium agents, maps, and explicit masquerading behavior.

Native, manual, and managed paths for eBPF

Built-in API path
Best for: Use eBPF datapaths to replace kube-proxy and accelerate service routing. A concrete incident check is cilium status; cilium service list; kubectl get pods -n kube-system -l k8s-app=kube-proxy.

Strengths: Cilium can attach eBPF programs to kernel networking hooks to implement Service and policy lookup without maintaining kube-proxy rules for ordinary Service paths.

Watch out: EBPF reduces per-Service rule chains and improves visibility, but debugging depends on kernel versions, Cilium agents, maps, and explicit masquerading behavior. Recovery must also recognize this signal: A node with incompatible eBPF features, disabled host-routing prerequisites, or mixed kube-proxy ownership can leave stale or divergent Service forwarding state.

Datapath-specific extension
Best for: Quickly testing the Cilium assumption with cilium status; cilium service list; kubectl get pods -n kube-system -l k8s-app=kube-proxy; the expected invariant is: Cilium can attach eBPF programs to kernel networking hooks to implement Service and policy lookup without maintaining kube-proxy rules for ordinary Service paths.

Strengths: cilium status; cilium service list; kubectl get pods -n kube-system -l k8s-app=kube-proxy gives immediate feedback without first building a platform layer.

Watch out: A manual change can hide drift, and unlike eBPF, it does not make this symptom self-documenting: A node with incompatible eBPF features, disabled host-routing prerequisites, or mixed kube-proxy ownership can leave stale or divergent Service forwarding state.

Managed ingress or mesh
Best for: Teams that need kube-proxy Replacement integrated with guardrails; the evidence path is cilium status; cilium service list; kubectl get pods -n kube-system -l k8s-app=kube-proxy.

Strengths: Platform controls can wrap this exact behavior in policy or dashboards: Cilium can attach eBPF programs to kernel networking hooks to implement Service and policy lookup without maintaining kube-proxy rules for ordinary Service paths.

Watch out: The added platform ownership buys value at this cost: EBPF reduces per-Service rule chains and improves visibility, but debugging depends on kernel versions, Cilium agents, maps, and explicit masquerading behavior.

Interview signals & numbers to know

When this topic comes up

  • Interview anchor: Cilium can attach eBPF programs to kernel networking hooks to implement Service and policy lookup without maintaining kube-proxy rules for ordinary Service paths.
  • Trace eBPF to kube-proxy Replacement through Cilium; the invariant is: Cilium can attach eBPF programs to kernel networking hooks to implement Service and policy lookup without maintaining kube-proxy rules for ordinary Service paths.
  • Recognize the symptom: A node with incompatible eBPF features, disabled host-routing prerequisites, or mixed kube-proxy ownership can leave stale or divergent Service forwarding state.
  • Justify the cost: eBPF reduces per-Service rule chains and improves visibility, but debugging depends on kernel versions, Cilium agents, maps, and explicit masquerading behavior.
  • Verify with cilium status; cilium service list; kubectl get pods -n kube-system -l k8s-app=kube-proxy instead of only inspecting YAML.

Benchmarks & rules of thumb

0 -
kube-proxy Pods are needed in a complete replacement configuration
2 -
dataplanes may coexist only during a planned migration
1 -
Cilium status check should be healthy on every node

Common mistakes & follow-ups

Common interview mistakes

  • Debugging only the child object misses the eBPF owner contract: Cilium can attach eBPF programs to kernel networking hooks to implement Service and policy lookup without maintaining kube-proxy rules for ordinary Service paths.
  • Ignoring this telltale condition leads to unrelated changes: A node with incompatible eBPF features, disabled host-routing prerequisites, or mixed kube-proxy ownership can leave stale or divergent Service forwarding state.
  • Repeating cilium status; cilium service list; kubectl get pods -n kube-system -l k8s-app=kube-proxy without an owner for remediation wastes retry cost. EBPF reduces per-Service rule chains and improves visibility, but debugging depends on kernel versions, Cilium agents, maps, and explicit masquerading behavior.

Likely interviewer follow-ups

  • How would API output and runtime evidence prove this behavior: Cilium can attach eBPF programs to kernel networking hooks to implement Service and policy lookup without maintaining kube-proxy rules for ordinary Service paths?
  • Which owner object, logs, and Events would you inspect for this symptom-A node with incompatible eBPF features, disabled host-routing prerequisites, or mixed kube-proxy ownership can leave stale or divergent Service forwarding state-?
  • At what threshold would this cost become unacceptable: eBPF reduces per-Service rule chains and improves visibility, but debugging depends on kernel versions, Cilium agents, maps, and explicit masquerading behavior?
Interview tip: Interview sequence: state the invariant, run cilium status; cilium service list; kubectl get pods -n kube-system -l k8s-app=kube-proxy, name the failure, then justify the cost. Invariant: Cilium can attach eBPF programs to kernel networking hooks to implement Service and policy lookup without maintaining kube-proxy rules for ordinary Service paths. Failure: A node with incompatible eBPF features, disabled host-routing prerequisites, or mixed kube-proxy ownership can leave stale or divergent Service forwarding state. Cost: EBPF reduces per-Service rule chains and improves visibility, but debugging depends on kernel versions, Cilium agents, maps, and explicit masquerading behavior.

Knowledge check

Loading quiz

Put it into practice

Practice related interview Q&A

Apply eBPF Networking & Kube-Proxy Replacement with Cilium with generative AI interview Q&A and hands-on practice.

Open DevOps Q&A →Tech Learn Q&A
Previous topic
Container Network Interface (CNI) Plugins (Calico, Cilium, Flannel)
Next topic
Services Overview: Decoupling Pods from Dynamic IPs