This project demonstrates the deployment of a Three-Tier Web Application using ReactJS, NodeJS, and MongoDB, on AWS EKS.
The application consists of:
- A frontend microservice written using ReactJS
- A backend microservice written using NodeJS
- Data is stored in MongoDB
- AWS CLI configured with appropriate credentials
- AWS eksctl
- Helm
- Kubectl
.
├── docker-compose/
├── backend-app/
├── frontend-app/
├── manifests/
│ ├── backend/
│ ├── frontend/
│ ├── mongodb/
└── README.md
- Clone this repository
- Navigate to the project directory
- Setup EKS cluster
eksctl create cluster --name <cluster_name> --region <region> --node-type t2.medium --nodes-min 2 --nodes-max 5
aws eks update-kubeconfig --region <region> --name <cluster_name>
kubectl get nodes
-
Configure IAM OIDC provider
eksctl utils associate-iam-oidc-provider --cluster <cluster_name> --approve
-
Download IAM policy
curl -O https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.11.0/docs/install/iam_policy.json
-
Create IAM Policy
aws iam create-policy \ --policy-name AWSLoadBalancerControllerIAMPolicy \ --policy-document file://iam_policy.json
-
Create IAM Role and service account. Also, attach IAM Role to service account.
eksctl create iamserviceaccount \ --cluster=<cluster-name> \ --namespace=kube-system \ --name=aws-load-balancer-controller \ --role-name AmazonEKSLoadBalancerControllerRole \ --attach-policy-arn=arn:aws:iam::<aws-account-id>:policy/AWSLoadBalancerControllerIAMPolicy \ --approve
-
Add helm repo to deploy ALB controller
helm repo add eks https://aws.github.io/eks-charts
-
Update the repo
helm repo update eks
-
Install the repo
helm install aws-load-balancer-controller eks/aws-load-balancer-controller \
-n kube-system \
--set clusterName=<cluster-name> \
--set serviceAccount.create=false \
--set serviceAccount.name=aws-load-balancer-controller \
--set region=<region> \
--set vpcId=<vpc-id>
To delete the EKS cluster:
eksctl delete cluster --name <cluster-name> --region <region>