Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DevSecOps-Jenkins-EKS-Pipeline

Built a multi-stage Jenkins pipeline integrating Sonar- Qube (static code analysis), Trivy (filesystem and Docker image security scanning), Docker image build/tag/push, and automated deployment to a Terraform-provisioned EKS cluster with an ALB load balancer; monitored full application stack using Prometheus and Grafana.

End-to-End DevSecOps CI/CD Pipeline with EKS Deployment

🏗️ Architecture Overview

image

📋 What This Project Does

Automated CI/CD pipeline that takes application code from GitHub commit all the way to production deployment on AWS EKS, with security scanning, code quality checks, and monitoring.

🔧 Tech Stack

Category Tools
CI/CD Jenkins
Security Scan Trivy (filesystem + image)
Code Quality SonarQube
Build Maven
Containerization Docker
Registry Docker Hub (private repo)
Infrastructure Terraform
Orchestration AWS EKS (Kubernetes)
Monitoring Prometheus + Grafana
Artifact Store Nexus

🔄 Pipeline Flow

  1. Developer pushes code to GitHub
  2. Jenkins pipeline triggers automatically via webhook
  3. Code compiled with Maven (catches syntax errors early)
  4. Unit tests executed
  5. Trivy scans filesystem for vulnerabilities
  6. SonarQube checks code quality and coverage
  7. Maven builds JAR file
  8. Docker image built
  9. Trivy scans Docker image for CVEs
  10. Image pushed to private Docker Hub repository
  11. Application deployed to AWS EKS cluster
  12. Deployment verified with health check stage
  13. Email notification sent on success/failure

🏛️ Infrastructure (Terraform)

  • VPC with CIDR
  • 2 public subnets
  • Internet Gateway + Route Tables
  • EKS Cluster (control plane managed by AWS)
  • Node Group with 1 worker node (t3.medium)
  • IAM Roles for cluster and node group
  • Security Groups for cluster and nodes

☸️ Kubernetes Setup

  • Deployment with 2 pod replicas
  • LoadBalancer service (AWS NLB provisioned automatically)
  • Service Account + RBAC for Jenkins to authenticate to EKS
  • Image pull secret (regcred) for private Docker Hub access
  • App exposed on port 80 → pod port 8080

📊 Monitoring

  • Prometheus scrapes metrics every 15 seconds
  • Grafana dashboards for CPU, memory, request rate
  • Blackbox exporter for endpoint uptime monitoring

🚀 How to Run This Project

Prerequisites

  • AWS Account with appropriate IAM permissions
  • Jenkins server running
  • Docker installed
  • Terraform installed
  • kubectl installed

Step 1 — Provision EKS with Terraform

cd terraform/ terraform init terraform plan terraform apply

Step 2 — Connect to EKS

aws eks --region eu-central-1 update-kubeconfig --name

Step 3 — Configure Jenkins

  • Add credentials: Docker Hub, SonarQube token, K8s service account token
  • Install plugins: SonarQube Scanner, Kubernetes, Docker Pipeline, Maven

Step 4 — Run Pipeline

Trigger Jenkins pipeline — it runs all stages automatically

📸 Screenshots

  • image
  • image
  • image
  • image
  • image
  • image

🎯 Key Learnings

  • Implemented DevSecOps — security scanning at both code and image level, not as an afterthought
  • Used Terraform for reproducible infrastructure — entire EKS cluster can be recreated with one command
  • RBAC-based Jenkins-to-Kubernetes authentication using service account tokens — no hardcoded credentials
  • Private image registry with Kubernetes image pull secrets

About

Built a multi-stage Jenkins pipeline integrating Sonar- Qube (static code analysis), Trivy (filesystem and Docker image security scanning), Docker image build/tag/push, and automated deployment to a Terraform-provisioned EKS cluster with an ALB load balancer; monitored full application stack using Prometheus and Grafana.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages