Argo CD
Argo CD is a CNCF graduated GitOps controller for Kubernetes. It runs in the cluster and continuously syncs applications from Git to match desired state.
This page covers the Argo CD tool. For GitOps practice (push vs pull, repo layouts, promotion) and Flux, see GitOps. For how Argo CD relates to Helm and operators, see Helm vs operators vs GitOps.
How Argo CD Works
Section titled “How Argo CD Works”Git Repository (desired state) │ │ Argo CD watches for changes ▼Argo CD Controller (in cluster) │ │ Compares desired state (Git) vs live state (cluster) │ ├── In Sync ──► nothing to do │ └── Out of Sync ──► reconcile (apply changes to cluster)Core Concepts
Section titled “Core Concepts”| Concept | What It Is |
|---|---|
| Application | A CRD that maps a Git repo path to a Kubernetes namespace |
| Project | Groups applications with shared access policies and allowed destinations |
| Sync | Apply the desired state from Git to the cluster |
| Health | Whether the deployed resources are running correctly |
| Refresh | Check Git for changes (automatic or manual) |
Installing Argo CD
Section titled “Installing Argo CD”# Install Argo CD in the clusterkubectl create namespace argocdkubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
# Install the CLIbrew install argocd
# Get the initial admin passwordargocd admin initial-password -n argocd
# Loginargocd login localhost:8080Defining an Application
Section titled “Defining an Application”apiVersion: argoproj.io/v1alpha1kind: Applicationmetadata: name: myapp namespace: argocdspec: project: default
source: repoURL: https://github.com/example/k8s-config.git targetRevision: main path: apps/myapp/overlays/production # Path in the repo
destination: server: https://kubernetes.default.svc namespace: myapp
syncPolicy: automated: prune: true # Delete resources removed from Git selfHeal: true # Auto-correct manual changes (drift) syncOptions: - CreateNamespace=true retry: limit: 3 backoff: duration: 5s factor: 2 maxDuration: 3mSync Policies
Section titled “Sync Policies”| Policy | What It Does |
|---|---|
| Manual sync | User clicks Sync in the UI or CLI |
| Auto sync | Argo CD syncs whenever Git changes |
| Self-heal | Auto-correct drift (someone ran kubectl edit on a resource) |
| Prune | Delete resources that were removed from Git |
Argo CD CLI
Section titled “Argo CD CLI”# List applicationsargocd app list
# Sync an application (deploy)argocd app sync myapp
# Get application statusargocd app get myapp
# View diff (what would change)argocd app diff myapp
# Rollback to a previous Git revisionargocd app rollback myapp --revision 3
# Hard refresh (re-read from Git)argocd app get myapp --hard-refreshMulti-App Patterns
Section titled “Multi-App Patterns”Both patterns solve the same problem: managing many Argo Applications without creating each one by hand.
| Pattern | How it works | Best for | Downside |
|---|---|---|---|
| App of Apps | One parent Application points at a Git directory of child Application manifests | Cluster bootstrapping (cert-manager, ingress, monitoring), curated platform sets | Repetitive at scale (services × clusters = many near-identical files) |
| ApplicationSet | One template + a generator produces Applications automatically | Multi-cluster, multi-env, per-tenant, per-PR preview envs | More abstraction; deletes can cascade if misconfigured |
App of Apps
Section titled “App of Apps”Every child is a real, reviewable YAML file. Order installs with sync waves (lower waves sync first).
platform-gitops/ └── bootstrap/ ├── root.yaml # Parent Application (points at this directory) ├── cert-manager.yaml # Child Application └── ingress-nginx.yaml# bootstrap/root.yaml — parent ApplicationapiVersion: argoproj.io/v1alpha1kind: Applicationmetadata: name: root namespace: argocdspec: project: default source: repoURL: https://github.com/example/platform-gitops targetRevision: main path: bootstrap destination: server: https://kubernetes.default.svc namespace: argocd syncPolicy: automated: prune: true selfHeal: true# bootstrap/cert-manager.yaml — child with sync waveapiVersion: argoproj.io/v1alpha1kind: Applicationmetadata: name: cert-manager namespace: argocd annotations: argocd.argoproj.io/sync-wave: "-1"spec: project: default source: repoURL: https://charts.jetstack.io chart: cert-manager targetRevision: v1.15.3 helm: values: | crds: enabled: true destination: server: https://kubernetes.default.svc namespace: cert-manager syncPolicy: automated: prune: true selfHeal: true syncOptions: - CreateNamespace=truePin chart versions. Use sync waves so CRDs and platform add-ons land before workloads that depend on them. See Sync Waves.
ApplicationSet
Section titled “ApplicationSet”An ApplicationSet is a CRD plus controller: one template + a generator produces many Applications.
| Generator | What it produces |
|---|---|
| List | Fixed params (envs, regions) |
| Cluster | One app per registered cluster, filtered by labels (ideal for fleets) |
| Git | One app per directory or config file |
| SCM Provider / Pull Request | Per repo or per open PR (preview environments) |
| Matrix / Merge | Combine generators (for example service × cluster) |
Use preserveResourcesOnDeletion and applicationsSync: create-update so deleting an ApplicationSet does not cascade-delete live workloads by surprise.
List generator (fixed envs):
apiVersion: argoproj.io/v1alpha1kind: ApplicationSetmetadata: name: cluster-apps namespace: argocdspec: generators: - list: elements: - cluster: staging url: https://staging-k8s.example.com - cluster: production url: https://prod-k8s.example.com template: metadata: name: 'myapp-{{cluster}}' spec: project: default source: repoURL: https://github.com/example/platform-gitops path: 'apps/myapp/overlays/{{cluster}}' destination: server: '{{url}}' namespace: myappMatrix generator (every service × every prod cluster):
apiVersion: argoproj.io/v1alpha1kind: ApplicationSetmetadata: name: services-prod namespace: argocdspec: goTemplate: true goTemplateOptions: ["missingkey=error"] generators: - matrix: generators: - clusters: selector: matchLabels: env: prod - git: repoURL: https://github.com/example/platform-gitops revision: main directories: - path: services/* template: metadata: name: '{{.path.basename}}-{{.name}}' spec: project: default source: repoURL: https://github.com/example/platform-gitops targetRevision: main path: '{{.path.path}}/overlays/{{index .metadata.labels "env"}}' destination: server: '{{.server}}' namespace: '{{.path.basename}}' syncPolicy: automated: prune: true selfHeal: true syncOptions: - CreateNamespace=true syncPolicy: preserveResourcesOnDeletion: true applicationsSync: create-updatemissingkey=error makes template typos fail loudly. Consider ApplicationSet progressive syncs to roll out region by region on large fleets.
Sync Waves
Section titled “Sync Waves”Argo CD syncs resources (and Applications in an App of Apps) in wave order. Annotate with argocd.argoproj.io/sync-wave (string integer; default 0). Lower waves finish before higher ones start.
Typical bootstrap order: CRDs / cert-manager (-1 or 0) → ingress / monitoring (0–1) → application workloads (higher). Pair with health checks so the next wave waits until the previous is Ready.
Never let automation prune CRDs by surprise — use argocd.argoproj.io/sync-options: Prune=false on CRDs. See Cluster upgrades — CRD upgrades.
EKS Cluster Registration
Section titled “EKS Cluster Registration”Argo CD manages remote clusters via a Secret in the argocd namespace (argocd.argoproj.io/secret-type: cluster). Label clusters so ApplicationSet cluster generators can select them.
Generic shape (bearer token or other auth in config):
apiVersion: v1kind: Secretmetadata: name: prod-usw2 namespace: argocd labels: argocd.argoproj.io/secret-type: cluster env: prod region: us-west-2stringData: name: prod-usw2 server: https://kubernetes.example.com:6443 config: | { "bearerToken": "TOKEN", "tlsClientConfig": { "caData": "BASE64_CA" } }EKS variant — use IAM auth instead of a long-lived bearer token:
apiVersion: v1kind: Secretmetadata: name: eks-prod-usw2 namespace: argocd labels: argocd.argoproj.io/secret-type: cluster env: prod region: us-west-2stringData: name: eks-prod-usw2 server: https://EXAMPLE.gr7.us-west-2.eks.amazonaws.com config: | { "awsAuthConfig": { "clusterName": "prod-usw2", "roleARN": "arn:aws:iam::111111111111:role/argocd-deployer" }, "tlsClientConfig": { "caData": "BASE64_CA" } }Give the Argo controller an IAM role via IRSA or EKS Pod Identity. Map that role in each target cluster with EKS access entries (or the older aws-auth ConfigMap). See EKS overview for cluster context.
Argo CD itself is not EKS-specific — this subsection is only the AWS wiring.
Related
Section titled “Related”- GitOps — Pull model, Flux, three-repo structure, promotion, hotfix patterns.
- Helm vs operators vs GitOps — Mental model for packaging vs reconciliation.
- Crossplane — Infra claims synced by Argo CD.
- Multi-cluster management — Fleet delivery with ApplicationSets.
- Base workloads with Istio and Argo CD — Example Application path.
- EKS overview — AWS control plane context for IRSA and access entries.