Skip to main content

Command Palette

Search for a command to run...

Kubernetes Cluster with Kind

Creating a Kubernetes cluster for local use with Kind

Updated
β€’2 min read
Kubernetes Cluster with Kind
H

I am a system engineer with many years of experience how Backend Developer in Java/Go, Devops, Kubernetes and Linux OS Interest on new technologies, open sources projects

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

Kubernetes

Part 1 of 3

in this series, I will write about how to use kubernetes for local development, testing & make local labs

Up next

Interacting with a Kubernetes Cluster - Kind

Interacting with your Kubernetes cluster with Kind