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 42/ 160
03. Kubernetes Networking & Traffic Management

Container Network Interface (CNI) Plugins (Calico, Cilium, Flannel)

Compare popular CNI plugins for routing, policy, and performance trade-offs.

IntermediateCNI · Calico · Cilium3 quiz questions
Practice DevOps Q&A
In plain wordsDiagramTheoryStep by stepWhen to use itInterview cluesMistakes to avoidQuiz (3)Practice

In plain words

A CNI is the campus road crew that both assigns streets and installs the gates controlling who can travel. The simple Kubernetes rule is: CNI plugins allocate Pod interfaces and addresses and program routes or overlays; Calico commonly emphasizes BGP or VXLAN plus policy, Cilium can use eBPF and identity, and Flannel primarily supplies simple networking.

Think of it like…

A CNI is the campus road crew that both assigns streets and installs the gates controlling who can travel.

Where you’ve seen it

During a connectivity incident, the network owner runs kubectl get pods -n kube-system; kubectl describe pod coredns-0 -n kube-system. Expected evidence: CNI plugins allocate Pod interfaces and addresses and program routes or overlays; Calico commonly emphasizes BGP or VXLAN plus policy, Cilium can use eBPF and identity, and Flannel primarily supplies simple networking. If the run instead shows this symptom, stop and restore the last known state: Installing an unsupported second CNI, deleting stale state, or running the selected policy mode without required kernel capabilities produces lost addresses and partially programmed nodes.

Words you’ll hear

CNI
For this lesson, CNI is the controlling idea: CNI plugins allocate Pod interfaces and addresses and program routes or overlays; Calico commonly emphasizes BGP or VXLAN plus policy, Cilium can use eBPF and identity, and Flannel primarily supplies simple networking.
Calico
Calico is the checkpoint; run kubectl get pods -n kube-system; kubectl describe pod coredns-0 -n kube-system and inspect the owner chain. Installing an unsupported second CNI, deleting stale state, or running the selected policy mode without required kernel capabilities produces lost addresses and partially programmed nodes.
Cilium
Cilium is the outcome to preserve; the cost is explicit: Feature-rich CNIs improve policy and observability, but node kernel compatibility and upgrade coupling increase compared with a basic overlay.
Verification evidence
The evidence command is kubectl get pods -n kube-system; kubectl describe pod coredns-0 -n kube-system. It connects the declaration to this behavior: Compare popular CNI plugins for routing, policy, and performance trade-offs.

Visual diagram

Loading interactive diagram

Theory & deep dive

How CNI reaches the intended state

Compare popular CNI plugins for routing, policy, and performance trade-offs. CNI plugins allocate Pod interfaces and addresses and program routes or overlays; Calico commonly emphasizes BGP or VXLAN plus policy, Cilium can use eBPF and identity, and Flannel primarily supplies simple networking.

The concrete checkpoint is kubectl get pods -n kube-system; kubectl describe pod coredns-0 -n kube-system; compare the CNI owner, Calico state, and Cilium outcome instead of treating YAML acceptance as proof.

Verify Calico, not only object creation

Run kubectl get pods -n kube-system; kubectl describe pod coredns-0 -n kube-system after the change and correlate the result with Events and the owning object. CNI plugins allocate Pod interfaces and addresses and program routes or overlays; Calico commonly emphasizes BGP or VXLAN plus policy, Cilium can use eBPF and identity, and Flannel primarily supplies simple networking.

Key takeaway: CNI is implemented only when this invariant remains observable: CNI plugins allocate Pod interfaces and addresses and program routes or overlays; Calico commonly emphasizes BGP or VXLAN plus policy, Cilium can use eBPF and identity, and Flannel primarily supplies simple networking.

Calico: failure boundary and production cost

Installing an unsupported second CNI, deleting stale state, or running the selected policy mode without required kernel capabilities produces lost addresses and partially programmed nodes. The prerequisite contract is concrete: CNI plugins allocate Pod interfaces and addresses and program routes or overlays; Calico commonly emphasizes BGP or VXLAN plus policy, Cilium can use eBPF and identity, and Flannel primarily supplies simple networking.

Feature-rich CNIs improve policy and observability, but node kernel compatibility and upgrade coupling increase compared with a basic overlay. A safe design limits blast radius, records the last good configuration, and uses kubectl get pods -n kube-system; kubectl describe pod coredns-0 -n kube-system as a deterministic rollback checkpoint.

Recover from Calico drift

Capture the current state with kubectl get pods -n kube-system; kubectl describe pod coredns-0 -n kube-system, then correct the controlling manifest rather than patching a child object; the relevant divergence signal is specific: Installing an unsupported second CNI, deleting stale state, or running the selected policy mode without required kernel capabilities produces lost addresses and partially programmed nodes.

Key takeaway: Accept the trade-off consciously: Feature-rich CNIs improve policy and observability, but node kernel compatibility and upgrade coupling increase compared with a basic overlay.

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: CNI plugins allocate Pod interfaces and addresses and program routes or overlays; Calico commonly emphasizes BGP or VXLAN plus policy, Cilium can use eBPF and identity, and Flannel primarily supplies simple networking.

CNI contract → owned state
Key numbers at this step
Goal
Compare popular CNI plugins for routing, policy, and performance trade-offs.
Owner
CNI

When to use it & trade-offs

What it is

Compare popular CNI plugins for routing, policy, and performance trade-offs. CNI plugins allocate Pod interfaces and addresses and program routes or overlays; Calico commonly emphasizes BGP or VXLAN plus policy, Cilium can use eBPF and identity, and Flannel primarily supplies simple networking.

Why it matters: Installing an unsupported second CNI, deleting stale state, or running the selected policy mode without required kernel capabilities produces lost addresses and partially programmed nodes. The invariant at risk is specific: CNI plugins allocate Pod interfaces and addresses and program routes or overlays; Calico commonly emphasizes BGP or VXLAN plus policy, Cilium can use eBPF and identity, and Flannel primarily supplies simple networking. The quickest fact check before changing the design is kubectl get pods -n kube-system; kubectl describe pod coredns-0 -n kube-system.

When to reach for it

  • Use CNI to enforce this invariant: CNI plugins allocate Pod interfaces and addresses and program routes or overlays; Calico commonly emphasizes BGP or VXLAN plus policy, Cilium can use eBPF and identity, and Flannel primarily supplies simple networking.
  • Use Calico evidence from kubectl get pods -n kube-system; kubectl describe pod coredns-0 -n kube-system in reviews and incident timelines. Compare popular CNI plugins for routing, policy, and performance trade-offs.
  • Choose the managed ingress or mesh route only when this cost is justified by governance or scale: Feature-rich CNIs improve policy and observability, but node kernel compatibility and upgrade coupling increase compared with a basic overlay.

When to avoid or be careful

  • Avoid assuming CNI is complete after YAML submission; the required behavior is concrete: CNI plugins allocate Pod interfaces and addresses and program routes or overlays; Calico commonly emphasizes BGP or VXLAN plus policy, Cilium can use eBPF and identity, and Flannel primarily supplies simple networking.
  • Avoid treating the next symptom as random; check the owner and state with kubectl get pods -n kube-system; kubectl describe pod coredns-0 -n kube-system first: Installing an unsupported second CNI, deleting stale state, or running the selected policy mode without required kernel capabilities produces lost addresses and partially programmed nodes.
  • Avoid adopting a heavier platform wrapper before measuring its cost: Feature-rich CNIs improve policy and observability, but node kernel compatibility and upgrade coupling increase compared with a basic overlay.

Native, manual, and managed paths for CNI

Built-in API path
Best for: Compare popular CNI plugins for routing, policy, and performance trade-offs. A concrete incident check is kubectl get pods -n kube-system; kubectl describe pod coredns-0 -n kube-system.

Strengths: CNI plugins allocate Pod interfaces and addresses and program routes or overlays; Calico commonly emphasizes BGP or VXLAN plus policy, Cilium can use eBPF and identity, and Flannel primarily supplies simple networking.

Watch out: Feature-rich CNIs improve policy and observability, but node kernel compatibility and upgrade coupling increase compared with a basic overlay. Recovery must also recognize this signal: Installing an unsupported second CNI, deleting stale state, or running the selected policy mode without required kernel capabilities produces lost addresses and partially programmed nodes.

Datapath-specific extension
Best for: Quickly testing the Calico assumption with kubectl get pods -n kube-system; kubectl describe pod coredns-0 -n kube-system; the expected invariant is: CNI plugins allocate Pod interfaces and addresses and program routes or overlays; Calico commonly emphasizes BGP or VXLAN plus policy, Cilium can use eBPF and identity, and Flannel primarily supplies simple networking.

Strengths: kubectl get pods -n kube-system; kubectl describe pod coredns-0 -n kube-system gives immediate feedback without first building a platform layer.

Watch out: A manual change can hide drift, and unlike CNI, it does not make this symptom self-documenting: Installing an unsupported second CNI, deleting stale state, or running the selected policy mode without required kernel capabilities produces lost addresses and partially programmed nodes.

Managed ingress or mesh
Best for: Teams that need Cilium integrated with guardrails; the evidence path is kubectl get pods -n kube-system; kubectl describe pod coredns-0 -n kube-system.

Strengths: Platform controls can wrap this exact behavior in policy or dashboards: CNI plugins allocate Pod interfaces and addresses and program routes or overlays; Calico commonly emphasizes BGP or VXLAN plus policy, Cilium can use eBPF and identity, and Flannel primarily supplies simple networking.

Watch out: The added platform ownership buys value at this cost: Feature-rich CNIs improve policy and observability, but node kernel compatibility and upgrade coupling increase compared with a basic overlay.

Interview signals & numbers to know

When this topic comes up

  • Interview anchor: CNI plugins allocate Pod interfaces and addresses and program routes or overlays; Calico commonly emphasizes BGP or VXLAN plus policy, Cilium can use eBPF and identity, and Flannel primarily supplies simple networking.
  • Trace CNI to Cilium through Calico; the invariant is: CNI plugins allocate Pod interfaces and addresses and program routes or overlays; Calico commonly emphasizes BGP or VXLAN plus policy, Cilium can use eBPF and identity, and Flannel primarily supplies simple networking.
  • Recognize the symptom: Installing an unsupported second CNI, deleting stale state, or running the selected policy mode without required kernel capabilities produces lost addresses and partially programmed nodes.
  • Justify the cost: Feature-rich CNIs improve policy and observability, but node kernel compatibility and upgrade coupling increase compared with a basic overlay.
  • Verify with kubectl get pods -n kube-system; kubectl describe pod coredns-0 -n kube-system instead of only inspecting YAML.

Benchmarks & rules of thumb

2 -
major dataplane styles are routed and encapsulated overlays
1 -
CNI configuration should own Pod networking per node
3 -
commonly compared plugins in this lesson: Calico, Cilium, and Flannel

Common mistakes & follow-ups

Common interview mistakes

  • Debugging only the child object misses the CNI owner contract: CNI plugins allocate Pod interfaces and addresses and program routes or overlays; Calico commonly emphasizes BGP or VXLAN plus policy, Cilium can use eBPF and identity, and Flannel primarily supplies simple networking.
  • Ignoring this telltale condition leads to unrelated changes: Installing an unsupported second CNI, deleting stale state, or running the selected policy mode without required kernel capabilities produces lost addresses and partially programmed nodes.
  • Repeating kubectl get pods -n kube-system; kubectl describe pod coredns-0 -n kube-system without an owner for remediation wastes retry cost. Feature-rich CNIs improve policy and observability, but node kernel compatibility and upgrade coupling increase compared with a basic overlay.

Likely interviewer follow-ups

  • How would API output and runtime evidence prove this behavior: CNI plugins allocate Pod interfaces and addresses and program routes or overlays; Calico commonly emphasizes BGP or VXLAN plus policy, Cilium can use eBPF and identity, and Flannel primarily supplies simple networking?
  • Which owner object, logs, and Events would you inspect for this symptom-Installing an unsupported second CNI, deleting stale state, or running the selected policy mode without required kernel capabilities produces lost addresses and partially programmed nodes-?
  • At what threshold would this cost become unacceptable: Feature-rich CNIs improve policy and observability, but node kernel compatibility and upgrade coupling increase compared with a basic overlay?
Interview tip: Interview sequence: state the invariant, run kubectl get pods -n kube-system; kubectl describe pod coredns-0 -n kube-system, name the failure, then justify the cost. Invariant: CNI plugins allocate Pod interfaces and addresses and program routes or overlays; Calico commonly emphasizes BGP or VXLAN plus policy, Cilium can use eBPF and identity, and Flannel primarily supplies simple networking. Failure: Installing an unsupported second CNI, deleting stale state, or running the selected policy mode without required kernel capabilities produces lost addresses and partially programmed nodes. Cost: Feature-rich CNIs improve policy and observability, but node kernel compatibility and upgrade coupling increase compared with a basic overlay.

Knowledge check

Loading quiz

Put it into practice

Practice related interview Q&A

Apply Container Network Interface (CNI) Plugins (Calico, Cilium, Flannel) with generative AI interview Q&A and hands-on practice.

Open DevOps Q&A →Tech Learn Q&A
Previous topic
Kubernetes Networking Model (Pod-to-Pod, Node-to-Pod, Flat Network)
Next topic
eBPF Networking & Kube-Proxy Replacement with Cilium