How to Setup Argo CD using Helm

In this blog we will look Argo CD installation using Helm with step by step instructions. At the end you will have a working ArgoCD running on Kubernetes.

We will also configure Github Webhook with ArgoCD.

Follow the setups given below for the setup.

Step 1: Add argo cd repo

Add Argo CD repo to your system to download the helm chart to set up Argo CD. Run the following command to add the repo

helm repo add argo https://argoproj.github.io/argo-helm

Now, list every repo with the word argo using the command

helm search repo argo

You will get the list of repos with the word argo as shown below

Step 2: Customize Helm Chart Configuration Values

Before deploying you need to update NodePort configurations in the helm chart so that you can access Argo CD UI in the browser, for that use the below command to save the default values of the helm chart in a YML file.

helm show values argo/argo-cd > values.yaml

Make changes in the service configuration block on line 1836, change the type from ClusterIP to NodePort as shown in the below image.

By changing the type to NodePort you can access Argo CD UI on the browser using the URL <Public IP of your node>:<port>.

Make sure to use the same node port number you mentioned in the values.yml file.

If you want to download the whole helm chart with every file use the below command

helm fetch argo/argo-cd

This command will download every file of the helm chart in a .tgz package, run the below command to extract the file

tar -zxvf argo-cd-<version>.tgz

Now, you can see every file packed inside the package.

Step 3: Deploy Argo CD

Before deploying Argo CD, create a namespace for it using the command

kubectl create namespace argocd

Now, use the below command to deploy Argo CD in the namespace created above

helm install --values values.yaml argocd argo/argo-cd --namespace argocd

Verify if all the pods have been created successfully using the command

kubectl get pod -n argocd

You will get the following output

Step 4: Log in to Argo CD UI

To access the UI, use the public IP of any node of your cluster with the node port number in the format <node IP>:<port>, in my case, the URL will be 35.92.79.249:30007.

Now, access the UI in your browser using the URL you will get the following window

Login to Argo CD using the username and password. Your default username will be admin and to get the password run the following command

kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 --decode ; echo

This command will show your password for Argo CD, use the password and log in to Argo CD UI.

Once you log in you can see the home screen of Argo CD as shown below

This image has an empty alt attribute; its file name is 2023-12-15_15-44-00-1024x473.png

Step 5: Configure the GitHub repository to Argo CD

The next step is to configure a GitHub repository to Argo CD so that it can deploy and manage the resources. My repository structure is given below

.
├── README.md
└── java-app
    └── java.yaml

Make sure to organize your repository like given above. Create a separate folder for the deployment file and place the deployment file inside it because you need to specify the path in the configuration.

From the Argo CD dashboard press the + NEW APP button to configure the repository.

A new window will pop up, specify the Application Name, give the Project Name as default, and set the SYNC POLICY to automatic or manual as you like.

If you set the SYNC POLICY to automatic, Argo CD automatically detects the changes made in your Git repository and triggers the deployment, or if you set the SYNC POLICY to manual you have to trigger it manually to start the deployment.

Also, there are other SYNC POLICY options, enable them as per your need.

Now, add the source information which is your Git repository URL, and the path of the YML file.

Then, select the Cluster URL which will be shown when you select the Cluster URL tab, and specify the namespace where your cluster is running.

After that press the Create button as shown below.

When press the create button it will deploy the YML file and create a dashboard for it, if the deployment is successful and running it will give the status as Healthy and Synced as shown below

Select it to see detailed info about your deployment

Step 6: Configure Webhook

Though Argo CD continuously monitors Git for changes there is a time delay in syncing the changes, to remove the time delay we can use webhook which triggers the sync process as soon as a change is made in Git.

Let’s see how to configure webhook on Argo CD.

First, go to your Git repository which you configured with Argo CD then go to

Setting->Webhooks->Add webhook as shown in the below image to configure webhooks.

After pressing the Add webhook button you can see the configuration window as shown below, in that specify the Payload URL which will be <node IP>:<port>/api/webhook, change the Content type to application/json, and give the Secret as you like.

Now, select Enable SSL verification if you are using an SSL certificate for your Argo CD, and select Disable if you are not using an SSL certificate.

Then select the event in which you like to trigger the webhook, it will trigger the webhook according to the event you select.

Press the Add webhook button to add the webhook configuration for your Argo CD, you can see the webhook has been added as shown below

By selecting it you can see the triggers made by the hook as shown below

Leave a Reply

Your email address will not be published. Required fields are marked *

You May Also Like