Java Full CI/CD with Jenkins, SonarQube, Argo CD, Helm, and Kubernetes
mvn -q -f spring-boot-app/pom.xml testOverview
Section titled “Overview”Spring Boot app and manifests for full CI/CD lab.
What You Will Build
Section titled “What You Will Build”Architecture Diagram
Section titled “Architecture Diagram”Prerequisites
Section titled “Prerequisites”- Install or review: Java, Spring Boot, Maven, Docker, Kubernetes, Helm, SonarQube, Jenkins.
- No cloud provider credentials are required by the project metadata.
- This project can be practiced locally before you publish portfolio evidence.
- Open the safety guide before running commands that create infrastructure.
Credentials And Cost Warning
Section titled “Credentials And Cost Warning”Cost risk is medium. Cloud target: no cloud provider. Cloud credentials needed: No. Always use your own account, never commit secrets, and confirm cleanup before creating paid infrastructure.
Step-By-Step Lab
Section titled “Step-By-Step Lab”Use this flow before you run commands:
- Read the cost and credential warning above.
- Review the validation, troubleshooting, cleanup, and portfolio proof sections below.
- Follow the original project guide preserved near the bottom of this page.
- Return to the validation and cleanup checks before you capture portfolio evidence.
Validation Checks
Section titled “Validation Checks”Run the project validation command before and after meaningful changes:
mvn -q -f spring-boot-app/pom.xml testTroubleshooting
Section titled “Troubleshooting”- Run
mvn -q -f spring-boot-app/pom.xml testfirst so local tooling issues are visible early. - If a command fails, check tool versions, working directory, and required environment variables.
- For pipeline failures, check repository secrets, runner permissions, and pinned action versions.
Cleanup
Section titled “Cleanup”No dedicated cleanup command was detected in the project README. Treat this as a warning: before provisioning anything, write down the exact delete, destroy, or rollback steps for your environment.
Portfolio Proof
Section titled “Portfolio Proof”- Validation command output:
mvn -q -f spring-boot-app/pom.xml test - Screenshot or terminal proof: Passing pipeline run plus scan/deploy evidence
- Notes explaining what changed, what failed, and how you fixed it
- Cleanup evidence, especially for cloud or Kubernetes resources
Original Project Guide
Section titled “Original Project Guide”The original README content is preserved here for lab-specific commands and context. Headings are intentionally demoted so the page outline stays focused on the standard lab flow.
🔗 BLOG URL HERE: https://harshhaa.hashnode.dev/streamlining-cicd-workflow-with-github-jenkins-sonarqube-docker-argocd-and-gitops
Section titled “🔗 BLOG URL HERE: https://harshhaa.hashnode.dev/streamlining-cicd-workflow-with-github-jenkins-sonarqube-docker-argocd-and-gitops”🛡️ 2026 DevSecOps Enhancements (What You Will Learn)
Section titled “🛡️ 2026 DevSecOps Enhancements (What You Will Learn)”This repository’s Jenkinsfile, Dockerfile, and Kubernetes manifests have been heavily refactored from standard CI/CD scripts into a hardened DevSecOps pipeline:
- Container Security: The
Dockerfilehas been overhauled to ensure the Java application executes as a non-rootspringuser rather than root, significantly shrinking the container’s attack surface. - Automated Vulnerability Scanning: A mandatory Trivy Image Scan gate now blocks the Jenkins pipeline from proceeding if
CRITICALorHIGHcontainer vulnerabilities are detected. - Hardened Kubernetes: The
deployment.ymlmanifest now enforces robust CPU and Memory Resource Quotas, preventing application sprawl, and explicitly drops unnecessary Linux Kernel Capabilities using a strictsecurityContext.
Here are the step-by-step details to set up an end-to-end Jenkins pipeline for a Java application using SonarQube, Argo CD, Helm, and Kubernetes:
Prerequisites:
- Java application code hosted on a Git repository
- Jenkins server
- Kubernetes cluster
- Helm package manager
- Argo CD
Steps:
1. Install the necessary Jenkins plugins: 1.1 Git plugin 1.2 Maven Integration plugin 1.3 Pipeline plugin 1.4 Kubernetes Continuous Deploy plugin
2. Create a new Jenkins pipeline: 2.1 In Jenkins, create a new pipeline job and configure it with the Git repository URL for the Java application. 2.2 Add a Jenkinsfile to the Git repository to define the pipeline stages.
3. Define the pipeline stages: Stage 1: Checkout the source code from Git. Stage 2: Build the Java application using Maven. Stage 3: Run unit tests using JUnit and Mockito. Stage 4: Run SonarQube analysis to check the code quality. Stage 5: Package the application into a JAR file. Stage 6: Deploy the application to a test environment using Helm. Stage 7: Run user acceptance tests on the deployed application. Stage 8: Promote the application to a production environment using Argo CD.
4. Configure Jenkins pipeline stages: Stage 1: Use the Git plugin to check out the source code from the Git repository. Stage 2: Use the Maven Integration plugin to build the Java application. Stage 3: Use the JUnit and Mockito plugins to run unit tests. Stage 4: Use the SonarQube plugin to analyze the code quality of the Java application. Stage 5: Use the Maven Integration plugin to package the application into a JAR file. Stage 6: Use the Kubernetes Continuous Deploy plugin to deploy the application to a test environment using Helm. Stage 7: Use a testing framework like Selenium to run user acceptance tests on the deployed application. Stage 8: Use Argo CD to promote the application to a production environment.
5. Set up Argo CD: Install Argo CD on the Kubernetes cluster. Set up a Git repository for Argo CD to track the changes in the Helm charts and Kubernetes manifests. Create a Helm chart for the Java application that includes the Kubernetes manifests and Helm values. Add the Helm chart to the Git repository that Argo CD is tracking.
6. Configure Jenkins pipeline to integrate with Argo CD: 6.1 Add the Argo CD API token to Jenkins credentials. 6.2 Update the Jenkins pipeline to include the Argo CD deployment stage.
7. Run the Jenkins pipeline: 7.1 Trigger the Jenkins pipeline to start the CI/CD process for the Java application. 7.2 Monitor the pipeline stages and fix any issues that arise.This end-to-end Jenkins pipeline will automate the entire CI/CD process for a Java application, from code checkout to production deployment, using popular tools like SonarQube, Argo CD, Helm, and Kubernetes.
Thank you
Section titled “Thank you”Thank you for taking the time to work on this tutorial/labs. Let me know what you thought!
Ensure to follow me on GitHub. Please star/share this repository!
Section titled “Ensure to follow me on GitHub. Please star/share this repository!”Source Files On GitHub
Section titled “Source Files On GitHub”The full learning flow stays on this page. Open GitHub only when a step asks you to inspect code, fork the lab, or download source assets.