Manage your personnel kubernetes cluster with this tool

Everton Segur
2 min readAug 24, 2021

In this post I want to bring you a little bit about the kubernetes cluster tool called Kind.

At some point, you and I will want to replicate our cloud environment that uses kubernetes, that’s for sure. However, how can I perform this task in a simple and practical way and still using a service that is easy to manage?

I present Kind, this cli that opens the doors of happiness to have our own kubernetes cluster locally.

As a prerequisite, it is necessary to install docker and kubectl to access the kubernetes cluster later.

The installation of services follows below:

After performing the installation, we will now install the kubernetes cluster.

sudo chown $(whoami) /var/run/docker.sock
sudo curl -Lo ./kind
sudo chmod +x ./kind
sudo mv ./kind /usr/bin/kind

Creating a new cluster is also quick:

kind create cluster

Since we now have our cluster available, let’s deploy a hello-world pod for testing.

kubectl run hello-kubernetes --rm --tty -i --restart='Never' --namespace default --image

After performing the test and validating the operation, we will configure the exposure of the next services that will be made available in the cluster.

kubectl apply -f
kubectl create secret generic -n metallb-system memberlist --from-literal=secretkey="$(openssl rand -base64 128)"
kubectl apply -f
kubectl apply -f

These settings are responsible for always providing an accessible external ip and a respective port when exposed by the kubernetes services.

Now we will enable the communication route from the network interface to the kubernetes service, as this makes access easier.

sudo ip route add via $(docker inspect -f '{{range .NetworkSettings.Networks}}{{.Gateway}}{{end}}' kind-control-plane)

Let’s test?

Deployment creation:

kubectl apply -f
kubectl get pods -l run=my-nginx -o wide

Service creation:

kubectl expose deployment/my-nginx --type=LoadBalancer
kubectl get svc my-nginx -o wide

Now the test:


Got been tired? Erase everything:

kind delete cluster

A little more

To import your docker images into kind use this syntax:

kind load docker-image your-docker-image-name:desired-version

About me

I am currently a Java developer at ZUP IT, a company that develops several market tools that help devs and infra staff. I have a background focused on infrastructure, you can follow me on linkedin