This project demonstrates an end-to-end DevOps workflow covering application development, containerization, CI/CD automation, and Kubernetes deployment on AWS EKS.
The objective was to build a production-style setup with clear separation between Continuous Integration (CI) and Continuous Deployment (CD), following cloud-native and container best practices.
Frontend
- Next.js application
- Communicates with backend via REST APIs
Backend
- Python FastAPI application
- Exposes health and message endpoints
Containerization
- Multi-stage Docker builds
- Non-root containers
- Optimized image sizes
CI/CD
- GitHub Actions
- CI on
developbranch - CD on
mainbranch
Orchestration
- Kubernetes on AWS EKS
- Built using FastAPI
- Endpoints:
GET /api/healthGET /api/message
- Unit tests written using
pytest - Dockerized using a multi-stage Dockerfile
- Built using Next.js
- Uses environment variables via
NEXT_PUBLIC_API_URL - Dockerized using a multi-stage build
- Served through a Kubernetes Service
Triggered on every push to the develop branch:
- Checkout source code
- Install dependencies
- Run backend unit tests
- Build Docker images
- Tag images using Git SHA
- Push images to AWS ECR
Triggered on merge to the main branch:
- Authenticate with AWS
- Update kubeconfig for EKS
- Deploy images to Kubernetes
- Perform rolling updates using
kubectl set image
Resources used:
- Deployments for frontend and backend
- Services:
- Backend:
ClusterIP - Frontend:
NodePort
- Backend:
- Ingress rules for routing
/and/api
An NGINX Ingress Controller was installed and Ingress rules were defined. However, AWS LoadBalancer provisioning could not be completed due to missing VPC subnet tags (kubernetes.io/role/elb / kubernetes.io/role/internal-elb). NodePort access was used for validation.
- Designed multi-stage Dockerfiles for frontend and backend to separate build and runtime concerns
- Executed backend unit tests inside Docker build stage to fail fast on errors
- Configured containers to run as non-root users for security best practices
- Implemented branch-based CI/CD using GitHub Actions (CI on develop, CD on main)
- Used Git commit SHA-based Docker image tagging for traceability
- Integrated AWS ECR authentication securely using GitHub Secrets
- Deployed applications to AWS EKS with rolling updates
- Used ClusterIP for internal backend communication and NodePort for frontend validation
- Defined Ingress routing rules for frontend and backend paths
- Debugged AWS LoadBalancer issues by inspecting Kubernetes events and subnet tags
- Applied layered debugging: Pod → Service → DNS → NodePort → Ingress
- Used ephemeral debug pods instead of modifying production containers
- Identified build-time vs runtime environment variable behavior in Next.js
- Performed complete cloud resource cleanup to avoid unnecessary costs
- Practical understanding of Kubernetes networking
- Importance of VPC subnet tagging for AWS LoadBalancers
- Difference between NodePort and Ingress
- CI vs CD separation and automation
- Secure and optimized container practices
All cloud resources were deleted after project completion:
- Kubernetes workloads
- Ingress controller
- EKS cluster
- EC2 instances and LoadBalancers
This ensured no ongoing AWS charges.
https://github.com/kavitha351/DevOps-Assignment-pgagi
- For actual implementaion check the readme file on
developbranch.