Flannel is a general purpose container network interface (CNI) for Kubernetes clusters but offers limited integration for mTLS and container security. Calico has more robust capabilities and direct support for Istio service mesh, offering pod traffic controls, ingress traffic, and additional firewall rules.
Calico is compatible with a wide range of Kubernetes versions and cloud environments. It supports various Linux distributions and integrates with different container runtimes. Additionally, Calico can work with both on-premises and cloud-native infrastructures, including AWS, Azure, and Google Cloud.
The below steps were successfully tested on a cluster running:
-
Kubernetes v1.29.8
-
Flannel v0.22.0
-
Calico v3.28.1
NOTE: live migration will NOT work on a full Lilt deployment. Nodes are unable to reschedule due to LLM image file sizes.
Since Live Migration is not available, must use the following steps for manual migration. This requires the cluster be DOWN for approximately 15 minutes. Please notify all users prior to proceeding.
Delete Flannel
Switch to root user:
On main (control-plane) node, default flannel installation is via a daemonset yaml and must be deleted:
On EVERY node in the cluster, ssh and stop kubelet and containerd services:
On EVERY node in the cluster, ssh and delete the following local files associated with Flannel CNI:
On EVERY node in the cluster, ssh and delete ip interfaces associated with Flannel:
On the main node (or one of the control-plane nodes), restart kubelet and containerd services:
Verify that the kube-flannel namespace does not exist:
If the namespace kube-flannel is listed, delete it:
Install Calico (tigera-operator)
There are two options for installing Calico; operator and manifest. Manifest is the easiest option but only installs the basic CNI interface. Lilt requires the Calico operator for integration with Istio mesh services.
If installing on a single-node cluster, need to remove taint on the control-plane so that the operator will schedule:
On the main (control-plane) node, create a values override file for the helm install. Need to ensure that the CIDR range is the same as the previous Flannel installation:
- default Flannel CIDR:
192.168.0.0/17
If have external internet access, pull helm chart and install with override file:
Check install status with the following command (can take up to a minute to be fully ready):
Result when fully ready:
OPTIONAL: If coredns pods are installed but not ready, or have CrashLoopBack errors, need to restart coredns:
Restart coredns:
Coredns will then recognize Calico CNI and be in ready state:
OPTIONAL: If Calico will not schedule, can also restart containerd again:
Restart ALL updated/modified nodes. Required to implement new CNI settings:
After reboot, some pods might be in pending/running state but not healthy/complete:
Delete the pods and they should be back to healthy:
Result:
Install calicoctl (optional, but highly recommended)
calicoctl is a command line tool that can be used to manage the Calico network and security policies and other Calico configurations. It communicates directly with etcd to manipulate the datastore. It provides a number of resource management commands and can be used to troubleshoot Calico network issues.
Install calicoctl as a binary on a single host (usually the main control-plane node):
Set the file to executable:
Move to local bin dir:
Verify functionality and version: