A production-style three-tier application deployed on Amazon EKS using Terraform, Docker, Amazon ECR, Kubernetes, and AWS networking services.
Internet │ ▼ AWS Load Balancer │ ▼ Frontend (React) │ ▼ Backend (Node.js) │ ▼ MongoDB │ ▼ Persistent Storage (EBS)
- AWS
- Amazon EKS
- Terraform
- Kubernetes
- Docker
- Amazon ECR
- AWS VPC
- NAT Gateway
- Application Load Balancer
- IAM
- OIDC
- AWS Load Balancer Controller
- EBS CSI Driver
- MongoDB
- Node.js
- React
- Vite
three-tier-eks/ ├── backend/ │ ├── Dockerfile │ ├── package.json │ ├── server.js │ └── .dockerignore │ ├── frontend/ │ ├── src/ │ │ ├── App.jsx │ │ └── main.jsx │ ├── Dockerfile │ ├── package.json │ ├── index.html │ ├── vite.config.js │ └── .dockerignore │ ├── kubernetes/ │ ├── backend/ │ ├── database/ │ ├── frontend/ │ ├── ingress/ │ └── namespace.yaml │ ├── terraform/ │ ├── vpc.tf │ ├── subnets.tf │ ├── internet.tf │ ├── nat.tf │ ├── security_groups.tf │ ├── iam.tf │ ├── eks.tf │ ├── ecr.tf │ ├── oidc.tf │ ├── alb-controller-iam.tf │ ├── alb-controller-policy.json │ ├── ebs-csi.tf │ ├── provider.tf │ ├── versions.tf │ ├── variables.tf │ └── outputs.tf │ ├── .gitignore └── README.md
Terraform provisions:
- Custom VPC
- Two public subnets
- Two private subnets
- Internet Gateway
- NAT Gateway
- Route tables
- Security groups
- Amazon EKS cluster
- Managed EKS node group
- Amazon ECR repositories
- IAM roles and policies
- OIDC provider
- AWS Load Balancer Controller IAM configuration
- EBS CSI driver configuration
The application consists of three tiers.
React application running inside Kubernetes.
Node.js API responsible for application logic and communication with MongoDB.
MongoDB deployed inside Kubernetes with persistent storage using a PersistentVolumeClaim.
AWS Load Balancer Controller exposes the application through an Application Load Balancer.
Install:
- AWS CLI
- Terraform
- kubectl
- Helm
- Docker
- Git
Configure AWS credentials:
aws configure
Configure the AWS region:
aws configure set region eu-north-1
cd terraform
terraform init
terraform fmt
terraform validate
terraform plan
terraform apply
aws eks update-kubeconfig --region eu-north-1 --name three-tier-eks
Verify the cluster:
kubectl get nodes
Build the backend:
cd backend
docker build -t three-tier-backend .
Build the frontend:
cd frontend
docker build -t three-tier-frontend .
Push the images to Amazon ECR before deploying the Kubernetes workloads.
Create the namespace:
kubectl apply -f kubernetes/namespace.yaml
Deploy MongoDB:
kubectl apply -f kubernetes/database/
Deploy the backend:
kubectl apply -f kubernetes/backend/
Deploy the frontend:
kubectl apply -f kubernetes/frontend/
Deploy the ingress:
kubectl apply -f kubernetes/ingress/
Check pods:
kubectl get pods -A
Check services:
kubectl get svc -A
Check ingress:
kubectl get ingress -A
Check EKS:
aws eks describe-cluster --region eu-north-1 --name three-tier-eks
Check nodes:
kubectl get nodes
Check pods:
kubectl get pods -A
Check deployments:
kubectl get deployments -A
Check services:
kubectl get svc -A
Check ingress:
kubectl get ingress -A
This project creates AWS resources that may incur charges, including:
- NAT Gateway
- EKS control plane
- EC2 worker nodes
- Load Balancer
- EBS volumes
- ECR storage
When finished testing, destroy the infrastructure:
cd terraform
terraform destroy
This project demonstrates practical experience with:
- Infrastructure as Code using Terraform
- AWS networking
- Amazon EKS
- Kubernetes workloads
- Containerization with Docker
- Amazon ECR
- Kubernetes persistent storage
- IAM and OIDC
- AWS Load Balancer Controller
- Kubernetes Ingress
- Three-tier application architecture
Revanth
Built as a hands-on DevOps and Cloud Engineering project.