Container Network Interface (CNI) Plugins (Calico, Cilium, Flannel)
Compare popular CNI plugins for routing, policy, and performance trade-offs.
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-systemand 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
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.
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.
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.
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.
How it works, step by step
Step 1 of 41. 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.
- 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-systemin 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-systemfirst: 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
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.
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.
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-systemwithout 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?
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
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.