Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Rajit Paul
Rajit Paul

Posted on • Edited 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 -https://docs.docker.com/engine/install/

Install Go -

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

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

Install KinD

go install sigs.k8s.io/kind@v0.11.1
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 "https://dl.k8s.io/release/$(curl -L -shttps://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
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
apiVersion: kind.x-k8s.io/v1alpha4
nodes:

  • 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)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss
CollapseExpand
 
garvitjoshi profile image
Garvit Joshi
  • Joined

Nice Explanation!

CollapseExpand
 
rajitpaul profile image
Rajit Paul
DevSecOps@IshaFoundation, AWS Community Builder
  • Location
    Kolkata, India
  • Joined

Thanks bhai

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

DevSecOps@IshaFoundation, AWS Community Builder
  • Location
    Kolkata, India
  • Joined

More fromRajit Paul

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp