Getting started with Argo CD

Argo CD follows best practices and expects to be installed in a dedicated namespace on your Kubernetes cluster:

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

Let's see what was created. Argo CD installed four types of objects: pods, services, deployments, and replica sets. Here are the pods:

$ kubectl get all -n argocd
NAME READY STATUS RESTARTS AGE
pod/argocd-application-controller-7c5cf86b76-2cp4z 1/1 Running 1 1m
pod/argocd-repo-server-74f4b4845-hxzw7 1/1 Running 0 1m
pod/argocd-server-9fc58bc5d-cjc95 1/1 Running 0 1m
pod/dex-server-8fdd8bb69-7dlcj 1/1 Running 0 1m

Here are the services:

NAME                                  TYPE        CLUSTER-IP       EXTERNAL-IP  PORT(S)             
service/argocd-application-controller ClusterIP 10.106.22.145 <none> 8083/TCP
service/argocd-metrics ClusterIP 10.104.1.83 <none> 8082/TCP
service/argocd-repo-server ClusterIP 10.99.83.118 <none> 8081/TCP
service/argocd-server ClusterIP 10.103.35.4 <none> 80/TCP,443/TCP
service/dex-server ClusterIP 10.110.209.247 <none> 5556/TCP,5557/TCP

Here are the deployments:


NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
deployment.apps/argocd-application-controller 1 1 1 1 1m
deployment.apps/argocd-repo-server 1 1 1 1 1m
deployment.apps/argocd-server 1 1 1 1 1m
deployment.apps/dex-server 1 1 1 1 1m

Finally, here are the replica sets:

NAME                                                       DESIRED   CURRENT   READY     AGE
replicaset.apps/argocd-application-controller-7c5cf86b76 1 1 1 1m
replicaset.apps/argocd-repo-server-74f4b4845 1 1 1 1m
replicaset.apps/argocd-server-9fc58bc5d 1 1 1 1m
replicaset.apps/dex-server-8fdd8bb69 1 1 1 1m

However, Argo CD also installs two custom resource definitions (CRDs):

$ kubectl get crd
NAME AGE
applications.argoproj.io 7d
appprojects.argoproj.io 7d

CRDs allow various projects to extend the Kubernetes API and add their own domain objects, as well as controllers to monitor them and other Kubernetes resources. Argo CD adds the concepts of an application and project to the world of Kubernetes. Soon, you will see how they integrate for the purposes of continuous delivery with built-in Kubernetes resources such as deployments, services, and pods. Let's get started:

  1. Install the Argo CD CLI:
$ brew install argoproj/tap/argocd
  1. Port-forward to access the Argo CD server:
$ kubectl port-forward -n argocd svc/argocd-server 8080:443
  1. The initial password for the admin user is the name of the Argo CD server:
$ kubectl get pods -n argocd -l app.kubernetes.io/name=argocd-server -o name | cut -d'/' -f 2
  1. Log in to the server:
$ argocd login :8080
  1. If it complains about an insecure login, just confirm by pressing y:
WARNING: server certificate had error: tls: either ServerName or InsecureSkipVerify must be specified in the tls.Config. Proceed insecurely (y/n)?
  1. Alternatively, to skip the warning, type in the following:
argocd login --insecure :8080

Then, you can change the password.

  1. If you store your password in an environment variable (for example, ARGOCD_PASSWORD), then you can have a one-liner so that you can log in with no further questions being asked:
argocd login --insecure --username admin --password $ARGOCD_PASSWORD :8080