Skip to content
$ lynuxpro
← GitOps with Argo CD

LESSON 2 OF 19 · BEGINNER · 10 MIN

Installing Argo CD

Free previewLesson 2 of the 2 free lessons in this Pro course.Unlock all 19

HOW IT WORKSThe pieces of Argo CD

YouUI or CLIAPI serverRepo serverreads GitControllersyncsRediscacheGitCluster
1/5

Install adds a few pods to the argocd namespace.

$ kubectl apply -n argocd -f install.yaml

In simple words

  • Argo CD: a GitOps tool for Kubernetes that watches Git and syncs your cluster to it.
  • Argo CD components: the API server (UI and CLI), the repo server (reads Git) and the application controller (compares and syncs).
  • argocd CLI: the command-line tool for logging in to Argo CD and managing apps.

Big picture

Argo CD runs inside your Kubernetes cluster as a few pods. It reads Git, compares it with the cluster and applies the difference. You talk to it through a web UI, a CLI, or YAML.

The parts

PartJob
API serverThe web UI, the CLI and the API
Repo serverReads Git and turns Helm or Kustomize into plain YAML
Application controllerCompares Git with the cluster and syncs
RedisA cache so it is fast
ApplicationSet controllerMakes many Applications from one template (lesson 9)
Notifications controllerSends messages to Slack, email and more (lesson 13)
Dex (optional)Single sign-on with GitHub, Google, Okta and others

Install

You need a cluster (kind, minikube or a cloud one) and kubectl.

kubectl create namespace argocdkubectl apply -n argocd --server-side --force-conflicts \  -f https://raw.githubusercontent.com/argoproj/argo-cd/v2.13.0/manifests/install.yamlkubectl get pods -n argocd
SHELLbashutf-8 · 4L

--server-side is needed because some Argo CD definitions (CRDs) are too big for a normal kubectl apply. Without it you may see metadata.annotations: Too long. Use a version tag such as v2.13.0 (check the Argo CD releases page for the newest).

NAME                                               READY   STATUS    RESTARTS   AGEargocd-application-controller-0                    1/1     Running   0          60sargocd-applicationset-controller-7d9c6b5f4-r8k2n   1/1     Running   0          60sargocd-dex-server-6c8b5d7f9-h5tqw                  1/1     Running   0          60sargocd-notifications-controller-5f7d8c6b9-p2xvz    1/1     Running   0          60sargocd-redis-7c8d9f5b6-m4tnh                       1/1     Running   0          60sargocd-repo-server-6d4c5f7b8-xk2lp                 1/1     Running   0          60sargocd-server-5b7f9c6d4-q9wzr                      1/1     Running   0          60s
OUTPUTterminalutf-8 · 8L

All pods should reach Running in a minute or two.

Which install file

FileWhat you getUse it for
manifests/install.yamlEverything, cluster-wide rightsLearning, one cluster
manifests/ha/install.yamlSame, with several replicasProduction (lesson 15)
manifests/namespace-install.yamlOnly works inside its own namespaceShared clusters, no cluster-admin
manifests/core-install.yamlNo UI and no API serverMinimal setups driven only by YAML

Open the UI

kubectl port-forward svc/argocd-server -n argocd 8080:443argocd admin initial-password -n argocd
SHELLbashutf-8 · 2L

If you do not have the CLI yet, read the Secret directly:

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

Open https://localhost:8080. The user is admin, and the password is the text printed by the second command.

Install the CLI

brew install argocdargocd login localhost:8080 --username admin --insecure
SHELLbashutf-8 · 2L
'admin:login' logged in successfullyContext 'localhost:8080' updated
OUTPUTterminalutf-8 · 2L

Now change the password and check the versions:

argocd account update-passwordargocd version --short
SHELLbashutf-8 · 2L
argocd: v2.13.0argocd-server: v2.13.0
OUTPUTterminalutf-8 · 2L

After this you may delete the first-password Secret: kubectl -n argocd delete secret argocd-initial-admin-secret.

Install with Helm (for real clusters)

helm repo add argo https://argoproj.github.io/argo-helmhelm install argocd argo/argo-cd -n argocd --create-namespace -f values.yaml
SHELLbashutf-8 · 2L

Helm lets you keep settings, such as high availability and SSO, in a values file in Git.

Common mistakes

  • Leaving the admin account and the first password in use. Change it, or turn on SSO and disable admin.
  • Exposing the UI to the internet with no TLS.
  • Using the install.yaml file with no pinned version. Use a version tag, for example v2.13.0, not stable.
  • Running kubectl apply without --server-side and hitting the "annotations too long" error.
  • Forgetting that the CLI and the server should be close in version.

Summary

  • Argo CD is a few pods in your cluster: API server, repo server, controller, Redis.
  • Install with kubectl apply for learning and Helm for real use.
  • Log in to the UI with admin and the initial secret, then change it.

CHECK YOUR UNDERSTANDING

3 quick questions

  1. 1. Which Argo CD part turns Helm and Kustomize into plain YAML?

  2. 2. How do you find the first admin password?

  3. 3. Why pin the install manifest to a version tag?

You've finished the free preview of GitOps with Argo CD

Upgrade to Pro to unlock the remaining 17 lessons, every practice lab and a certificate when you finish.

See plans