CI/CD Pipeline for Dockerized Applications
Kubernetes is becoming de-facto standard for containerized applications and it is important to be aware and get yourself familiarized with of CI/CD Pipeline for Dockerized Applications. I have created the CI/CD Pipeline Using AWS, Jenkins and EKS as major components.
Infrastructure Setup
Account A (CI Account)
Below instances are created using persistent spot request. This spot instances can be stopped and started ($$ Savings)
- Jenkins Server ( t2.small )
- SonarQube Server (t2.large)
Account B (EKS Account)
EKS Cluster provisioned with Terraform and Running Spot Node Group (t3a.large)
Pipeline Architecture

- GitHub Repo with Simple Application Code / Jenkinsfile / Docker File / Helm Chart etc.
- GitHub WebHooks triggers the Jenkins Job on Commit to the Repo.
- Unit Testcases are Run and Static application Security Testing (SAST) is carried out with SonarQube.
- Docker Image is Built/Tagged (Using commit hash) and Pushed to ECR.
- Jenkins CI server Assumes Cross Account Role to connect to EKS account .
- Helm Lint is performed and Helm packaging is done.
- Application deployed in EKS Cluster with Rolling Update Deployment Strategy
- Email and Slack Notification is sent upon Successful/Failure of Jenkins Pipeline .
Features
- AWS EC2 Spot instances for Compute (Jenkins/Sonar)
- Route53 used for DNS (mytwocents.click for Jenkins/Sonar and ramsawswork.click for Application in EKS and ingress)
- Cross Account Access using IAM Role
- Amazon Certificate Manager (ACM) is used to Secure the Application deployed in EKS
- Zero-Downtime Deployment with EKS
- Readiness/Liveness probes and Pod CPU/Memory Requests and Limits set.
- Ingress enabled in EKS so multiple applications can be hosted and routed seamlessly
- Pod Autoscaling is Setup with Horizontal Pod Autoscaler (HPA) with Scaling Criteria of CPU-Percentage > 50%
GitHub Repo Link
Jenkins Pipeline

SonarQube Scan Results

ECR Repository

EKS Cluster

Pod Auto Scaling Setup

Application exposed via Ingress
Homepage

Health Check Page

Slack Notification

Email Notification

