Kubernetes Cluster Deployment on AWS Through KOPS.

Ghazanfar Ali
3 min readJul 31, 2023

--

Kops:

We will use EC2 instance as a linux VM:

We also need s3 bucket to maintain kops state:

Now we will create IAM user with admin access and access keys for AWSCLI:

Create a hosted zone in route 53:

Now we will add ns servers entries in our purchased domain registrar like godaddy:

Now login to ec2 instance and setup everything:

Generate ssh keys on instance also install awscli on it.

Once install awscli then configure it with iam usr access keys:

Now install kubectl and kops on that.

https://kubernetes.io/docs/setup/production-environment/tools/kops/

https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/

Once kops and kubectl installed check the domain:

Now we can run kops command to create kubernetes cluster:

⇒ kops create cluster — name=kubepro.mydevopsstar.com — state=s3://vprofile0-kops-state — zones=us-east-1a,us-east-1b — node-count=2 — node-size=t3.small — master-size=t3.medium — dns-zone=kubepro.mydevopsstar.com — node-volume-size=8 — master-volume-size=8

This command will create conf file for kubernetes cluster and store in s3 bucket.

After few minutes around 15 minutes run command to validate the cluster:

You may face issue in validation if kops version 1.27 is installed then downgrade it to 1.26:

You can also see new instances on master node and 2 worker node and scaling group that created them:

After testing just delete the cluster else AWS will charge for it:

--

--

Ghazanfar Ali
Ghazanfar Ali

Written by Ghazanfar Ali

I write technical blogs on DevOps and AWS, Azure and GCP

No responses yet