DEV Community

Rajit Paul
Rajit Paul

Posted on • Updated on

Setup KinD (Kubernetes In Docker) on Amazon EC2

Install Docker on Linux -

As I'm using an Amazon Linux I can install docker with a
yum install docker -y
Image description
Start docker service - systemctl start docker

For Docker Installations -

Install Go -

Go to
Copy the link of go tarfile for linux platform
Install using wget
Image description
Extract it using tar zxf go1.17.7.linux-amd64.tar.gz -C /usr/local

  • Add /usr/local/go/bin to the PATH variable.

Install KinD

go install
You can replace v0.11.1 with the latest stable kind version

Move the KinD Binary to /usr/local/bin -

  • You can find the kind binary inside the directory go/bin
  • Move it to /usr/local/bin - mv go/bin/kind /usr/local/bin
  • Make sure you have a path setup for /usr/local/bin

Install Latest Version of Kubectl:

curl -LO "$(curl -L -s"
chmod +x kubectl
mv kubectl /usr/local/bin

Create a cluster with kind

kind create cluster --name labcluster
Image description
kubectl get nodes -o wide
Image description
docker ps
Image description

You are now running KinD successfully in Linux
Once done you can delete the cluster using
kind delete cluster

Multi-Node Cluster -

Create a config file kind-example-config.yaml
kind: Cluster

  • role: control-plane
  • role: worker
  • role: worker

kind create cluster --config kind-cluster-config.yaml
Image description

You now have a running KinD Cluster with one master and two worker nodes.
kubectl get nodes -o wide
Image description

Top comments (2)

garvitjoshi profile image
Garvit Joshi

Nice Explanation!

rajitpaul profile image
Rajit Paul

Thanks bhai