Skip to content

nicoghezzi/Complete-CICD-Pipeline-with-EKS-and-DockerHub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 CI/CD Pipeline: Java → Docker → ECR → EKS

CI/CD: Jenkins Build: Maven Container: Docker Registry: ECR Orchestration: Kubernetes Cloud: AWS

A production-style CI/CD pipeline that automates the deployment of a Java application from source code to a live environment on Amazon EKS.


📌 Overview

End-to-end pipeline that:

  • Builds a Java (Spring Boot) application with Maven.
  • Containerizes it using Docker
  • Pushes the image to Amazon ECR
  • Deploys to Amazon EKS using Kubernetes manifests
  • Note: I replaced the real java app by a Java baseline since I can't share the real Java app for security reasons.

⚙️ Pipeline Stages

1. Source Checkout

  • Pulls jenkins-jobs branch
  • Uses Jenkins credentials for authentication

2. Build

  • Runs mvn clean package
  • Executes unit tests
  • Produces JAR artifact

3. Docker Build & Push

  • Builds image using Amazon Corretto base image
  • Tags and pushes to ECR
  • Authenticates with AWS

4. Deploy to EKS

  • Configure kubeconfig:

    aws eks update-kubeconfig --region us-east-1 --name demo-cluster

  • Deploy to cluster:

    kubectl apply -f kubernetes/

  • Performs rolling updates


🧰 Tech Stack

  • Jenkins (CI/CD) (Note: I used Jenkins because it was the default tool used by the workplace, however I would've used GitHub Actions or GitLab CI instead)
  • Maven (Build)
  • Docker (Containerization)
  • AWS ECR (Registry)
  • Kubernetes / EKS (Orchestration)
  • AWS (Cloud)
  • aws-cli, kubectl
  • GitLab

⚠️ Challenges & Fixes

  • AWS CLI missing in Jenkins → Installed CLI in execution environment
  • kubectl could not connect → Generated kubeconfig via AWS CLI
  • Wrong EKS cluster name → Verified directly in AWS Console
  • Jenkins agent vs controller confusion → Ensured tools run in agent
  • Docker permission issues → Fixed execution context and permissions

Pipeline required 23+ runs to stabilize (see pipelines_failures/)


✅ Result

  • ✔ Application builds successfully
  • ✔ Image pushed to ECR
  • ✔ Kubernetes resources created
  • ✔ Application deployed to EKS

💡 Key Learnings

  • CI/CD failures are often environment-related, not code-related
  • Strong understanding of Jenkins execution model (agent vs controller)
  • Hands-on experience with:
    • AWS CLI in pipelines
    • ECR authentication
    • EKS kubeconfig setup
    • Kubernetes deployments

🧪 Takeaway

Go to evidence folder on project root to find screenshots. This project demonstrates the ability to design, implement, and debug a real-world CI/CD pipeline across Jenkins, Docker, AWS, and Kubernetes — focusing on reliability, not just implementation.

About

Designed and implemented a realistic CI/CD pipeline that takes a Java application from source code to a live deployment on Amazon EKS, using industry-standard DevOps tools

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors