Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kubernetes: Replace Flannel with Calico

Tags:

kubernetes

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

like image 752
gaetano Avatar asked Nov 26 '19 15:11

gaetano


People also ask

Which is better calico or flannel?

While Flannel is positioned as the simple choice, Calico is best known for its performance, flexibility, and power. Calico takes a more holistic view of networking, concerning itself not only with providing network connectivity between hosts and pods, but also with network security and administration.

Which CNI is best for Kubernetes?

Calico has emerged as one of the most popular CNI plugins for Kubernetes cluster networking. The project has earned a reputation for being reliable, flexible, and supporting highly performant networks for Kubernetes clusters.


1 Answers

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.

like image 142
Mark Watney Avatar answered Sep 28 '22 03:09

Mark Watney