appendix-c

appendix C Installing a CNI in a kind cluster

 

This appendix shows you how to install a new container network interface (CNI) in your Kubernetes in Docker (kind) cluster. We’ll install Flannel and Calico, which are both used for the CKA exam, going step by step through the process of doing 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-no -kindnet.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.32.2 --config config-no-kindnet.yaml to create a kind cluster according to the configuration we specified in the config config-no-kindnet.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