A Hassle-Free Guide to set up Disposable Kubernetes Clusters on the fly in under 5 minutes using kind.

Chris Edward Rego
3 min readApr 11, 2022

--

A minimalist guide to set up a Kubernetes Cluster using kind.

What is kind?

kind stands for Kubernetes inside of docker which CLI tool that allows spawning Kubernetes cluster on the fly quickly with no hassle. kind bootstraps all the background activities which involve creating a cluster allows us to create local development & testing Kubernetes cluster.

Installation of kind

As a pre-requisite kind requires docker to be installed on your machine.

Go ahead and install docker on your machine.

https://docs.docker.com/get-docker/

Kind can be installed on major operating systems.

Installation Guide for the following operating systems

https://kind.sigs.k8s.io/docs/user/quick-start/#installation

  1. Mac (brew install kind)
  2. Windows (choco install kind)
  3. Linux

Provisioning clusters using Kind

Let's provision different types of clusters using kind.

1. Provisioning a Simple (Single Node) Cluster

By just specifying the name of the cluster the kind provisions a single node cluster with the latest stable version of Kubernetes & bootstraps all the required components.

kind create cluster --name=my-simple-cluster

Cluster bootstraps all the required components and creates a cluster

In the background Kind provisions a Docker container for the nodes that we provisioned.

2. Provisioning a Multi-Node cluster

Kind allows to spawn a multi-node cluster and specify all the details in the config.

curl https://gist.githubusercontent.com/chrisedrego/4341fbcd9d66d16a4cfbc0ee95baaf03/raw/cc50d06367ab34984bce199e09686cfd83ba8251/multi-worker-kind-cluster.yaml -o multi-node-cluster.yamlkind create cluster --config multi-node-cluster.yaml --name multi-node-cluster
Creates Multi-Node Kubernetes Cluster
Spawns Docker contains which represent individual nodes

3. Provisioning a Multi-Node with additional configuration

Besides specifying the additional nodes we can specify additional configurations such as the following.

  1. Custom Image
  2. KubeAPI-Server details
  3. Extra Port Mappings

More details around (https://kind.sigs.k8s.io/docs/user/configuration/)

curl https://gist.githubusercontent.com/chrisedrego/0c887eb5f34409da6beff3e3fbaf01b6/raw/e3776753c8561b46e1774faf7c966c1061cc77cf/multi-node-cluster-custom.yaml -o multi-node-cluster-custom.yamlkind create cluster --config multi-node-cluster-custom.yaml --name multi-node-cluster-custom

Managing Clusters

kind provides a simple to use cli which allows to create, get, delete clusters

Get Clusters

We can list the available clusters using the following command

kind get clusters

Delete Clusters

We can delete the available clusters using the following command

kind delete cluster --name=my-simple-cluster

“If you found this article useful, feel free to 👏 clap many times or share it with your friends. If you have any doubts regarding the same or anything around the DevOps Space, get in touch with me on Linkedin, Twitter, Instagram.”

--

--

Chris Edward Rego
Chris Edward Rego

Written by Chris Edward Rego

Lead DevSecOps. Talks about Cloud Architecture, DevOps & SRE. For more info check https://www.linkedin.com/in/chrisedrego/

No responses yet