ArgoCD Architecture & Setup
ArgoCD Architecture & Setup
ArgoCD is the most widely deployed GitOps operator in the industry. Before you install it, you need to understand its internals — otherwise, every production incident will feel like a black box. ArgoCD consists of three principal components: the Application Controller, the Repo Server, and the API Server (plus the UI and Dex for SSO). Each has a distinct responsibility in the reconciliation loop that keeps your cluster in sync with Git.
Component 1: The Repo Server
The Repo Server is ArgoCD's source-of-truth reader. It is responsible for cloning Git repositories, rendering manifests from whatever templating engine the application uses (plain YAML, Helm, Kustomize, Jsonnet, custom plugins), and returning the rendered Kubernetes objects as a list. It is intentionally stateless — it holds no cluster credentials and never talks to the Kubernetes API. This isolation is a security boundary: a compromised Repo Server cannot directly mutate the cluster.
The Repo Server caches rendered manifests in a local cache (backed by the argocd-repo-server Deployment's in-memory store). When you trigger a refresh, the Repo Server re-clones or fetches the latest commit, re-renders, and hands the result to the Application Controller. You can run multiple replicas of the Repo Server for high availability — each is stateless, so they are safe to scale independently.
Component 2: The Application Controller
The Application Controller is the heart of ArgoCD. It is a Kubernetes controller — it runs a reconciliation loop, just like the Deployment controller you already know. Every N seconds (default: 3 minutes, configurable via --app-resync-period), it:
- Reads the desired state from the Repo Server (the rendered Git manifests).
- Reads the live state from the cluster (via the Kubernetes API).
- Diffs the two states.
- If
syncPolicy.automatedis enabled, applies the diff. Otherwise, marks the Application as OutOfSync and waits for a human or CI trigger.
The Application Controller also evaluates health status. It knows how to assess the health of built-in Kubernetes resource types (Deployment, StatefulSet, DaemonSet, Service, Ingress) and lets you define custom health checks in Lua for CRDs. An Application is Healthy only when every child resource is healthy — not just present.
ARGOCD_CONTROLLER_REPLICAS environment variable — each shard owns a partition of the Application set. This is how companies like Intuit (ArgoCD's original author) run thousands of Applications on a single control plane.Component 3: The API Server & the Application CRD
The API Server exposes the REST and gRPC API consumed by the CLI, the UI, and external CI systems. It handles authentication (local users, OIDC/Dex, LDAP), RBAC enforcement via AppProject policies, and routes commands (sync, rollback, refresh) to the Application Controller via the shared Redis instance.
The Application CRD is the declarative unit of work in ArgoCD. Every ArgoCD Application is a custom Kubernetes resource of kind Application in the argoproj.io/v1alpha1 API group. Its spec has three mandatory sections:
source— which Git repo, revision (branch/tag/SHA), and path (or chart name + version for Helm repos).destination— which cluster (by URL or in-cluster) and which namespace to deploy into.project— which AppProject governs RBAC and allowed clusters/repos for this Application.
Installing ArgoCD — Production-Grade Setup
The official install manifest is a good starting point, but production deployments need a few tweaks before they are ready. Below is the standard install sequence followed by the critical post-install configuration steps that most tutorials skip.
Your First Application CRD
Once ArgoCD is installed, you define Applications as YAML. The following manifest deploys a Helm chart from a Git repo into the staging namespace, with automated sync and self-healing enabled:
prune: true and selfHeal: true together enforce strict GitOps. Without prune, resources deleted from Git linger in the cluster. Without selfHeal, a manual kubectl apply or helm upgrade from a developer's laptop will create a divergence that ArgoCD never fixes. Both flags are off by default — turn them on in all non-production environments first, observe the behaviour, then enable in production.Inspecting Application State from the CLI
The argocd CLI is the operator's primary debug tool. These commands cover the most common production queries:
Understanding the Architecture → Setup → Inspect workflow is the foundation for every advanced ArgoCD topic: multi-cluster management, App-of-Apps, ApplicationSets, and secrets handling. The components you learned here — Repo Server, Application Controller, API Server, Application CRD — map directly to the failure modes you will diagnose in production incidents.