GitOps CI/CD Pipeline with GitLab, Terraform, Helm & AWS EKS π Overview
This project demonstrates a production-grade GitOps CI/CD pipeline built using GitLab. It automates infrastructure provisioning, application build, containerization, and deployment to AWS EKS.
The system ensures:
Automated end-to-end delivery Infrastructure as Code (IaC) Version-controlled deployments Continuous validation and drift detection
ποΈ Architecture Summary
The solution is built around three independent but integrated pipelines: ββββββββββββββββββββββββ β GitLab β β (Source + CI/CD) β βββββββββββ¬βββββββββββββ β βββββββββββββββββΌβββββββββββββββββ β β β βΌ βΌ βΌ
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β CI Pipeline β β Terraform CI β β Helm CD β β (App Build) β β (Infra) β β (Deploy) β ββββββββ¬ββββββββ ββββββββ¬ββββββββ ββββββββ¬ββββββββ β β β
βΌ βΌ βΌ
ββββββββββββββββββ ββββββββββββββββββ ββββββββββββββββββ β Maven Build β β Validate β β Helm Lint β β Unit Test β β Plan β β Package β β Checkstyle β β Apply β β Deploy β β SonarQube β β Drift Detect β β Drift Check β β Docker Build β β Destroy β β Notify β β Docker Push β β Notify β β β ββββββββ¬ββββββββββ ββββββββ¬ββββββββββ ββββββββ¬ββββββββββ β β β ββββββββββββββββ¬βββββ΄βββββββββββββββ¬ββββ βΌ βΌ
βββββββββββββββββββββββββββββββββ
β AWS Cloud β
β β
β βββββββββββββββββββββββ β
β β EKS β β
β βββββββββββββββββββββββ β
β β Ingress β β
β β Service β β
β β Deployment β β
β β ConfigMap/Secret β β
β βββββββββββββββββββββββ β
β β
βββββββββββββββββββββββββββββββββ
- Terraform Pipeline (Infrastructure Layer)
Manages AWS infrastructure using Terraform.
Key Responsibilities:
Validate Terraform configurations Plan infrastructure changes Provision/update EKS cluster and AWS resources Perform drift detection Maintain remote state securely 2. CI Pipeline (Application Layer)
Handles build, testing, and containerization.
Stages:
Build & Unit Testing (Maven + JUnit) Code Quality Checks (Checkstyle, SonarCloud) Docker Image Build Push image to GitLab Container Registry Update Helm chart values dynamically 3. Helm Pipeline (Deployment Layer)
Responsible for Kubernetes deployments.
Tasks:
Helm chart linting & packaging Deploy applications to AWS EKS Perform deployment drift detection Send Slack notifications π GitOps Workflow Developer pushes code to GitLab CI pipeline builds and tests application Docker image is created and pushed to registry Helm values are updated automatically Helm pipeline deploys application to EKS Terraform ensures infrastructure consistency Drift detection monitors system state Notifications sent via Slack π§° Tools & Technologies πΉ GitLab GitLab Repositories (3 repos: app, helm, terraform) GitLab CI/CD pipelines GitLab Container Registry GitLab Terraform Backend πΉ AWS Amazon EKS (Kubernetes cluster) EC2 (GitLab Runner) IAM (Roles & Policies) VPC (Networking) S3 (Terraform backend) πΉ DevOps Tools Terraform (Infrastructure as Code) Docker (Containerization) Helm (Kubernetes package manager) SonarCloud (Code quality) Slack (Notifications) π» Tech Stack Category Tools/Technologies Language Java, YAML, Bash Build Tool Maven Testing JUnit Code Quality Checkstyle, SonarScanner Container Docker Version Control Git π Repository Structure
This project follows a multi-repo architecture:
Application Repo β Source code + CI pipeline Helm Repo β Helm charts for deployment Terraform Repo β Infrastructure provisioning π Key Features βοΈ Fully automated CI/CD pipeline βοΈ GitOps-driven deployment strategy βοΈ Infrastructure as Code (Terraform) βοΈ Containerized application delivery βοΈ Kubernetes deployment using Helm βοΈ Code quality and security checks βοΈ Drift detection and alerting βοΈ Slack integration for notifications π Benefits Faster and reliable deployments Improved traceability and auditability Reduced manual intervention Scalable and production-ready architecture
π¨βπ» Author Aniket Rasal