Skip to content

Creating Kubernetes Cluster with KOPSĀ¶

Install AWS CLI

apt update && apt install awscli -y

Configure AWS CLI with IAM user Credentials with specific Region

aws configure

Note

If you are using AWS Instance better to use IAM Role than Creating User with Access-key

Check Whether AWS CLI Commands Working or not

aws s3 ls
Generate SSH Keys
ssh-keygen
Install kubectl binary with curl on Linux Download the latest release with the command:
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
Install kubectl
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
kubectl version --client
Installing Kubernetes with kopsĀ¶ Download the latest release with the command:

curl -LO https://github.com/kubernetes/kops/releases/download/$(curl -s https://api.github.com/repos/kubernetes/kops/releases/latest | grep tag_name | cut -d '"' -f 4)/kops-linux-amd64
curl -LO https://github.com/kubernetes/kops/releases/download/v1.20.0/kops-linux-amd64
Make the kops binary executable
chmod +x kops-linux-amd64
Move the kops binary in to your PATH.
sudo mv kops-linux-amd64 /usr/local/bin/kops
kops
Creating K8s Cluster with KOPS Kops commands to setup k8s cluster: Creating S3 Bucket for Kubernetes Cluster
aws s3 mb s3:// <bucket name>
kops create cluster --name=saiteja.irrinki.xyz --state=s3://<s3 bucket> --zones=ap-south-1a,ap-south-1b --node-count=2 --node-size=t2.micro --master-size=t2.micro --dns-zone=saiteja.irrinki.xyz --node-volume-size=8 --master-volume-size=8
It will create configuration of kops

kops update cluster --name=saiteja.irrinki.xyz --state=s3://<s3 bucket> --yes --admin
It will create kopsdata in S3 bucket. It start creating a cluster & it takes 10 mins
kops validate cluster --name=saiteja.irrinki.xyz --state=s3://<s3 bucket>
It shows ur cluster is ready To Delete Cluster
kops delete cluster --name=saiteja.irrinki.xyz --state=s3://<s3 bucket> --yes