Installing and Configuring ArgoCD : A Step-by-Step Guide
Introduction
ArgoCD is a declarative, GitOps continuous delivery tool for Kubernetes. It allows you to manage your Kubernetes resources using Git repositories as the source of truth.
Prerequisites
Before you begin, ensure you have the following:
A Kubernetes cluster
kubectl
command-line tool installed
Installation
Before installing ArgoCD, make sure that your Kubernetes cluster is up and running! You can verify using the below command:
minikube status
You will get an output like this:
We can install ArgoCD in three ways:
Plain Manifests
Helm Charts
Operators
In this blog, I will show you how to install using Plain Manifests.
Step 1:
Open your command line interface and run the following command:
kubectl create namespace argocd
This command creates a namespace called "argocd".
Next, run the below command:
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
Step 2:
Once ArgoCD is installed, wait for the pods to come up. You can view the pods by running the following command:
kubectl get pods -n argocd -w
Step 3:
Once the pods are up and running, run the following command in your command line interface:
kubectl get svc -n argocd
This command lists the services available in the "argocd" namespace. The ArgoCD server is responsible for interacting with the UI using the command line interface.
Step 4:
Next, run the following command:
kubectl edit svc argocd-server -n argocd
The reason for editing the "argocd-server" file is that, by default, the ArgoCD server type is set to ClusterIP. We need to change the type of "argocd-server" from ClusterIP to NodePort to access the service from the browser.
Step 5:
Since we have changed the type from ClusterIP to NodePort, we can now access the service from the terminal. However, if we want to access it using a browser, we need to do port forwarding or tunneling.
To do that, run the following command to list the services in the "argocd" namespace:
minikube service list -n argocd
Now, run the command below:
minikube service argocd-server -n argocd
This command creates a tunnel and provides you an IP address to access it.
The first URL is for HTTP access, and the second URL is for HTTPS access. Paste either URL into your browser.
After pasting the URL, you will see a caution message like this:
Click on "Proceed". After clicking on "Proceed", you will be on the ArgoCD login page.
Step 6:
To log in to ArgoCD, we need a username and password.
The username is "admin."
To get the password, open a new tab in the command line interface and run the following command:
kubectl get secret -n argocd
The above command lists the secrets in the "argocd" namespace.
Now go to the "argocd-initial-admin-secret" by running the following command:
kubectl edit secret argocd-initial-admin-secret -n argocd
The above command opens the "argocd-initial-admin-secret" file where the password is stored. Now, copy the password as shown below.
Since the password is encrypted in base64 format, we need to decrypt it.
To decrypt it, run the following command:
echo "your_password" | base64 --decode
Replace "your_password" with the original password. Now, paste the decrypted password in ArgoCD.
And that's it! You are now successfully logged into ArgoCD.
Thanks for reading my blog!