This project demonstrates an end-to-end DevSecOps CI/CD pipeline for deploying a containerized Netflix TMDB-like application on AWS EKS, integrating security, quality, monitoring, and automation best practices.
The pipeline provisions infrastructure using Terraform, builds and scans Docker images, performs static code analysis, deploys to Kubernetes (EKS), and enables monitoring and alerting using Prometheus, Node Exporter, and Grafana.
- AWS EKS (Kubernetes Cluster & Node Groups)
- Terraform (Infrastructure as Code)
- Jenkins (CI/CD Orchestration)
- Docker & Docker Hub
- SonarQube (Code Quality & Security)
- Kubernetes (Deployment & Service)
- Prometheus & Node Exporter (Monitoring)
- Grafana (Visualization)
aws-devsecops-ci-cd-pipeline/
|
├───Dockerfile
├───index.html
├───package.json
├───README.md
├───tsconfig.json
├───tsconfig.node.json
├───vercel.json
├───vite.config.ts
├───yarn.lock
├───EKS_TERRAFORM/
├───jenkins-pipeline's/
├───Kubernetes/
├───public
│ └───assets
├───screenshots
└───src
├───components
│ ├───animate/
│ ├───layouts/
├───constant
├───hoc
├───hooks
├───layouts
├───lib
├───pages
├───providers
├───routes
├───store
│ └───slices/
├───theme
├───types
└───utils
Before executing this project, ensure all the following requirements are met.
- Operating System: Ubuntu (commands are Ubuntu-specific)
- Host Machine Size: Minimum
t2.largeor equivalent (recommended) - Resources: Sufficient disk space & memory for Docker, Jenkins, and SonarQube
- Ensure AWS credentials are configured properly
- Verify Availability Zones before creating the EKS cluster
- Confirm instance type availability in your selected AWS region
- Default VPC & public subnets must exist (used by EKS)
- Obtain a valid TMDB API Key
- Replace the API key in Jenkins pipeline or environment variables
- Add Docker Hub username & password in Jenkins Credentials
- Create a
secret.txtfile from your local kubeconfig:cat ~/.kube/config > secret.txt
Ensure the following Jenkins plugins are installed:
- Pipeline
- Git
- GitHub Integration
- Docker Pipeline
- Kubernetes CLI
- SonarQube Scanner
- Email Extension Plugin
- Credentials Binding
- Blue Ocean (optional)
📌 Configure plugins under:
Manage Jenkins → Plugins → Available / Installed
- Configure JDK
- Configure NodeJS
- Configure SonarQube Scanner
- Configure Docker
- Add SonarQube server under:
Manage Jenkins → System → SonarQube Servers
- Configure SMTP email under:
Manage Jenkins → System - Enable email alerts for pipeline failures & success
- Deploy Node Exporter on worker nodes
- Update Prometheus configuration files with correct scrape targets
- Verify Prometheus UI and metrics collection
- Import dashboards into Grafana
📌 Detailed steps are available in the docs/monitoring.md file.
Docker Login / SonarQube Error Fix
If you face Docker login or SonarQube startup issues:
systemctl edit docker.service -> Add this in file
[Service]
Environment=DOCKER_MIN_API_VERSION=1.24Then run:
systemctl daemon-reexec
systemctl restart docker
docker start sonarThe Terraform EKS pipeline (terraform-ekscluster.yaml) is parameterized to control the infrastructure lifecycle using a Jenkins input parameter.
apply→ Create or update EKS infrastructuredestroy→ Safely tear down all AWS resources
This approach enables:
- Controlled infrastructure provisioning
- Safe cleanup to avoid unnecessary AWS charges
- Reusable pipeline for multiple executions
⚠️ Always verify the selected action before triggering the pipeline.
- Terraform provisions or destroys EKS infrastructure
- Application build & Docker image creation
- Security scanning & code analysis (SonarQube)
- Docker image pushed to Docker Hub
- Kubernetes deployment to EKS
- Monitoring & alerting enabled
- Email notifications sent
To avoid unnecessary AWS charges:
terraform destroy => rerun terraform-ekscluster.yaml and choose [destroy] as action- Delete Jenkins resources if hosted on EC2
- Remove Docker images if no longer required
- Clean up Kubernetes resources
- End-to-end DevSecOps automation
- Infrastructure as Code with Terraform
- Secure CI/CD pipeline design
- Kubernetes production deployment
- Monitoring & observability
- Real-world troubleshooting & fixes
- This project uses a non-modular Terraform structure for simplicity
- In production, the Terraform code can be refactored into reusable modules
- All commands are tested on Ubuntu only
Ghanashyama
DevSecOps | Cloud | Kubernetes | CI/CD
📍 India
⭐ If you find this project useful, consider starring the repository!
