Creating EKS cluster with eksctl and deploying a two-tier application

Creating EKS cluster with eksctl and deploying a two-tier  application

Table of contents

No heading

No headings in the article.

Prerequisite:

1.Setup EC2 server in AWS with awscli, kubectl and eksctl.

2.Create eksctlrole in IAM and attach EC2FullAccess, AWSCloudFormation Full Access, IAM Full Access. Attach the created eksctlrole role to your Ec2 server run eksctl command .AmazonS3FullAccess

  1. AmazonEC2FullAccess

  2. AmazonRoute53FullAccess

  3. IAMFullAccess

  4. AmazonVPCFullAccess

Steps :

  1. Step1: AWS CLI Installation on the EC2 instance

curl "awscli.amazonaws.com/awscli-exe-linux-x86_6.." -o "awscliv2.zip"

unzip awscliv2.zip

sudo ./aws/install

/usr/local/bin/aws --version

Link for reference : https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html

  1. Step2: Kubectl Installation

    curl -O s3.us-west-2.amazonaws.com/amazon-eks/1.26...

chmod +x ./kubectl

mv kubectl /usr/local/bin

Link for reference : https://docs.aws.amazon.com/eks/latest/userguide/install-kubectl.html

  1. Step3: EKS installation

    curl --silent --location "[[github.com/weaveworks/eksctl/releases/lates](github.com/weaveworks/eksctl/releases/lates....](github.com/weaveworks/eksctl/releases/lates.. -s)_amd64.tar.gz" | tar xz -C /tmp

    cd /tmp

    mv eksctl /usr/local/bin

    eksctl version

    PATH=$PATH:/usr/local/bin;export PATH echo 'export PATH=$HOME/bin:$PATH' >> ~/.bashrc

    Link for reference : https://docs.aws.amazon.com/eks/latest/userguide/getting-started-eksctl.html

  2. Step4: EKS Cluster Setup

    Use eksctl to create the EKS cluster

    eksctl create cluster --name <cluster-name> --region <region> --node-type t2.micro --nodes-min 2 --nodes-max 2

  3. Update the kubeconfig to connect to the newly created EKS cluster

    aws eks update-kubeconfig --region <region> --name <cluster-name>

Verify node

kubectl get nodes

You can clone the code with git clone and deploy with using kubectl apply -f command. I have covered this part in details in last blog.

Thank you!