Kind : A New Kubernetes Cluster

Kind : A New Kubernetes Cluster

Kind is a command-line tool that helps you to create a local Kubernetes cluster using Docker images and it mimics a Kubernetes cluster on your local system.

In this article, I would be talking about my experiences with a new local Kubernetes cluster call Kind.

Recently I wanted to experiment with something on a Kubernetes cluster, and I didn’t want to spin up a new cluster on AWS and wanted something quick.

Till now, Minikube was the only thing I was using as a local Kubernetes cluster. But I start noticing performance degradation on my system as soon as I started using Minikube.

I came across another local Kubernetes cluster called Kind and I want to share my learnings about it.

Introduction

Kind is a command-line tool that helps you to create a local Kubernetes cluster. It creates a cluster using Docker images and it mimics a Kubernetes cluster on your local system.

Minikube vs. Kind

The latest version of Minikube uses docker images to create the cluster, But it requires at least 1.8 GB of memory to start. With Kind, I could start the cluster with just 1 GB and could deploy a simple pod that hardly consumed 200 MB of memory.


Creating a Cluster

To create a cluster just run the following command:

Kind create cluster



Multi-Node Cluster

This feature was fascinating to me, If you want to create a multi-node cluster, you can provide a config to create it.

Kind create cluster --config config.yml

Let’s have a look at the config.

kind: Cluster

apiVersion: kind.x-k8s.io/v1alpha4

nodes:

 — role: control-plane

 — role: worker

 — role: worker

I have asked it to create a cluster with a control plane and two worker nodes in this config.

Now, you can further customize this to map node ports to your host port. This would be helpful in a situation wherein say you have NodePort service, and you want to access it directly from your local system.

kind: Cluster

apiVersion: kind.x-k8s.io/v1alpha4

nodes:

  - role: control-plane

  - role: worker

    extraPortMappings:

    - containerPort: 80

      hostPort: 8080

Custom Worker Node Images

Since Kind works with docker images, you can specify a custom docker image that you would like to run. Currently, it uses the docker images provided by kind. This means you can provide a specific version of Kubernetes that you would like to run, just by changing the image tag. You can find all the Kind images here.

kind: Cluster

apiVersion: kind.x-k8s.io/v1alpha4

nodes:

  - role: control-plane

  - role: worker

    image: kindest/node:v1.16.4

Auto-Completion

Kind also provides functions that will allow your terminal to autocomplete your commands. This depends on the shell you use. Currently, it supports functions for Bash, ZSH (also oh-myzsh), and Fish shell. You can get these functions by using the following command.

kind completion zsh


If you want to know more on how to configure auto-completion with ZSH you can refer to the repo documentation here.

Conclusion

After exploring Kind, I found it pretty simple and straightforward. The major benefit I found is that I can customize the cluster’s configuration the way I want and I don’t have to worry about performance degrade compared to Minikube.

ZippyOPS Provide consulting, implementation, and management services on DevOps, DevSecOps, Cloud, Automated Ops, Microservices, Infrastructure, DataOPS, and Security

Services offered by us: https://www.zippyops.com/services

Our Products: https://www.zippyops.com/products

Our Solutions: https://www.zippyops.com/solutions

For Demo, videos check out YouTube Playlist: 

https://www.youtube.com/watch?v=4FYvPooN_Tg&list=PLCJ3JpanNyCfXlHahZhYgJH9-rV6ouPro


Relevant Blogs:





Recent Comments

No comments

Leave a Comment