Successfully deploy a Spring Boot application using a robust CI/CD pipeline. It provides an overview of the technologies and processes involved, including Jenkins, SonarQube, Kubernetes, ArgoCD, and Microsoft Azure.
🎥 Watch the tutorial video here.
This project demonstrates the deployment of a Spring Boot application using a fully automated DevOps pipeline. The key components and technologies used in this project are:
- Spring Boot: A Java-based framework used to create stand-alone, production-grade Spring applications.
- Maven: A build automation tool used primarily for Java projects.
- Jenkins: An open-source automation server used to build, test, and deploy our application.
- SonarQube: A tool for continuous inspection of code quality to perform automatic reviews.
- Kubernetes: An open-source platform for automating the deployment, scaling, and management of containerized applications.
- ArgoCD: A declarative, GitOps continuous delivery tool for Kubernetes.
- Microsoft Azure: A cloud computing service used for deploying and managing applications.
Before setting up this project, ensure you have the following prerequisites:
-
Microsoft Azure Account: You will need an Azure account to provision a Resource Group and create a Virtual Machine in the RG. If you don't have an Azure account you can create one here.
-
Launch a virtual machine with the Ubuntu 22.04 LTS image and choose the size D2ads v5 - 2 vCPUs and 8 GiB memory because we need to access more things like Jenkins, SonarQube, Kubernetes, ArgoCD, and much more.
-
SSH Access: Connect to your Azure VM using SSH or any preferred method for configuration and setup.
-
Now install Jenkins-
#!/bin/bash
sudo apt update -y
wget -O - https://packages.adoptium.net/artifactory/api/gpg/key/public | sudo tee /etc/apt/keyrings/adoptium.asc
echo "deb [signed-by=/etc/apt/keyrings/adoptium.asc] https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | sudo tee /etc/apt/sources.list.d/adoptium.list
sudo apt update -y
sudo apt install temurin-17-jdk -y
/usr/bin/java --version
curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key | sudo tee /usr/share/keyrings/jenkins-keyring.asc > /dev/null
echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] https://pkg.jenkins.io/debian-stable binary/ | sudo tee /etc/apt/sources.list.d/jenkins.list > /dev/null
sudo apt-get update -y
sudo apt-get install jenkins -y
sudo systemctl start jenkins
sudo systemctl status jenkins
After running this script, use your <VM-publicIP:8080>
and access it via the browser.
-
after that install docker using these command-
sudo apt install
sudo apt update -y
sudo apt install docker.io -y
-
Docker group for permissions.
sudo usermod -a -G docker $USER
-
Switch primary group to Docker for current session.
newgrp docker
-
Granting universal read, write, and execute permissions to Docker socket.
sudo chmod 777 /var/run/docker.sock
-
now install sonarqube using this-
docker run -d --name sonar -p 9000:9000 sonarqube:lts-community
After run the container Use your VM-publicIP:9000 for sonarqube dashboard and access it via the browser. and enter username
admin
& password is alsoadmin
. -
after all then Install plugins on Jenkins-
-
Plugins Prerequisites in Jenkins-
Pipeline
Docker API Plugin
Docker Pipeline
SonarQube Scanner
Maven Integration
Blue Ocean
Git
-
Now, in Jenkins credentials, add the credentials for
Docker
,Github
, andSonarqube
. and after done of it's then run the Pipeline Script. -
Now install the Kubeadm because we are deploy ArgoCD using Kubernetes cluster, Visit the installation of kubernetes.
-
you can also use kubernetes using Azure Kubernetes Service (AKS).
-
for deploy argoCD visit the argocd documentation.
-
after done of it's upload your github project link in
New App
. -
And hope you can understand by the above tutorial video.
This project demonstrates a robust DevOps pipeline using Jenkins, SonarQube, Docker, Kubernetes, ArgoCD, and Azure. It ensures continuous integration and delivery, code quality, and automated deployment, providing a scalable and resilient environment for the Spring Boot application.
That’s all from my side. If you encounter any issues while working on this project, feel free to connect with me via-
Your insights are valuable and will help improve this project for everyone. Don't hesitate to connect! ✨😊