Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

Three Tier Architecture Project Design, Architecture and Deployment on AWS EKS.

https://github.com/iam-veeramalla/three-tier-architecture-demo/tree/master/EKS

https://www.youtube.com/watch?v=8T0UnSgywzY

AWS AccessKey ID- AKIAUAOM4X(modified)

AWS Secret Key - 7Nu+Qnp8afT/yTrlDz/BEP0RHyR(modified)

Prerequisites- eksctl, awscli, kubectl

1. Install kubectl

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

2. Install Eksctl
# Download the latest release
curl --silent --location
"https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -
s)_amd64.tar.gz" | tar xz -C /tmp

# Move the binary to a directory in your PATH


sudo mv /tmp/eksctl /usr/local/bin

Lab

1. Create EKS cluster using Fargate use below command

eksctl create cluster --name demo-cluster-three-tier-robo1 --region ap-south-1

to delete
eksctl delete cluster --name demo-cluster-three-tier-robo1 --region ap-south-1
commands to configure IAM OIDC
provider
export cluster_name=demo-cluster-three-tier-robo1
oidc_id=$(aws eks describe-cluster --name $cluster_name --query
"cluster.identity.oidc.issuer" --output text | cut -d '/' -f 5)

aws iam list-open-id-connect-providers | grep $oidc_id | cut -d "/" -f4


eksctl utils associate-iam-oidc-provider --cluster $cluster_name --approve

setup alb add on


Download IAM policy

curl -O https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-
controller/v2.5.4/docs/install/iam_policy.json

aws iam create-policy \

--policy-name AWSLoadBalancerControllerIAMPolicy \

--policy-document file://iam_policy.json
eksctl create iamserviceaccount \

--cluster=demo-cluster-three-tier-robo1 \

--namespace=kube-system \

--name=aws-load-balancer-controller \

--role-name AmazonEKSLoadBalancerControllerRole \

--attach-policy-arn=arn:aws:iam::275844480429:policy/AWSLoadBalancerControllerIAMPolicy \

--approve

Install Helm
curl -fsSL -o get_helm.sh
https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh

helm repo add eks https://aws.github.io/eks-charts


helm repo update eks

helm install aws-load-balancer-controller eks/aws-load-balancer-controller -n kube-system \

--set clusterName=demo-cluster-three-tier-robo1 \

--set serviceAccount.create=false \

--set serviceAccount.name=aws-load-balancer-controller \

--set region=ap-south-1 \

--set vpcId=vpc-08d56f0f04d3029dc

kubectl get deployment -n kube-system aws-load-balancer-controller

EBS CSI Plugin configuration

eksctl create iamserviceaccount \

--name ebs-csi-controller-sa \

--namespace kube-system \

--cluster demo-cluster-three-tier-robo1 \
--role-name AmazonEKS_EBS_CSI_DriverRole \

--role-only \

--attach-policy-arn arn:aws:iam::aws:policy/service-role/AmazonEBSCSIDriverPolicy \

--approve

eksctl create addon --name aws-ebs-csi-driver --cluster demo-cluster-three-tier-robo1 --service-


account-role-arn arn:aws:iam::275844480429:role/AmazonEKS_EBS_CSI_DriverRole --force
After 2min all pods are up and running

You might also like