A production-ready full-stack web application,
with (React frontend + Node.js backend + MongoDB Database),
deployed on AWS EKS using Kubernetes and exposed via NGINX Ingress Controller.
- AWS account
- IAM Configuration
- Create a user
eks-adminwithAdministratorAccess. - Generate Security Credentials:
Access KeyandSecret Access Key.
- Create a user
- Basic Docker and Kubernetes knowledge
Figure: High-level architecture showing React frontend, Node.js backend, and MongoDB database deployed on AWS EKS with NGINX Ingress Controller.
Note: This Bastion Host is not the part of EKS cluster, but we will use this instance to install neccessay configuration and EKS cluster.
Do these below steps in Bastion Host
-
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" sudo apt install unzip unzip awscliv2.zip sudo ./aws/install -i /usr/local/aws-cli -b /usr/local/bin --update aws configure -
sudo apt-get update sudo apt install docker.io docker ps sudo chown $USER /var/run/docker.sock -
curl -o kubectl https://amazon-eks.s3.us-west-2.amazonaws.com/1.19.6/2021-01-05/bin/linux/amd64/kubectl chmod +x ./kubectl sudo mv ./kubectl /usr/local/bin kubectl version --short --client -
curl --silent --location "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz" | tar xz -C /tmp sudo mv /tmp/eksctl /usr/local/bin eksctl version -
eksctl create cluster --name three-tier-cluster --region ap-south-1 --node-type t2.medium --nodes-min 2 --nodes-max 2 aws eks update-kubeconfig --region us-west-2 --name three-tier-cluster kubectl get nodesgit clone <your-repo-url> cd <repo-directory>
kubectl apply -f .kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.11.1/deploy/static/provider/aws/deploy.yaml
kubectl get svc -n ingress-nginx nslookup <external-ip>
Add the following line to your
/etc/hostsfile:<external-ip> your-app-domain.comOpen your browser and navigate to:
http://your-app-domain.comDeleting cluster
eksctl delete cluster --name three-tier-cluster --region ap-south-1
