kubectl apply, and Kubernetes creates everything declared inside. For CNIs the most important object in these manifests is a DaemonSet.
A DaemonSet ensures one copy of a pod runs on each node — exactly what a networking plugin needs so every node receives a pod network.
- Flannel manifest: https://raw.githubusercontent.com/flannel-io/flannel/master/Documentation/kube-flannel.yml
- Canal manifest: https://docs.projectcalico.org/manifests/canal.yaml
Before applying manifests, make sure your kubectl commands target the correct cluster context.You can either:
- add
--contextto eachkubectlcommand, e.g.kubectl --context=cluster1 get nodes, or - switch contexts once with
kubectl config use-context cluster1so subsequent commands go to that cluster.
Step 1 — Install Flannel on cluster1
Switch tocluster1 and apply the Flannel manifest (replace the example URL with the official Flannel manifest URL if it changes):
cluster1 has three nodes, three Flannel pods appear.
Within a few moments the node statuses should change. kubectl get nodes will show nodes as Ready. Why does this happen? The kubelet (the node agent) needs the pod network provided by a CNI plugin to finish configuring pod networking. Once the CNI is available, the kubelet completes setup and the node transitions from NotReady to Ready.
Deployments or pods that were waiting for a network can now be scheduled and will move to Running:
Step 2 — Install Canal on cluster2
Switch tocluster2 and apply the Canal manifest (again, use the official manifest URL if changed):
cluster2 has two nodes, you’ll see two Canal pods. The nodes will move from NotReady to Ready as the CNI becomes available, and any previously unschedulable pods will reach Running.
Verification checklist
Bob verifies the clusters:- On
cluster1list pods across all namespaces and confirm three Flannel pods areRunning.
Example:kubectl --context=cluster1 get pods -A
- On
cluster2list pods and confirm two Canal pods areRunning.
Example:kubectl --context=cluster2 get pods -A
- All five nodes (three in cluster1, two in cluster2) now report
Ready. - Deployment A pods and Pod B are
Running.
Ready and pods are Running.
CNI differences and NetworkPolicy
Note that different CNIs have different feature sets. In particular, support for Kubernetes NetworkPolicy depends on the plugin:Note: Applying the same NetworkPolicy to both clusters does not guarantee identical behavior. One cluster may actively enforce policies, while another may accept and store them without enforcing. Always confirm NetworkPolicy support in the CNI documentation before relying on policies for network isolation.
Summary
- A CNI is typically installed by applying a manifest that includes a DaemonSet, which ensures one plugin pod per node.
- Use
kubectl config use-context <context>or--contextto point kubectl at the correct cluster before applying manifests. - After installing a CNI, nodes should move to
Readyand pods will be scheduled normally. - Choose a CNI that matches your feature needs (for example, NetworkPolicy enforcement).
Links and references
- Flannel install manifest: https://raw.githubusercontent.com/flannel-io/flannel/master/Documentation/kube-flannel.yml
- Canal (Project Calico) manifest: https://docs.projectcalico.org/manifests/canal.yaml
- Kubernetes Documentation: https://kubernetes.io/docs/