I built a comprehensive user management app with Node.js and MySQL, then deployed it on AWS using multiple approaches. The project now includes a complete CI/CD pipeline, multiple deployment methods, and professional repository structure using git submodules.
- Local Docker (
localhost:3000) - For local development with local MySQL - EKS Port-Forward (
localhost:8080) - Local access to cloud deployment - Public URL -
http://af2297c2cfb804d858ad1ac92e392174-1808336492.us-east-1.elb.amazonaws.com(Deprecated due to cost purposes)
- Full CRUD functionality - Add, view, and delete users
- CI/CD Pipeline - Automatic deployment on code changes
- Multiple deployment methods - Docker, EKS, and public access
- Professional repository structure - Git submodules for clean separation
- Auto port-forward script - Seamless local development
- Health checks - Automated deployment verification
π nodejs-eks-infrastructure/
βββ π Documentation
β βββ README.md # This file
β βββ DEPLOYMENT_GUIDE.md # Comprehensive deployment guide
β βββ KUBERNETES_INFRASTRUCTURE.md # K8s architecture details
β βββ TERRAFORM_ARCHITECTURE.md # Infrastructure documentation
βββ π§ scripts/ # Deployment and management scripts
β βββ deploy-simple.sh # Simple EC2+RDS deployment (~$17/month)
β βββ deploy-full-eks.sh # Full EKS deployment (~$127/month)
β βββ destroy-all.sh # Destroy all infrastructure
β βββ destroy-simple.sh # Destroy simple setup
β βββ status.sh # Check resource status and costs
β βββ quick-demo.sh # Quick demo script
βββ ποΈ terraform/ # Infrastructure as Code
β βββ eks/ # EKS cluster setup
β β βββ main.tf # Cluster configuration
β β βββ vpc.tf # VPC and networking
β β βββ node-groups.tf # Worker nodes
β β βββ outputs.tf # Cluster outputs
β βββ k8s-manifests/ # Kubernetes configurations
β β βββ namespace.yaml # Application namespace
β β βββ deployment.yaml # App deployment
β β βββ service.yaml # Load balancer service
β β βββ configmap.yaml # App configuration
β β βββ secret.yaml # Database credentials
β βββ ec2.tf # EC2 configuration
β βββ rds.tf # Database setup
β βββ s3.tf # Storage bucket
β βββ variables.tf # Terraform variables
βββ π± app/ (submodule) # Node.js application
βββ public/ # Frontend files
βββ server.js # Node.js backend with CRUD APIs
βββ package.json # Dependencies
βββ Dockerfile # Container setup
βββ .github/workflows/ # CI/CD pipeline
- π Documentation: Comprehensive guides and architecture details
- π§ Scripts: One-command deployment and management tools
- ποΈ Infrastructure: Complete Terraform configuration for AWS
- π± Application: Node.js app with CI/CD pipeline (git submodule)
It's a comprehensive user management system with full CRUD functionality:
Frontend: Modern HTML/CSS/JS interface with real-time updates Backend: Express.js server with RESTful API endpoints Database: RDS MySQL instance with proper data persistence
GET /- Main application pageGET /users- Returns all users (JSON)POST /users- Adds a new userDELETE /users/:id- Deletes a user by ID
- Add User Form - Name and email input with validation
- User Table - Displays all users with real-time updates
- Delete Functionality - Remove users with confirmation
- Success/Error Messages - User feedback for all operations
- Responsive Design - Works on desktop and mobile
The app demonstrates modern web development practices with a clean separation between frontend and backend.
Here's what I set up:
EKS Cluster: Managed Kubernetes service running the containerized app RDS MySQL: Managed database (db.t3.micro) with automated backups VPC: Custom network with public/private subnets for security Load Balancer: AWS ALB for external access to the application S3 Bucket: Stores static assets like images
I kept the original EC2 setup (t2.micro) for comparison, but the main deployment is now on EKS. The networking part was tricky at first - I had to figure out how to connect the EKS pods to the RDS instance across different VPCs.
Here's how the traffic flows:
π USER BROWSER
β
β 1. HTTP Request
βΌ
βββββββββββββββ
β AWS LOAD β
β BALANCER β
βββββββ¬ββββββββ
β 2. Health Check
βΌ
βββββββββββββββ
β EKS SERVICE β
β (Port 80) β
βββββββ¬ββββββββ
β 3. Load Balance
βΌ
βββββββββββββββ
β NODE.JS POD β
β (Port 3000) β
βββββββ¬ββββββββ
β 4. Database Query
βΌ
βββββββββββββββ
β RDS MYSQL β
β (Port 3306) β
βββββββββββββββ
I defined all the AWS infrastructure in Terraform files, which was really helpful for learning. The main components are:
EKS Configuration (terraform/eks/): Sets up the Kubernetes cluster, VPC, subnets, and worker nodes
Database (rds.tf): Creates the RDS MySQL instance with proper security groups
Storage (s3.tf): Creates S3 bucket for static assets
EC2 (ec2.tf): Original single-instance setup (kept for reference)
What I really liked about using Terraform is that I can recreate the entire infrastructure from scratch, and all changes are tracked in version control without being on the AWS console.
The project includes a complete CI/CD pipeline using GitHub Actions:
- Code Push - Changes pushed to the app repository
- Docker Build - GitHub Actions builds the Docker image
- Image Push - New image pushed to Docker Hub
- EKS Deployment - Kubernetes deployment automatically restarted
- Health Check - Verification that deployment succeeded
- β Multi-platform builds (linux/amd64 for EKS compatibility)
- β Docker layer caching for faster builds
- β Rolling deployments with zero downtime
- β Health checks to ensure deployment success
- β Automatic rollback on deployment failure
I've created scripts to make deployment super easy! Choose your preferred setup:
./scripts/deploy-full-eks.sh- Cost: ~$127/month
- Time: 10-15 minutes
- Features: EKS cluster, load balancer, auto-scaling, full Kubernetes
- Best for: Demonstrating enterprise DevOps skills
./scripts/deploy-simple.sh- Cost: ~$17/month
- Time: 3-5 minutes
- Features: EC2 + RDS + S3, direct deployment
- Best for: Learning and demos
./scripts/destroy-all.sh # Destroys everything
./scripts/destroy-simple.sh # Destroys only simple setup
./scripts/cleanup-orphaned-resources.sh # Clean up orphaned resources- Run
terraform planto see what will be created - Run
terraform applyto create the infrastructure - Deploy the app to EKS using the Kubernetes manifests
- Make changes in the app repository
- Push to GitHub - CI/CD pipeline triggers automatically
- Monitor deployment in GitHub Actions
- Access updated app via any of the three methods
# Check if pods are running
kubectl get pods -n nodejs-app
# Check service status
kubectl get services -n nodejs-app
# View deployment status
kubectl get deployments -n nodejs-app
# Check logs
kubectl logs -n nodejs-app -l app=nodejs-app# Start local Docker container
cd 06_project/app
docker run -d -p 3000:3000 --name terraform-eks-infra \
-e DB_HOST=host.docker.internal \
-e DB_USER=root \
-e DB_PASS=your_password \
-e DB_NAME=arav_demo \
-e TABLE_NAME=users \
-e PORT=3000 \
nodejs-mysql-app# Manual port-forward
kubectl port-forward -n nodejs-app service/nodejs-service 8080:80
# Auto-restart port-forward (recommended)
cd 06_project && ./auto-port-forward.sh- Direct access:
http://af2297c2cfb804d858ad1ac92e392174-1808336492.us-east-1.elb.amazonaws.com - Always up-to-date with latest deployments
- No setup required
# Test main page
curl http://localhost:8080
# Get all users
curl http://localhost:8080/users
# Add a new user
curl -X POST http://localhost:8080/users \
-H "Content-Type: application/json" \
-d '{"name":"John Doe","email":"john@example.com"}'
# Delete a user
curl -X DELETE http://localhost:8080/users/1This project evolved from a simple deployment to a comprehensive DevOps pipeline. Here are the key challenges and solutions:
-
Architecture mismatch: Docker image built for ARM64 but EKS nodes were x86_64
- Solution: Used
docker buildxwith--platform linux/amd64
- Solution: Used
-
Network connectivity: EKS cluster in different VPC than RDS
- Solution: Updated RDS security groups to allow EKS VPC traffic
-
Port-forward reliability: Connection lost during deployments
- Solution: Created auto-restart script for seamless development
-
Repository structure: Managing app and infrastructure code
- Solution: Implemented git submodules for clean separation
- Container Orchestration: Kubernetes pods, services, deployments, namespaces
- CI/CD Pipelines: GitHub Actions with automated testing and deployment
- Infrastructure as Code: Terraform for reproducible infrastructure
- Git Submodules: Professional repository management
- Multi-environment deployment: Local, staging, and production access
- Health checks: Automated deployment verification
- Rolling deployments: Zero-downtime updates
- Separation of concerns between app and infrastructure code
- Automation reduces deployment errors and saves time
- Multiple access methods improve development workflow
- Professional practices make projects more maintainable
I've optimized the project for different use cases:
- All infrastructure destroyed to save money
- Use deployment scripts to bring back what you need
- NEW: Comprehensive cleanup script to remove orphaned resources
- EC2 t2.micro: $8.50/month (1 vCPU, 1GB RAM)
- RDS db.t2.micro: $8.50/month (1 vCPU, 1GB RAM)
- S3: ~$0.50/month (minimal usage)
- EKS Control Plane: $73/month (always running)
- 1x t3.small worker node: $15/month
- Load Balancer: $18/month
- EC2 t2.micro: $8.50/month
- RDS db.t2.micro: $8.50/month
- S3: ~$0.50/month
- Use simple setup for learning and demos
- Destroy when not needed - scripts make it easy to recreate
- EKS is expensive - only use for enterprise demos
- Both setups use t2.micro - consistent and cost-effective
- Run cleanup script if you're still being charged after destroying
This project now demonstrates enterprise-level DevOps practices:
- CI/CD Pipeline - Automated deployment with GitHub Actions
- Git Submodules - Professional repository structure
- Multi-environment access - Local, staging, and production
- Health checks - Automated deployment verification
- Rolling deployments - Zero-downtime updates
- Container orchestration - Kubernetes best practices
- Infrastructure as Code - Complete Terraform automation
- Monitoring - Prometheus/Grafana for observability
- Security - RBAC, network policies, secrets management
- Multi-environment - Separate dev/staging/prod clusters
- Blue-green deployments - Advanced deployment strategies
- Service mesh - Istio for microservices communication
This project showcases:
- Full-stack development - Frontend, backend, and database
- Cloud architecture - AWS services integration
- DevOps practices - CI/CD, IaC, containerization
- Professional workflow - Git submodules, automated testing
- Problem-solving - Real challenges and solutions
- Modern technologies - Kubernetes, Docker, Terraform
Perfect for demonstrating comprehensive DevOps and cloud engineering skills! π