KevsRobots Learning Platform
75% Percent Complete
By Kevin McAleer, 3 Minutes
Page last updated May 24, 2025

K3s ships with a default CNI plugin called Flannel, which provides basic pod networking. But as your cluster grows or your needs become more complex (e.g. network policies, observability), you may want to use a more powerful Container Network Interface (CNI) plugin.
In this lesson, youโll learn how CNI works in K3s and how to install alternatives like Calico or Cilium.
CNI stands for Container Network Interface, a standard that defines how containers connect to the network.
Kubernetes uses CNI plugins to:
| Need | Recommended CNI |
|---|---|
| Enforce network security rules | Calico |
| Deep observability / eBPF | Cilium |
| Multi-cluster support | Cilium, Calico |
| WireGuard encryption | Cilium |
| BGP routing | Calico |
To disable Flannel, uninstall and reinstall K3s with:
sudo /usr/local/bin/k3s-uninstall.sh
Then reinstall without Flannel:
curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="--flannel-backend=none --disable-network-policy" sh -
Apply the official Calico manifests:
kubectl apply -f https://raw.githubusercontent.com/projectcalico/calico/v3.26.1/manifests/tigera-operator.yaml
Then install the Calico custom resource:
kubectl apply -f https://raw.githubusercontent.com/projectcalico/calico/v3.26.1/manifests/custom-resources.yaml
Verify:
kubectl get pods -n calico-system
Calico allows you to enforce pod-to-pod communication rules. For example:
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: deny-all
spec:
podSelector: {}
policyTypes:
- Ingress
This would block all incoming traffic unless explicitly allowed.
You now know how to:
Next up: Securing Your Cluster
You can use the arrows โ โ on your keyboard to navigate between lessons.
Comments