CICD using Jenkins and Argocd

Abhishek Singh
4 min readApr 2, 2023

--

GitOps is a modern approach to continuous delivery for software applications that leverages the power of Git, a popular version control system. In GitOps, the entire infrastructure of an application is defined as code, and this code is stored in a Git repository. This includes everything from the application code to the configuration files, deployment scripts, and even the infrastructure itself.

The basic idea behind GitOps is to use Git as the single source of truth for the entire application infrastructure. This means that all changes to the application infrastructure are made through Git, using Git’s built-in version control and collaboration features.

GitOps with Jenkins and Argo CD can be achieved by integrating these two tools to enable continuous delivery and deployment of applications. By integrating Jenkins and Argo CD, you can achieve GitOps by using Jenkins to automate the build and test stages of your application, and Argo CD to automate the deployment of the application to the desired environments. This approach can help improve the speed and reliability of your software delivery process while ensuring that all changes are tracked and audited in Git.

Here’s a high-level overview of how to set it up:

  1. Set up your Git repository: Create a Git repository where you will store your application code.
  2. Install Jenkins: Install Jenkins on a server or cloud instance and configure it to connect to your Git repository.
  3. Install Sonarqube: Setup sonarqube server on local vm or cloud instance.
  4. Create Jenkins pipelines: Use Jenkins to create a pipeline that automate the build, test stages of your application, build docker image, deploy final image to dockerhub and send slack notification.
  5. Create kubernetes cluster: Use kops to create a kubernetes cluster on aws.
  6. Install Argo CD: Install Argo CD on the cluster and configure it to connect to your Git repository which contains infrastructure configuration files.
  7. Define Argo CD application: Define Argo CD application using a declarative yaml file.
  8. Deploy applications with Argo CD: Argo CD will automatically detect changes to the Git repository and deploy the updated application on Kubernetes cluster.

Details of this project is in the following git repositories:

Jenkins is a popular open-source automation server that is widely used for continuous integration and delivery (CI/CD) of software applications. Jenkins can be used to automate the building, testing, and deployment of software, including Docker images. In this project docker image of application is built and uploaded to docker hub with build number and latest tag. This image will be used in CD process by Argocd.

Argo CD is an open-source tool that enables GitOps-style continuous delivery for Kubernetes. It allows you to define and manage Kubernetes applications as code in Git, and then automatically deploy and manage them in your Kubernetes clusters. With Argo CD, you can manage the entire lifecycle of your Kubernetes applications, including deployment, scaling, and rolling updates, all from within your Git repository. It uses Kubernetes manifests as the source of truth for your application configuration, and can automatically detect changes in your Git repository and update your application accordingly.

The application is exposed to access on browser by service of type loadbalancer. Kops will create an actual load balancer on aws, using it’s External-IP you can access the application.

--

--