Jaswinder Singh
Jaswinder Singh
DevOps Engineer

How Argo CD Works

Continuous Delivery or commonly known as CD is quite a common term in Software Development. It is basically used for all the code changes which automatically are updated n the production release. It can update all the changes from new features to configuration changes, and from bug fixes,—into production. 

Now for CD to work seamlessly, many tools support it. One such tool is Argo CD. This article will walk you through the working of it in detail. And if you haven’t heard about Argo CD and don’t know what is it, you can read ARGO CD | Features and its working, which will provide you with other details such as the features, and origin of the tool. 

Why Argo CD?

Argo CD is a tool that helps software developers to automate the process of continuous delivery. It provides a single view of the entire delivery pipeline, and it is designed to work with any DevOps tool or framework.

It automates deployment and release management, giving developers more time to focus on code. As a result of which, it allows them to set up automated deployments, manage releases, and monitor production deployments from one place.

The tool is used by over 1500 organizations worldwide including Airbnb, Netflix, and Uber.

- Advertisement -

This is a new tool that has been created to help software developers work faster and more efficiently. The tool has been designed to help with the process of bug fixing, code review, and continuous integration.

Working

Although continuous delivery is quite a complex process, let us understand how the tool can ease the continuous delivery process. It is an important part of the Kubernetes Cluster and solves many problems. It works by pulling Kubernetes changes and applying them to clusters rather than pushing them. When the tool is set up in the Kubernetes cluster, it is important to configure it to connect and track Git repo changes. 

What Argo CD does is simply apply all the changes to the cluster that it discovers. When developers send a new code, it will build a new image. This image is then updated by Argo CD in Kubernetes manifest file that is automatically pulled by Argo CD. This not only saves time but also reduces initial setup configuration, reducing security risks.

However, there are chances that DevOps teams make further configuration modifications to the application. Don’t worry, Argo CD will watch and sync any manifest files linked to the Git source and pull them into the Kubernetes cluster, giving developers and DevOps a single flexible deployment mechanism.

This tool also monitors changes in the cluster, which is critical if the cluster is updated manually. The difference between the cluster and the Git repo states will be detected by it. Argo CD checks the required configuration in the Git repo to the current state in the Kubernetes cluster and syncs the Git repo to the cluster, overriding any manual updates, and ensuring that the Git repo remains the sole source of truth. However, Argo CD can be configured to not automatically override manual updates if a rapid update to the cluster is required, in which case an alarm will be delivered instead.

Installation

- Advertisement -

Even before you start with the installation of Argo CD in Kubernetes, make sure that the following prerequisites are installed in your system.

PREREQUISITE FOR INSTALLATION OF ARGO CD IN KUBERNETES

1. Kubectl – It is a command-line interface to manage Kubernetes clusters and their resources. It can be used to install applications as well as create, update and delete resources such as pods, services, etc.

2. Kubernetes Cluster – A set of multiple nodes required to run containerized applications is referred to as Kubernetes Cluster.

3. Sudo or Root Access – It is important to have a Sudo access which is required to run all the Linux commands.

Steps to Install Argo CD

Step 1-  Turn on the Kubernetes cluster that you want to use.

Step 2- Create a new namespace called “Argo-cd” (this is the namespace where Argo CD will be installed). And install it.

$ kubectl create namespace argocd
$ kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml

Step 3 – It is the basic attribute of Argo CD that it is not exposed to external IP. In order to do so, in this step, expose it to the server using a load balancer or Ingress. 

$ kubectl patch svc argocd-server -n argocd -p '{"spec": {"type": "LoadBalancer"}}'

Step 4 – After exposing it to the server, we will install argocd utility. You can do it by downloading the binary under /usr/local/bin directory and providing the execute permission using the below commands.

$ curl -sSL -o /usr/local/bin/argocd https://github.com/argoproj/argo-cd/releases/latest/download/argocd-linux-amd64
$ chmod +x /usr/local/bin/argocd

Step 5 – At this stage, what you need to do is to log in using the CLI. Next, the primary password would be auto-generated and available in clear text. 

$ argoPass=$(kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d)
$ argocd login --insecure --grpc-web k3s_master:32761 --username admin --password $argoPass

Step 6 – This step includes the creation of an application from a Git Repository and syncing the application with CLI. 

$ argocd app create guestbook --repo https://github.com/argoproj/argocd-example-apps.git --path guestbook --dest-server https://kubernetes.default.svc --dest-namespace default

Ultimately, this app is a useful, powerful tool for getting applications into production more quickly and easily. Easier, more automated deployments are a large part of the appeal of cloud computing—Argo CD helps to make that reality. It certainly isn’t for everyone, but if you’re familiar with Kubernetes and are ready to welcome your app into the cloud, it may be worth taking a look.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest articles

Join us on Facebook