Kubernetes: Replace Flannel with Calico

11/26/2019

I am new to Kubernetes and I would like to try different CNI.

In my current Cluster, I am using Flannel

Now, I would like to use Calico but I cannot find a proper guide to clean up Flannel and install Calico.

Could you please point out the correct procedure?

Thanks

-- gaetano
kubernetes

1 Answer

11/27/2019

Calico provides a migration tool that performs a rolling update of the nodes in the cluster. At the end, you will have a fully-functional Calico cluster using VXLAN networking between pods.

From the documentation we have:

Procedure

1 - First, install Calico.

kubectl apply -f https://docs.projectcalico.org/v3.10/manifests/flannel-migration/calico.yaml

Then, install the migration controller to initiate the migration.

kubectl apply -f https://docs.projectcalico.org/v3.10/manifests/flannel-migration/migration-job.yaml

Once applied, you will see nodes begin to update one at a time.

2 - To monitor the migration, run the following command.

kubectl get jobs -n kube-system flannel-migration

The migration controller may be rescheduled several times during the migration when the node hosting it is upgraded. The installation is complete when the output of the above command shows 1/1 completions. For example:

NAME                COMPLETIONS   DURATION   AGE
flannel-migration   1/1           2m59s      5m9s

3 - After completion, delete the migration controller with the following command.

kubectl delete -f https://docs.projectcalico.org/v3.10/manifests/flannel-migration/migration-job.yaml

To know more about it: Migrating a cluster from flannel to Calico

This article describes how migrate an existing Kubernetes cluster with flannel networking to use Calico networking.

-- mWatney
Source: StackOverflow