Home › CKA › Topics › Practice tasks › CNI Networking
CKA · Cluster Architecture, Installation & Configuration

Install a CNI Plugin: Flannel or Calico

Install and configure one Container Network Interface (CNI) plugin from the options below. Available options Flannel v0.26.1 - manifest: kube-flannel.yml…

Check live lab access → All CKA tasks

Live lab access

This task description is public. Its live lab requires full access; six other CKA labs are available in Free Practice with AI Lab Coach.

Create an account to continue →

Explore the six free labs with AI Lab Coach →

Read the brief on any device. Use a desktop or laptop for the terminal lab. Nothing starts until you choose Start.

The task

Task

Install and configure one Container Network Interface (CNI) plugin from the options below.

Available options

https://github.com/flannel-io/flannel/releases/download/v0.26.1/kube-flannel.yml

https://raw.githubusercontent.com/projectcalico/calico/v3.32.2/manifests/tigera-operator.yaml https://raw.githubusercontent.com/projectcalico/calico/v3.32.2/manifests/custom-resources.yaml

Requirements

The CNI you install must:

Original Prepium guide · Written for Kubernetes v1.35 and checked against the official documentation on 6 October 2026. Use a disposable practice cluster. Installing or swapping a network plugin affects every Pod, so practise on a fresh kubeadm cluster rather than one you care about.

What a CNI plugin actually does, and why "Pods talk" is not the same as "policies work"

Kubernetes defines the network model (every Pod gets its own cluster-wide IP and can reach every other Pod without NAT) but does not implement it. A Container Network Interface (CNI) plugin does. Picking one on the exam means checking two separate properties: does it give Pods connectivity, and does it enforce NetworkPolicy? The API server stores a NetworkPolicy either way.

kubelet ──CRI──→ container runtime ──reads──→ /etc/cni/net.d/*.conflist
                         └──exec ADD──→ /opt/cni/bin/<plugin> ──→ veth + IP inside the Pod netns
plugin agent (DaemonSet) ──→ routes/overlay between nodes  (+ policy engine, if it has one)

1. Inspect a cluster with no network yet (read-only)

kubectl get nodes
kubectl -n kube-system get pods -o wide | grep -i dns
kubectl -n kube-system get cm kubeadm-config -o yaml | grep -i subnet
kubectl get nodes -o jsonpath='{range .items[*]}{.metadata.name}{" "}{.spec.podCIDR}{"\n"}{end}'
ls /etc/cni/net.d /opt/cni/bin      # on a node

Since v1.24 the kubelet no longer manages CNI itself; the container runtime loads the plugin configuration (default directory /etc/cni/net.d) and runs plugin binaries (default /opt/cni/bin). On a CNI ADD call, the plugin creates or adjusts the Pod's interface inside its network namespace, usually delegating address assignment to an IPAM plugin. With an empty config directory, CoreDNS stays Pending, which the kubeadm guide calls expected, and the node's Ready condition message is the place to look for network errors.

2. Line the plugin's Pod range up with the cluster

The podSubnet you see above, and each node's spec.podCIDR carved from it, must agree with the range in the plugin's own config. The defaults differ by project:

Also keep the Pod range clear of your host networks; the kubeadm docs warn that overlap causes problems.

3. Check policy enforcement on the plugin's own docs

Kubernetes states that a NetworkPolicy without a controller implementing it has no effect. Flannel's README says the flanneld binary does not natively enforce NetworkPolicy; policy needs an add-on (its Helm chart has a netpol.enabled option, or you pair it with another project such as Calico). Calico's install docs describe installing both networking and network policy. Read the docs for the exact version you are offered, since features change. Then test rather than trust, in namespace prepium-tutorial:

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: lockdown-ingress
  namespace: prepium-tutorial
spec:
  podSelector: {}
  policyTypes:
  - Ingress

Run an nginx Pod and a busybox client, confirm wget -T 3 to the nginx Pod IP works, apply the policy, and repeat. On an enforcing plugin the second request times out; on a non-enforcing one it still succeeds.

4. Confirm the network is healthy

Watch the plugin's DaemonSet roll out on every node (for the Calico operator, kubectl get tigerastatus should show components AVAILABLE True). Then check that nodes are Ready, CoreDNS is Running, and new Pods get IPs inside the expected range.

Common mistakes

Example checkEvidence
Plugin running everywhereDaemonSet DESIRED equals READY
Pod networking worksNodes Ready, CoreDNS Running, cross-node Pod-to-Pod request succeeds
Ranges agreePod IPs fall inside podSubnet
Policy enforcedRequest blocked after the deny policy, allowed before

Cleanup: kubectl delete namespace prepium-tutorial; rebuild the practice cluster to try a different plugin. References: Network Plugins, Network Policies, Flannel README, Calico on-premises install. Next, try writing a NetworkPolicy or kubeadm init.

Exam
CKA
Domain
Cluster Architecture, Installation & Configuration
Grading
Programmatic · partial credit

What this tests

Build clusters with kubeadm, manage RBAC, etcd, and the control plane, and install a CNI. On the CKA exam, Cluster Architecture, Installation & Configuration tasks are graded purely on what you build in the cluster - not multiple choice - so the only way to get faster is to do them on a real cluster against a clock.

Practice it for real

The public description lets you study the task before signing up. Full access includes every live lab. Six selected CKA scenarios are included in Free Practice, with five shared sessions each week. You solve the task in a real terminal, hit validate, and a programmatic checker scores exactly what you got right and wrong (with partial credit). You can open the solution while practising, then retry and use the failed checks to improve your score.

Related CKA tasks