Skip to main content

Command Palette

Search for a command to run...

Setting up Kind cluster

Updated
2 min read
Setting up Kind cluster

In this post, I will talk about setting up a multi-node kind cluster on a Linux (Ubuntu 22.04) host.

Install Kind

Execute the below script on the host to install kind command on the host. This script has been inspired from Kind installation

#!/bin/bash

# For AMD64 / x86_64
[ $(uname -m) = x86_64 ] && curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.20.0/kind-linux-amd64
chmod +x ./kind
sudo cp ./kind /usr/local/bin/kind
rm -rf kind

After the above script is executed on the host, kind command will be accessible on the host.

#check kind version
kind --version

Bring up a multi node cluster

Create a config file (`config.yml`) with the below content:
We are creating 1 control plane and one worker plane

create new cluster yaml file name : cluster-config.yaml

kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
  - role: control-plane
    image: kindest/node:v1.33.0
  - role: worker
    image: kindest/node:v1.33.0

Now start 2 node cluster (1 control plane and one worker plane)

kind create cluster --config=cluster-config.yaml

Check the cluster status:

Using kind based command:

kind get clusters

Using kubectl based command. If you do not have kubectl installed, please refer to install kubectl linux to install it:

kubectl cluster-info

Using docker based command. It is worthwhile to note that all the nodes (control-plane and worker) comprising your cluster will be running as docker containers on your host. This can be easily deduced from the output of the below command:

docker ps

Check the status of each node on the cluster:

Check current nodes in the cluster

kubectl get no
or
kubectl get nodes

Check the version of the cluster vs the version of the cluster client (kubectl)

kubectl version

From the output of the above command, we can see that the cluster is running on version 1.33.0, whereas the client is on 1.33.0.

Takeaway

  • We saw that kind runs each Kubernetes node as a docker container within our host. A host could be a physical machine/VM.

  • It is important to emphasize that kind is not designed to support production grade Kubernetes cluster.

  • A production grade cluster would have the different nodes spread across multiple host.

  • However, setting up a production grade cluster is out of kind’s scope. It is only meant for local testing. This topic has been extensively discussed at multi machine kind cluster

Follow for many such contents:

LinkedIn: linkedin.com/in/dushyant-kumar-dk

Blog: dashboard-blog-link