Kubernetes CNI Explained: iptables, Calico and Cilium eBPF
Kubernetes CNI is the contract that gives every Pod an IP address and a working network path. This guide explains IPAM, veth wiring, iptables, Calico BGP, Cilium eBPF, NetworkPolicy enforcement, MTU traps, and how to choose a plugin you can operate.
Introduction
Kubernetes CNI decides how every Pod gets an address, how packets cross between nodes, and whether your NetworkPolicy objects actually block traffic. Kubernetes defines the networking model but leaves the implementation to a plugin, so this one choice shapes security, debugging, and upgrade work for the life of the cluster.
Consider an illustrative composite, not a named outage. A team launches a cluster, applies a tidy set of NetworkPolicy manifests, and passes its security review. Months later an engineer tests from a debug Pod and reaches the database namespace directly. The policies were stored, synced, and listed by kubectl the whole time. The installed plugin simply never enforced them, and nobody had run a negative test that proved a packet could be dropped.
That gap between stored intent and enforced reality is the theme of this guide. A second composite is quieter: Pods on the same node talk fine, Pods across nodes time out on large responses, and small health checks pass. That pattern usually points at MTU and encapsulation, not at the application. Both failures live in the data plane, below the level where most Kubernetes tutorials stop.
5-minute takeaway. CNI is a specification; Calico, Cilium, and cloud plugins are implementations. IPAM assigns Pod addresses, a veth pair connects each Pod to its node, and the datapath moves packets between nodes. iptables walks rules in order, eBPF looks them up in kernel maps, and Calico can run either style with BGP routing. Choose by constraint: managed default, BGP and compatibility needs, or eBPF observability and policy depth. Then prove enforcement with a test that must fail.
This is lesson eight in the Kubernetes Roadmap Series. The previous post covered Kubernetes Jobs and CronJobs for batch workloads. The next post explains Services in depth; you can see where both sit in Module 4 of the Kubernetes roadmap. If Pods, Nodes, and Services are still new, read Kubernetes Concepts Explained first.
1. Kubernetes CNI is a specification, not a product
Kubernetes CNI, the Container Network Interface, is a specification for configuring container networking, not a single product you install. The specification defines how a runtime asks a plugin to set up and tear down networking. Calico, Cilium, Flannel, and cloud plugins are implementations that answer those requests in different ways.
That distinction sounds academic until it saves you hours. When a Pod is stuck in ContainerCreating with a network setup error, the failing part is a plugin binary on a node, not "Kubernetes networking" in the abstract. When a NetworkPolicy does nothing, the question is whether your plugin enforces policy at all. Naming the layer correctly turns a vague incident into a short checklist.
Kubernetes itself sets the networking model every plugin must honour. Every Pod gets its own IP address. Pods can reach each other without NAT, at least inside the model the plugin implements. The address a Pod sees for itself is the address others use to reach it. Kubernetes deliberately stops there. It does not assign the addresses, create the interfaces, or program the routes. Those jobs belong to the plugin, which is why two clusters can run identical manifests and behave differently on the wire.
The specification is small on purpose. A plugin is an executable on the node. The runtime calls it with operations such as ADD when a Pod sandbox is created and DEL when the sandbox is removed. The plugin returns a result that includes the assigned addresses and routes. Configuration lives as files on each node, and plugins can be chained so a main plugin handles addressing while a second adds port mapping or bandwidth shaping.
Hold on to one sentence for the rest of this guide: the CNI plugin owns Pod IP assignment, Pod connectivity, and, if it implements one, the policy engine. Everything else in this article is a consequence of those three jobs. The control plane components that trigger this work are mapped in Kubernetes Architecture and Workload Orchestration.
2. How the Kubernetes CNI call flow wires a new Pod
When a Pod starts, the kubelet asks the container runtime to create a Pod sandbox, the runtime creates a network namespace, and then the Kubernetes CNI plugin is invoked with an ADD operation. The plugin assigns an address, creates the interface, sets routes, and returns the result before application containers start.
Walk the sequence slowly, because each step is a place where startup can fail. The scheduler places the Pod on a node. The kubelet on that node asks the runtime, usually containerd or CRI-O, to run the Pod sandbox. The sandbox holds the network namespace that all containers in the Pod will share. Only after that namespace exists does the runtime read the CNI configuration on the node and execute the plugin.
The plugin then does the visible work. It requests an address from its IPAM component, creates a virtual Ethernet pair, moves one end into the Pod namespace as eth0, configures the address and a default route, and programs whatever the node needs so return traffic finds its way back. The result goes back to the runtime, the kubelet records the Pod IP, and the application containers start inside the namespace that is now wired.
Teardown matters as much as setup. When the Pod is deleted, the runtime calls the plugin with DEL so the address returns to the pool and node state is cleaned up. Leaked addresses and stale routes are usually teardown failures, not creation failures. A plugin that cannot clean up after a node crash leaves the next Pod to inherit the mess.
Two practical consequences follow. First, CNI health is per node. A broken plugin on one node breaks Pod starts on that node while the rest of the cluster looks healthy, which is why DaemonSet status per node is a first check. Second, the plugin runs before your container does, with host-level privilege. Treat its version, its DaemonSet, and its configuration as platform code, reviewed and upgraded like any other node agent.
3. Kubernetes CNI IPAM: where Pod IP addresses come from
IPAM, IP address management, is the part of a Kubernetes CNI plugin that allocates Pod addresses from a configured range and tracks which addresses are in use. Most plugins divide the cluster Pod CIDR into per-node slices, so each node can assign addresses locally without asking a central service for every Pod.
Address planning is the decision teams regret most, because it is baked into the cluster at creation time. The Pod CIDR must not overlap with the node network, the Service CIDR, or any network the cluster must reach, including VPN and peering ranges. Overlap does not always fail loudly. It fails as one unreachable subnet, one broken route, or one partner network that cannot be peered later.
Per-node slicing is the common pattern. The cluster range is cut into blocks, each node owns a block, and the plugin hands out addresses from its local block as Pods start. Some plugins allocate in smaller blocks on demand, which wastes fewer addresses when node sizes vary. Cloud plugins may instead assign addresses from the cloud network itself, so Pods consume real VPC or VNet addresses. That design makes Pod traffic natively routable in the cloud network, but it ties cluster scale to subnet size and cloud quotas.
Exhaustion has a recognisable shape. Pods stay Pending or fail sandbox creation with address allocation errors while CPU and memory sit idle. The fix is rarely to restart things. It is to check how many addresses the node slice holds, how many the plugin believes are in use, and whether deleted Pods released theirs. Address leaks after node failures are a known failure mode for local IPAM stores, so verify the plugin view against the actual Pod list.
Plan for growth before you need it. A range that fits today's node count can cap tomorrow's, and widening a Pod CIDR in a running cluster ranges from awkward to unsupported depending on the plugin. Choose the range, the per-node slice size, and the maximum Pods per node together, and write the reasoning down where the next engineer will find it.
4. Inside the node: veth pairs, bridges and the Kubernetes CNI packet path
A veth pair is a virtual Ethernet cable with two ends: one end becomes eth0 inside the Pod network namespace, and the other stays on the node. The Kubernetes CNI plugin creates this pair, attaches the node end to a bridge or routes it directly, and so gives the Pod its path off the node.
Follow one packet. The application writes to a socket. The kernel in the Pod namespace routes the packet out of eth0, across the veth pair, and into the node namespace. From there the datapath decides. In a bridge design, the node end joins a Linux bridge alongside other Pod interfaces, and same-node traffic is switched locally. In a routed design, the node treats the Pod address as a route and forwards the packet toward the destination node, possibly through a tunnel.
The return path is where designs differ. Same-node replies are simple. Cross-node replies must arrive at the right node, enter the right veth pair, and reach the Pod without address translation breaking the conversation. Overlay designs wrap the packet in an outer header, commonly VXLAN, and unwrap it on arrival. Native routing designs advertise Pod routes, often with BGP, so the underlay network itself knows where each Pod range lives.
This is also where the namespace model from Kubernetes Container Internals: Namespaces, cgroups and runc pays off. The Pod namespace is an isolated network stack with its own interfaces, addresses, and routes. The veth pair is the controlled hole in that isolation. Every tool you use to debug, from ip addr inside the Pod to tcpdump on the node, is looking at one side of that pair or the other.
Keep the path in mind when symptoms split by location. Works on the same node, fails across nodes: suspect routing, tunnels, or MTU. Fails everywhere including same node: suspect policy, DNS, or the application. That one split, same node versus cross node, is the fastest first question in Pod networking, and it costs one test Pod placement to answer.
5. iptables and IPVS in the Kubernetes CNI story
iptables is the classic Linux packet filter, and for years it carried both Kubernetes policy enforcement and Service load balancing. A Kubernetes CNI plugin in iptables mode translates policy and routing intent into chains of rules. IPVS is the kernel load balancer that kube-proxy can use instead for Service traffic at scale.
The mechanics explain the scaling behaviour. iptables evaluates rules in order within a chain. A packet walks the chain until a rule matches, so cost grows with the number of rules it passes. With a handful of policies this is invisible. With thousands of endpoints and policies, rule count grows fast, updates rewrite large rule sets, and both packet latency and CPU cost climb. The kernel also tracks connections through conntrack, which is correct behaviour but another table that can fill under churn.
IPVS exists because Service load balancing has a different shape. Instead of long rule chains, IPVS keeps hash-based lookup tables for virtual services, so choosing a backend stays fast as Service and endpoint counts grow. In Kubernetes, IPVS is a kube-proxy mode rather than a CNI choice, and the next lesson in this series covers Services and kube-proxy in depth. The point here is narrower: when someone says a cluster is "slow because of iptables", ask which traffic they mean, policy enforcement, Service translation, or both. The fixes differ.
iptables still earns its place. It is present on nearly every Linux distribution, its state can be read with standard tools, and generations of network engineers can debug it at 3 a.m. nftables is its modern successor on many distributions, with a cleaner ruleset model, and several plugins now program nftables where available. Familiarity is an operational feature. A datapath your team can inspect beats a faster datapath nobody on call understands.
The honest summary is about scale, not age. Small and mid-sized clusters rarely feel iptables limits. Large clusters with heavy policy counts and endpoint churn feel them as CPU cost and slow rule updates. That is the pressure eBPF datapaths were built to relieve, and it is a measurable property of your cluster, not a slogan.
6. Calico in a Kubernetes CNI: BGP routing and mature policy
Calico is a Kubernetes CNI plugin that treats Pod addresses as routable IPs and distributes routes with BGP, the same protocol the internet uses between networks. It enforces policy with iptables or nftables by default and offers an eBPF datapath as an alternative. Its policy model extends the standard NetworkPolicy with cluster-wide rules.
The BGP design is Calico's signature. Each node advertises its Pod ranges to peers, either other nodes in a full mesh or route reflectors and top-of-rack switches in larger networks. Because routes are native, traffic can cross the physical network without an overlay tunnel, which keeps packets unencapsulated and lets existing network tooling see real Pod addresses. Where the underlay cannot carry Pod routes, Calico can fall back to IP-in-IP or VXLAN encapsulation for some or all traffic.
Policy is the second reason teams choose it. Calico enforces standard Kubernetes NetworkPolicy and adds its own resources, including cluster-wide GlobalNetworkPolicy, so platform teams can set guardrails that apply across namespaces while application teams write namespace-scoped rules. Ordering and tiering concepts in its extended model give platform teams a way to express precedence that plain NetworkPolicy cannot. For organisations with auditors, that expressiveness often matters more than datapath speed.
Operationally, Calico is conservative in a good way. It runs on older kernels, supports mixed environments including Windows nodes, and can extend policy beyond Kubernetes to virtual machines and hosts. Its state is inspectable with familiar tools when running the iptables or nftables datapath. The cost is moving parts: BGP sessions, route distribution, and node agents that network engineers understand but application teams may never have touched.
Choose Calico when the cluster must integrate with physical networking, when BGP peering is a requirement, when the fleet is heterogeneous, or when cluster-wide policy control is the deciding feature. Its eBPF mode narrows the performance argument against it, so the remaining decision is about policy model, compatibility, and the skills on your team.
7. Cilium in a Kubernetes CNI: the eBPF datapath
Cilium is a Kubernetes CNI plugin built on eBPF, a Linux kernel technology that runs small verified programs at hook points such as network interfaces. Cilium compiles networking and policy logic into those programs and kernel maps, so packet decisions use fast lookups instead of long rule chains, and flow visibility comes from the same machinery.
The datapath works at the point where packets enter and leave the node. eBPF programs attached to interfaces and sockets can route, translate, and filter traffic early, including shortcuts that avoid parts of the normal network stack for Pod-to-Pod traffic on the same node. Policy is keyed by identity, derived from labels, rather than by address alone. When Pods churn, identities stay stable even as addresses change, which matches how Kubernetes workloads actually behave.
Three capabilities follow from that foundation. First, policy depth: Cilium enforces standard NetworkPolicy and adds its own policy resources with layer 7 rules for protocols such as HTTP and DNS-aware egress to named destinations. Second, kube-proxy replacement: Cilium can take over Service load balancing in eBPF, removing the iptables or IPVS hop for Service traffic. Third, observability: Hubble exposes flow records with verdicts, so a dropped packet can be attributed to a policy decision instead of guessed at.
The constraints are real. eBPF needs a sufficiently modern Linux kernel, and feature depth varies with kernel version, so node images become part of the networking decision. Debugging shifts from iptables listings to Cilium tooling and Hubble queries, which your team must learn before an incident, not during one. Managed services reduce this burden where they ship Cilium-based dataplanes, which is why many teams meet Cilium first as a cloud default rather than a self-installed choice.
Choose Cilium when nodes run modern Linux kernels, when flow-level observability and identity-based or layer 7 policy are worth adopting, or when your cloud provider already runs it for you. The eBPF mechanism is the means. The decision is whether its policy and visibility model fits how your team secures and debugs workloads.
8. Kubernetes CNI NetworkPolicy enforcement: stored is not enforced
Kubernetes NetworkPolicy is an API object that describes allowed traffic, and the API server stores it whether or not anything enforces it. Enforcement is a Kubernetes CNI plugin job. A cluster whose plugin has no policy engine will list your policies, sync them through GitOps, and route every packet anyway.
Learn the semantics before blaming the plugin. By default, a Pod accepts all traffic. Once a NetworkPolicy with ingress rules selects a Pod, that Pod becomes isolated for ingress and only explicitly allowed traffic may enter. Egress works the same way in the other direction. Policies are additive: allowed traffic is the union of all policies selecting the Pod, and there is no deny rule or ordering in the standard API. A connection needs egress permission at the source and ingress permission at the destination.
The example below shows the pattern that works: a default deny for a namespace, then an explicit allow for DNS and one application path. Note the DNS rule. Forgetting egress to port 53 is the classic self-inflicted outage, because name resolution fails before any application traffic is attempted.
Verification is the step teams skip. Apply the policies, then run a test that must fail: from a Pod that should be blocked, attempt the connection and confirm it times out. A timeout is the expected signature of a silent drop. Then run the allowed path and confirm it succeeds. If the blocked test succeeds, check in order: does the plugin enforce policy, do the selectors match the Pod labels exactly, and is the policy in the same namespace as the Pods it selects.
Flannel is the standard example of a plugin with no policy enforcement, so clusters built on it need a separate policy component if NetworkPolicy must bite. Calico and Cilium both enforce the standard API and extend it. Whatever you run, record the enforcement test in your cluster build checklist. Policy you have not seen drop a packet is documentation, not a control. When traffic breaks after a policy change, the container networking troubleshooting runbook is the supporting path for isolating the layer at fault.
9. Kubernetes CNI MTU, encapsulation and egress control
MTU is the largest packet a link can carry without fragmentation, and encapsulation shrinks the space left for your data. When a Kubernetes CNI plugin wraps Pod traffic in VXLAN or IP-in-IP, the outer headers consume bytes, so the Pod MTU must sit below the node link MTU or large packets fail silently.
The failure signature is distinctive. Small requests succeed. Large responses stall, TLS handshakes hang, and file transfers die partway. Ping with small packets works, which sends teams hunting through application logs while the real fault sits in packet size. The mechanism is simple arithmetic: the node link carries a fixed maximum, the tunnel header takes its share, and a Pod packet sized for the full link no longer fits. If path MTU discovery signals are also blocked, the sender never learns to shrink its packets.
Diagnosis starts with numbers you can read. Check the interface MTU inside a Pod and on the node, confirm whether the plugin uses encapsulation for cross-node traffic, and test with large packets between nodes rather than small ones. Native routing designs avoid the tunnel overhead entirely, which is one reason BGP-based setups appeal to network teams. Where tunnels are required, set the Pod MTU deliberately and test it as part of cluster acceptance, not after the first stalled transfer.
Egress control is the related design question. NetworkPolicy egress rules can restrict which destinations a Pod may reach, and plugin extensions add DNS-aware rules and egress gateways that give outbound traffic a stable source address for allowlists at partners and payment providers. Decide early whether outbound traffic needs that treatment. Retrofitting a stable egress address after partners have allowlisted node addresses is slow, political work.
Two habits prevent most of this class of pain. First, test cross-node traffic with realistic payload sizes during cluster build, including a large response body and a TLS handshake. Second, write down the MTU chain: physical link, tunnel overhead, Pod interface setting, and any cloud network limits. When a future engineer changes one number, the document tells them which others must move.
10. Kubernetes CNI comparison: iptables, Calico and Cilium side by side
The table below compares the three datapath styles this guide has covered: a plain iptables-based setup, Calico, and Cilium. Read it as a constraint map, not a league table. Calico can run an iptables, nftables, or eBPF datapath, so its column describes the plugin, while the first column describes the classic mechanism on its own.
| Aspect | iptables-based datapath | Calico | Cilium |
|---|---|---|---|
| Packet decision | Sequential rule chains, conntrack state | iptables or nftables rules, or eBPF programs | eBPF programs and kernel maps |
| Cross-node routing | Depends on plugin, often overlay | BGP native routing, IP-in-IP or VXLAN fallback | Native routing or VXLAN overlay |
| Standard NetworkPolicy | Only if the plugin enforces it | Enforced | Enforced |
| Extended policy | None | GlobalNetworkPolicy, tiers in extended model | Identity-based and layer 7 policy, DNS-aware egress |
| Service load balancing | kube-proxy in iptables or IPVS mode | kube-proxy, or eBPF mode replacement | eBPF kube-proxy replacement |
| Observability | Rule counters, tcpdump, logs | Flow logs, standard Linux tools | Hubble flow records with verdicts |
| Kernel needs | Works on older kernels | Broad compatibility, including Windows nodes | Modern Linux kernel required |
| Best fit | Small clusters, simple needs | BGP integration, heterogeneous fleets, cluster-wide policy | Modern Linux fleets, deep observability, layer 7 policy |
Three readings of this table matter more than any single cell. First, enforcement is not automatic: the iptables column only enforces policy when the plugin using it implements a policy engine. Second, Calico and Cilium overlap more than older comparisons admit, since both can run eBPF datapaths and both enforce the standard policy API. Third, observability is a genuine differentiator. Seeing why a packet dropped, with the policy verdict attached, shortens incidents in a way raw throughput numbers do not.
Notice what the table does not contain: speed rankings. Published benchmarks vary with kernel, node size, policy count, and test method, and small clusters rarely reach the scale where datapath cost dominates. Measure on your own workload if performance is the deciding factor. Choose on constraints you can verify today.
North-south traffic is a separate layer from everything in this table. How external requests enter the cluster is covered in Ingress vs Gateway API vs Service Mesh. The CNI decision governs Pod-to-Pod traffic and policy enforcement underneath whichever entry layer you pick.
11. Choosing a Kubernetes CNI by constraint, not by benchmark
Choose a Kubernetes CNI plugin by naming your constraints in order: what your cloud provider already runs, what your network must integrate with, what policy depth you need, and what your team can debug under pressure. Throughput benchmarks come last, because at most cluster sizes both major plugins are faster than the workloads above them.
Start with the managed default question. On a managed service, the provider may already install and upgrade a dataplane for you, in some clouds a Cilium-based one, in others a cloud-native plugin that assigns cloud network addresses to Pods. Running the provider default transfers upgrade and support burden to the provider. Replacing it should require a named reason, such as a policy feature or routing requirement the default cannot meet.
Next, test the integration constraints. Must Pod routes peer with physical switches over BGP? Must the same policy cover virtual machines or Windows nodes? Are node kernels old or varied? Affirmative answers point toward Calico. Are nodes uniform modern Linux, and do you need layer 7 policy, DNS-aware egress, or flow verdicts during incidents? Those answers point toward Cilium. Write the answers down; they are the design record.
Then price the migration risk honestly. Changing CNI in a running cluster means reworking Pod addressing, policy translation, and node agents, and many teams treat it as a cluster rebuild rather than an upgrade. That cost argues for choosing deliberately once, preferring portable standard NetworkPolicy where it suffices, and isolating plugin-specific policy so a future move stays possible.
Finally, run the operability test. Can the engineer on call identify the plugin version, read its health, and explain a dropped packet with its tooling? If not, the plugin is too deep for the team today, whatever its feature list says. Close the gap with training and runbooks, or pick the option the team already understands. A boring datapath operated well beats a sophisticated one operated by hope.
12. Kubernetes CNI troubleshooting matrix and final checklist
Most Kubernetes CNI incidents announce their layer through their symptom shape, so start from the pattern rather than from a favourite tool. The matrix below maps common symptoms to the likely layer and the first check to run. It is a triage aid; the full isolation procedure lives in the troubleshooting runbook linked from section 8.
| Symptom | Likely layer | First check |
|---|---|---|
| Pod stuck in ContainerCreating, network setup error | Plugin ADD failure on that node | Plugin DaemonSet health and logs on the node |
| Pod has no IP or sandbox creation fails | IPAM exhaustion or leak | Address usage versus Pod list on the node |
| Same-node traffic works, cross-node fails | Routing, tunnel, or BGP session | Node routes and peer or tunnel state |
| Small requests pass, large responses stall | MTU mismatch under encapsulation | Pod and node MTU values, large-packet test |
| Policy applied but traffic still flows | Plugin does not enforce, or selector mismatch | Negative test, then labels versus selectors |
| Traffic broke right after a policy change | Missing DNS egress or one-sided allow | Port 53 egress, source egress and destination ingress |
| Service traffic slow at large endpoint counts | kube-proxy mode or rule scale | kube-proxy mode, endpoint and policy counts |
A short command set covers the first pass on most clusters. Confirm which plugin runs, check its node agents, list policies, and read the node routing table before touching manifests:
Run the node-level commands on the affected node, not from your laptop. Compare a healthy node with a failing one; the diff usually names the layer. Keep a debug Pod image with basic network tools approved in advance, because the moment you need one is the moment image pulls may also be failing.
Final checklist for a cluster you can defend:
- Pod CIDR, Service CIDR, and node ranges do not overlap, and the plan is documented.
- The plugin and its version are recorded, and its DaemonSet is healthy on every node.
- A negative NetworkPolicy test proves blocked traffic is actually dropped.
- DNS egress on port 53 is allowed wherever egress is restricted.
- Cross-node traffic passes with large payloads, and the MTU chain is written down.
- Egress needs, including any stable source address, are decided before partners allowlist anything.
- The team can name the first three checks for a Pod networking incident without searching.
None of these items requires exotic tooling. They require treating the data plane as production infrastructure with tests and records, which is the whole argument of this guide. The CNI choice you make on day one will still be shaping incidents on day three hundred, so make it with evidence.
Frequently Asked Questions
What is a Kubernetes CNI and what does it do?
A Kubernetes CNI plugin implements the Container Network Interface specification for a cluster. It assigns each Pod an IP address through IPAM, creates the Pod network interface, programs routes so Pods can reach each other across nodes, and, in plugins that support it, enforces NetworkPolicy. Kubernetes defines the networking model; the plugin does the work.
How does a Kubernetes CNI assign IP addresses to Pods?
Through IPAM. The plugin allocates addresses from the cluster Pod CIDR, usually by giving each node a slice of the range and assigning addresses locally as Pods start. Cloud plugins may instead assign addresses from the cloud network. When a Pod is deleted, the address returns to the pool for reuse.
What is the difference between Calico and Cilium in a Kubernetes CNI?
Calico routes Pod traffic natively with BGP and enforces policy with iptables, nftables, or an eBPF datapath, with strong cluster-wide policy options. Cilium is eBPF-native, keying policy by workload identity, adding layer 7 and DNS-aware rules, kube-proxy replacement, and Hubble flow observability. Both enforce standard NetworkPolicy.
Is eBPF faster than iptables for Kubernetes CNI networking?
At scale, generally yes in mechanism: iptables walks rule chains in order, while eBPF uses kernel map lookups, so cost grows more slowly as policy and endpoint counts rise. In small clusters the difference is usually unmeasurable. Treat vendor benchmarks as context and measure your own workload before deciding on speed.
Why is my Kubernetes CNI NetworkPolicy not blocking traffic?
The API server stores NetworkPolicy objects even when the installed plugin cannot enforce them. Check that your plugin enforces policy, that selectors match Pod labels exactly, that the policy sits in the right namespace, and that both source egress and destination ingress allow the traffic you expect. Prove it with a test connection that must fail.
Does every Kubernetes CNI enforce NetworkPolicy?
No. Enforcement is a plugin feature. Calico and Cilium enforce the standard API and extend it. Flannel does not enforce NetworkPolicy on its own, so clusters using it need an additional policy component. Always verify enforcement on your cluster instead of assuming applied YAML equals active control.
Can you change the Kubernetes CNI in a running cluster?
It is possible in some setups but rarely cheap. Pod addressing, policy translation, and node agents all change, and many teams treat a CNI switch as a cluster rebuild with workload migration. Choose deliberately at build time, prefer portable standard NetworkPolicy, and isolate plugin-specific policy so a future move stays feasible.
Preparing for Senior Platform & SRE Interviews
Practice real-world cluster triage, RBAC debugging, and pod scheduling scenarios in our Kubernetes scenario interview questions hub.
Explore Interview Scenarios →