Appendix C. Installing a CNI in a kind cluster

 

This appendix shows you how to install a new CNI in your kind cluster. We’ll install Flannel and Calico, which are both used for the CKA exam, going through the process step by step on how to do this within a kind cluster. This involves creating the kind cluster without a CNI, installing the bridge CNI plugin, and then installing either Flannel or Calico.

C.1 Creating a kind cluster without CNI

Before we create a kind Kubernetes cluster, we must first create a YAML file that we can use as an input with the kind create command. Create a file named config.yaml and paste it in the contents like this:

kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
networking:
  disableDefaultCNI: true
nodes:
role: control-plane
role: worker

Now run the command kind create cluster --image kindest/node:v1.25.0-beta.0 --config config.yaml to create a kind cluster according to the configuration we specified in the config.yaml file. The output will look similar to this:

C.2 Installing a bridge CNI plugin

C.3 Installing Flannel CNI

C.4 Creating a new kind cluster

C.5 Installing the Calico CNI