Simplified GitOps: ArgoCD Installation Steps

Unlocking the Power of Continuous Delivery with Argo CD's Simplified Installation Process

Simplified GitOps: ArgoCD Installation Steps

Prerequisites

  • A running Kubernetes cluster

  • The kubectl command-line tool

  • Helm

Steps to install Argo CD on Kubernetes cluster.

Step 1: Visit the Argo CD website

Head over to the official Argo CD website https://argoproj.github.io/argo-cd/

Step 2: Create a new namespace

Create a new namespace for Argo CD in the Kubernetes cluster. This namespace will isolate Argo CD and its resources from the rest of the cluster.

To create a namespace, use the following command:

$ kubectl create ns argocd
namespace/argocd created
$ kubectl get ns
NAME               STATUS   AGE
argocd             Active   10s
default            Active   54d
kube-node-lease    Active   54d
kube-public        Active   54d
kube-system        Active   54d

Step 3: Install Argo CD

Way 1: Using kubectl apply

To install Non-HA v2.6.2 ArgoCD within argocd namespace run the below command:

kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/v2.6.2/manifests/install.yaml

Way 2: Using Helm

a) Add the Argo CD helm repository:

helm repo add <reponame> <repourl>

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

b) Install Argo CD using Helm:

helm search repo <reponame>

$ helm3 search repo argo

NAME                          CHART VERSION    APP VERSION      DESCRIPTION
argo/argo                     1.0.0            v2.12.5          A Helm chart for Argo Workflows
argo/argo-cd                  5.28.0           v2.6.7           A Helm chart for Argo CD, a declarative, GitOps...
argo/argo-ci                  1.0.0            v1.0.0-alpha2    A Helm chart for Argo-CI
argo/argo-events              2.1.5            v1.7.6           A Helm chart for Argo Events, the event-driven ...
argo/argo-lite                0.1.0                             Lighweight workflow engine for Kubernetes
argo/argo-rollouts            2.23.0           v1.4.1           A Helm chart for Argo Rollouts
argo/argo-workflows           0.22.16          v3.4.6           A Helm chart for Argo Workflows
argo/argocd-applicationset    1.12.1           v0.4.1           A Helm chart for installing ArgoCD ApplicationSet
argo/argocd-apps              0.0.9                             A Helm chart for managing additional Argo CD Ap...
argo/argocd-image-updater     0.8.4            v0.12.2          A Helm chart for Argo CD Image Updater, a tool ...
argo/argocd-notifications     1.8.1            v1.2.1           A Helm chart for ArgoCD notifications, an add-o...
bitnami/argo-cd               4.5.4            2.6.7            Argo CD is a continuous delivery tool for Kuber...
bitnami/argo-workflows        5.1.13           3.4.6            Argo Workflows is meant to orchestrate Kubernet

helm repo list

$ helm3 repo list

NAME                    URL
argo                    https://argoproj.github.io/argo-helm

helm search repo <reponame>/<chartname> --versions

$ helm3 search repo argo/argo-cd --versions

NAME            CHART VERSION     APP VERSION               DESCRIPTION
argo/argo-cd      5.28.0            v2.6.7         A Helm chart for Argo CD, a declarative, GitOps...
argo/argo-cd      5.27.5            v2.6.7         A Helm chart for Argo CD, a declarative, GitOps...
argo/argo-cd      5.27.4            v2.6.7         A Helm chart for Argo CD, a declarative, GitOps...
argo/argo-cd      5.27.3            v2.6.7         A Helm chart for Argo CD, a declarative, GitOps...
argo/argo-cd      5.27.2            v2.6.7         A Helm chart for Argo CD, a declarative, GitOps...
argo/argo-cd      5.27.1            v2.6.6         A Helm chart for Argo CD, a declarative, GitOps...
argo/argo-cd      5.27.0            v2.6.5         A Helm chart for Argo CD, a declarative, GitOps...
argo/argo-cd      5.26.3            v2.6.5         A Helm chart for Argo CD, a declarative, GitOps...

APP VERSION is ArgoCD version

helm install argocd argo/argo-cd -n argocd

Use following command to install argocd for specific version and kubeconfig file:

helm install --values <custom-values.yaml> <release-name> <repo-name>/<chart-name> --version <chart-version> --kubeconfig ~/.kube/<config-file-name>

helm3 install --values values.yaml argocd argo/argo-cd --version 5.28.0 --kubeconfig ~/.kube/kubeconfig_cluster1 -n argocd --create-namespace

Now, Way 1 or Way 2 creates all the necessary resources for Argo CD, such as deployments, services, and config maps.

$ kubectl get all -n argocd

NAME                                                    READY   STATUS    RESTARTS         AGE
pod/argocd-application-controller-0                     1/1     Running   9 (5d20h ago)    33d
pod/argocd-applicationset-controller-587588cd69-g85lw   1/1     Running   9 (5d20h ago)    33d
pod/argocd-dex-server-5fbb6d7489-8m57n                  1/1     Running   9 (5d20h ago)    33d
pod/argocd-notifications-controller-7bf9b85f77-57xhf    1/1     Running   9 (5d20h ago)    33d
pod/argocd-redis-598f75bc69-5pn9l                       1/1     Running   20 (5d20h ago)   54d
pod/argocd-repo-server-75786b8cb-7h55v                  1/1     Running   9 (5d20h ago)    33d
pod/argocd-server-5dc57779d8-7qllf                      1/1     Running   9 (5d20h ago)    33d

NAME                                              TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)                      AGE
service/argocd-applicationset-controller          ClusterIP   10.111.152.16   <none>        7000/TCP,8080/TCP            54d
service/argocd-dex-server                         ClusterIP   10.97.164.101   <none>        5556/TCP,5557/TCP,5558/TCP   54d
service/argocd-metrics                            ClusterIP   10.108.235.53   <none>        8082/TCP                     54d
service/argocd-notifications-controller-metrics   ClusterIP   10.108.206.9    <none>        9001/TCP                     54d
service/argocd-redis                              ClusterIP   10.97.10.198    <none>        6379/TCP                     54d
service/argocd-repo-server                        ClusterIP   10.107.234.9    <none>        8081/TCP,8084/TCP            54d
service/argocd-server                             ClusterIP   10.99.137.9     <none>        80/TCP,443/TCP               54d
service/argocd-server-metrics                     ClusterIP   10.103.15.175   <none>        8083/TCP                     54d

NAME                                               READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/argocd-applicationset-controller   1/1     1            1           54d
deployment.apps/argocd-dex-server                  1/1     1            1           54d
deployment.apps/argocd-notifications-controller    1/1     1            1           54d
deployment.apps/argocd-redis                       1/1     1            1           54d
deployment.apps/argocd-repo-server                 1/1     1            1           54d
deployment.apps/argocd-server                      1/1     1            1           54d

NAME                                                          DESIRED   CURRENT   READY   AGE
replicaset.apps/argocd-applicationset-controller-587588cd69   1         1         1       33d
replicaset.apps/argocd-dex-server-5fbb6d7489                  1         1         1       33d
replicaset.apps/argocd-notifications-controller-7bf9b85f77    1         1         1       33d
replicaset.apps/argocd-redis-598f75bc69                       1         1         1       54d
replicaset.apps/argocd-repo-server-75786b8cb                  1         1         1       33d
replicaset.apps/argocd-server-5dc57779d8                      1         1         1       33d

NAME                                             READY   AGE
statefulset.apps/argocd-application-controller   1/1     54d

Step 4: Verify the installation

Once the installation is complete, verify that Argo CD is up and running by checking the status of its pods:

kubectl get pods -n argocd

This command will list all the pods running in the argocd namespace. Make sure that all the pods are in a "Running" state.

Step 5: Access the Argo CD UI

Get argocd service details:

$ kubectl get svc -n argocd
NAME                                      TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)                      AGE
argocd-applicationset-controller          ClusterIP   10.111.152.16   <none>        7000/TCP,8080/TCP            54d
argocd-dex-server                         ClusterIP   10.97.164.101   <none>        5556/TCP,5557/TCP,5558/TCP   54d
argocd-metrics                            ClusterIP   10.108.235.53   <none>        8082/TCP                     54d
argocd-notifications-controller-metrics   ClusterIP   10.108.206.9    <none>        9001/TCP                     54d
argocd-redis                              ClusterIP   10.97.10.198    <none>        6379/TCP                     54d
argocd-repo-server                        ClusterIP   10.107.234.9    <none>        8081/TCP,8084/TCP            54d
argocd-server                             ClusterIP   10.99.137.9     <none>        80/TCP,443/TCP               54d
argocd-server-metrics                     ClusterIP   10.103.15.175   <none>        8083/TCP                     54d

Finally, access the Argo CD UI using a web browser. To access the UI, we need to create a port-forwarding connection to the Argo CD server. Use the following command to create a port-forwarding connection:

kubectl port-forward svc/argocd-server -n argocd 8080:443

This command will create a local port forwarding connection from the machine to(8080) the Argo CD server(443). Once the connection is established, open a web browser and navigate to https://localhost:8080.

Step 6: Log in using the default username and password

  • Username: admin

  • Password: The password is autogenerated and can be obtained by running the following command:

Way 1:

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

OR

Way 2:

$ kubectl get secrets -n argocd
NAME                              TYPE     DATA   AGE
argocd-initial-admin-secret       Opaque   1      54d
argocd-notifications-secret       Opaque   0      55d
argocd-secret                     Opaque   5      55d
cluster-192.168.64.3-1062665955   Opaque   3      54d
repo-1269602644                   Opaque   4      52d
repo-2914916289                   Opaque   4      52d


$ kubectl get secrets argocd-initial-admin-secret -n argocd -o yaml
apiVersion: v1
data:
  password: <base64 encoded password>
kind: Secret
metadata:
  creationTimestamp: "2023-01-31T06:20:05Z"
  name: argocd-initial-admin-secret
  namespace: argocd
  resourceVersion: "1244"
  uid: 81914138-d5eb-4d2d-bc14-212d4b500143
type: Opaque

$ echo <base64 encoded password> | base64 -d
<argocd_password>

We have Successfully Logged in to ArgoCD WebUI!

Step 7: Installing Argo CD CLI

The Argo CD CLI is a command-line tool that allows us to interact with the Argo CD server. Here's how to install it on the system:

  1. Go to argocd GitHub release --> Assests --> Copy link address(argocd-linux-amd64) Open a terminal and use the following command to download the package.
wget <copied-url>
  1. Rename package as argocd
mv argocd-linux-amd64 argocd
  1. move package in /usr/local/bin/argocd
mv argocd /usr/local/bin/
  1. Make the argocd binary executable by running the following command:
chmod +x /usr/local/bin/argocd

To verify that the installation was successful, run the following command:

$ argocd version

argocd: v2.3.13+eb7b8a4
  BuildDate: 2023-01-18T03:48:53Z
  GitCommit: eb7b8a47908e01f032a29a16eae782dac6702638
  GitTreeState: clean
  GoVersion: go1.17.13
  Compiler: gc
  Platform: darwin/amd64
argocd-server: v2.6.2+6e02f8b

this command should print the version of the ArgoCD CLI that was just installed.

That's it! We have successfully installed the ArgoCD CLI on the system. We can now use the argocd command to interact with the ArgoCD server.