Kubernetes Cluster with Kind

Kubernetes Cluster with Kind

Creating a Kubernetes cluster for local use with Kind

ยท

2 min read

Introduction

In this article, I will show you how you can create a Kubernetes (k8s) cluster using the tool Kind. Kind is a tool that uses docker to create the cluster nodes that may be used for local development or CI, to know more about it, you can go to the Kind official page.

Environment

  • Linux Mint 20.2
  • Docker version 20.10.12, build e91ed57

Install

To use Kind, we need to have installed Docker, How to install Docker.

After installing Docker or if already you had installed it, you need to check if the docker daemon is installed and running.

docker info

Now you can install Kind using the steps in the Kind official docs in the install section.

This my case, I used the steps for Homebrew:

brew install kind

After that, we can check the Kind installation with this command

kind version

You should see something like this kind v0.11.1 go1.16.4 linux/amd64

Creating a K8s Cluster

To create a k8s cluster with kind with a basic configuration you can execute this command

kind create cluster

Output:

$ kind create cluster 
Creating cluster "kind" ...
 โœ“ Ensuring node image (kindest/node:v1.21.1) ๐Ÿ–ผ
 โœ“ Preparing nodes ๐Ÿ“ฆ  
 โœ“ Writing configuration ๐Ÿ“œ 
 โœ“ Starting control-plane ๐Ÿ•น๏ธ 
 โœ“ Installing CNI ๐Ÿ”Œ 
 โœ“ Installing StorageClass ๐Ÿ’พ 
Set kubectl context to "kind-kind"
You can now use your cluster with:

kubectl cluster-info --context kind-kind

Have a nice day! ๐Ÿ‘‹

It is all, you created a k8s cluster with basic kind config, to check your cluster you can use

kind get clusters

to see your cluster name and

kind get nodes

to list nodes' names.

Output:

$ kind get clusters
kind

$ kind get nodes     
kind-control-plane

Now you can use kubectl command to interact with your cluster. To see how to install kubectl please see this documentation install kubectl

References

ย