Argo CD Hour 1: GitOps and Argo CD Core

From “kubectl apply / helm upgrade” push-based deployment to “Git is the single source of truth, and the cluster pulls and continuously reconciles itself”: principles, architecture, installation, first Application, state model, sync, self-heal and troubleshooting
Argo CD v3.6.1argo-cd chart 10.18.0kind v0.33.0 · K8s v1.37.0podinfo 6.16.0 / 6.17.0Verified against official docs · 2026-11-17
Overall learning goals
  • First, master GitOps itself (tool-independent): use the OpenGitOps four principles (declarative, versioned and immutable, automatically pulled, continuously reconciled) to judge whether a delivery workflow “is GitOps”, and to explain push-based CI/CD and pull-based GitOps the differences in credentials, drift and auditing; understand why “running kubectl apply in CI” does not count as GitOps, as well as the benefits and costs of GitOps.
  • Compare the two mainstream implementations Argo CD and Flux (object model, UI, multi-tenancy, multi-cluster, Helm handling), and know which to choose in which scenario; this course then goes deep on Argo CD.
  • Draw the Argo CD component diagram: API Server, Repo Server, Application Controller, Redis, and the roles of ApplicationSet Controller, Dex and Notifications Controller; be able to explain clearly one reconciliation loop and what each component does in it.
  • Use the official Helm chart (argo/argo-cd 10.18.0) to install Argo CD v3.6.1 into a kind cluster lab, get the initial password and log in with the argocd CLI; understand what “core mode” is and when to use it.
  • Set up the gitops-lab repository skeleton that runs through all 8 hours (Kustomize base + dev/staging/prod overlays), and create the first Application both with the CLI and with declarative YAML podinfo-dev.
  • Read Sync Status (Synced / OutOfSync / Unknown) and Health Status (Healthy / Progressing / Degraded / Suspended / Missing / Unknown) combined meanings, and use diff, refresh, hard refresh, and manual and automatic sync.
  • Understand selfHeal, prune and drift: who gets reverted, who gets deleted, and who is not managed; use the troubleshooting tree to locate ComparisonError, such as OutOfSync or Progressing that won't go away, and other beginner-level issues.
Prerequisites This course assumes you have completed Kubernetes 8 hours(kind cluster lab, Deployment / Service / probes) and Helm 8 hours(charts, values,helm upgrade --install). Hour 5 of the Helm course already covered deploying charts with Argo CD and Flux hands-on. This course is a systematic deep dive into GitOps and Argo CD: Module 1 first explains the GitOps principles and the architectural differences between Argo CD and Flux, then uses Argo CD as the main thread, starting from the mechanics without repeating introductory operations.

1-hour time allocation

#TimeModuleCore contentAnimation / interactionLab (kind cluster lab)
0Before classEnvironment setupkind cluster lab, Helm, argocd CLI, GitHub repo gitops-lab skeleton (podinfo base + 3 overlays)Environment self-check listPush the repo skeleton,kustomize build local validation
100–06GitOps principlesOpenGitOps four principles, push vs pull, what GitOps is not, benefits and costs,Argo CD vs FluxPush / pull deployment comparison animation (credentials and drift)Manually create drift and observe that push-based deployment cannot detect it
206–13Argo CD architectureAPI Server, Repo Server, Application Controller, Redis, ApplicationSet, Dex, Notifications; CRDs; reconciliation triggersCore animation: one complete reconciliation loopCheck component Pods and logs one by one
313–21Install Argo CDHelm chart vs official manifests, values file, CRD lifecycle, initial password, port-forward, CLI login, core modehelm install component readiness simulationInstall v3.6.1, log in to the UI and CLI, change the password
421–28First Applicationsource (repoURL / targetRevision / path), destination, project, syncOptions, finalizerApplication field builder (live YAML generation and validation)CLI creation podinfo-dev and manual sync
528–35State modelSync Status × Health Status, resource-level and application-level health, v3 no longer writes health status into the CREvent → state combination simulatorProduce Degraded (wrong image) and Missing
635–42Diff, refresh and syncdiff rules, normal / hard refresh, polling every 120s + 60s jitter, Webhook, manual vs automatic sync, sync retriesChange detection timeline (polling / Webhook / manual refresh)Git commit upgrade 6.16.0 → 6.17.0
742–50Self-heal and pruneselfHeal, prune, allowEmpty, resource tracking (v3 default annotations), drift types, what will not be revertedDrift simulator (toggle selfHeal / prune)kubectl scale gets reverted, deleted files get pruned
850–60Readiness review and introductory troubleshootingPre-launch checklist, common errors, diagnostic command order, component logsReadiness scorecard + interactive troubleshooting treeReproduce and fix 3 common failures
—After classCheat sheet · Comprehensive labdeclarative argocd/apps/podinfo-dev.yaml, drift and self-heal, prune acceptanceFinal quiz (12 questions)Comprehensive lab

Knowledge Coverage Matrix

Target skillsM1M2M3M4M5M6M7M8Key commandsLab
Compare Argo CD and Flux and make a selection✓✓✓·····argocd vs flux CLIScenario questions
Judge whether a workflow complies with GitOps principles✓·····✓✓git log,argocd app historyDrift comparison
Explain component responsibilities and the reconciliation loop·✓✓·✓✓·✓kubectl -n argocd get pods,logsComponent inspection
Install / upgrade Argo CD with Helm··✓····✓helm upgrade --installInstall v3.6.1
CLI login and account security··✓····✓argocd login,account update-passwordChange the initial password
Write an Application (source / destination / options)···✓·✓✓·argocd app create,kubectl applypodinfo-dev
Kustomize base / overlay repository layout✓··✓·✓··kubectl kustomizegitops-lab skeleton
Read Sync / Health status·✓·✓✓✓✓✓argocd app getDegraded / Missing
Diff, refresh, manual / automatic sync·✓·✓·✓✓·app diff,app sync,--hard-refreshVersion upgrade
Drift, self-heal and prune✓····✓✓✓app set --self-heal --auto-prunescale gets reverted
Beginner troubleshooting (ComparisonError, etc.)·✓✓✓✓··✓app get, component logsreproduce 3 failures

What this course does not cover (and where to learn it)

TopicWhy it is not in this courseWhere to learn
Helm / multi-source Applications, Sync Waves, hooks, sync option details, ignoreDifferencesbelongs to “manifest sources and sync control”; this course only uses single-source KustomizeHour 2
App of Apps, ApplicationSet generatorsThis course manages only one applicationHour 3
multi-cluster (lab2), AppProject, RBAC, SSOThis course uses default projects and the local admin accountHour 4
Sealed Secrets, External Secrets, SOPSpodinfo does not need secretsHour 5
Argo Rollouts, Image Updater, Notifications, Kargoprogressive delivery and automationHour 6
HA, controller sharding, performance tuning, deep troubleshootingThis course only installs a single-replica lab environmentHour 7
Flux installation and use (HelmRelease, OCI, AKS GitOps extension)This course only does an architecture comparison (Module 1); the main thread is Argo CDHelm course Hour 5 · AKS course Hour 5
How CI modifies Git (image tag commits, PR workflow)belongs to the CI topicGitHub 8 hours · GitLab 8 hours

How to use this courseware

10 pages per module
Theory · diagrams · animation · commands · labs · production cases · troubleshooting · quiz · voice · video. Suggested: read “Theory” and “Animation” first, then do the “Lab” hands-on. The reconciliation loop animation in Module 2 is the course's “map”; every later module returns to it.
Learning progress
A quiz score of ≥ 70% or clicking “Mark this module complete” counts toward progress, saved in this browser (cleared on refresh if local storage is disabled).
Chinese voice
The “Voice” page reads the narration script aloud with the browser's built-in Web Speech API (en-US), with English terms pronounced in en-US; without a Chinese voice pack, the script can still be read or passed to a TTS tool.
Version notes This course is based on Argo CD v3.6.1 (released 2026-11-04, marked as the latest stable release on GitHub Releases), Helm chart argo/argo-cd 10.18.0 (2026-11-11, appVersion v3.6.1). Patch lines still maintained are v3.5.7, v3.4.13 and v3.3.19 (2026-11-02). Readers upgrading from v2 should pay special attention to the v3.0 behavior changes: use annotations by default for resource tracking,viewing logs requires explicitly logs, get permissions,update/delete fine-grained RBAC no longer inherited by managed resources,argocd-cm in the repositories and other legacy repo configuration removed; resource health status is no longer written to the Application CR by default,ignoreResourceStatusField default becomes all. The cluster is kind v0.33.0's default Kubernetes v1.37.0; the official Argo CD “tested Kubernetes versions” table follows the release notes.

Module 0 · Environment setup: kind cluster, tools and gitops-lab repo

The lab environment shared across this 8-hour course starts here: the cluster lab, Argo CD (installed in Module 3), your own GitHub repo gitops-lab
Before class ≈ 15 minuteskind v0.33.0 · v1.37.0A GitHub account is required
Prerequisites
  • Lab machine: Ubuntu 24.04 (Azure VM Standard_D4s_v5 or local machine), or macOS / Windows WSL2; Docker Engine / Docker Desktop available, with at least 4 vCPU and 8 GiB RAM (all Argo CD components + podinfo's 3 environments use about 1.5–2 GiB).
  • Tools: kubectl 1.37,kind v0.33.0,helm (the Helm course uses v4; v3.x can also install this chart),git,argocd CLI v3.6.1 (step 2 on this page).
  • A GitHub account, used to create the repo gitops-lab (a public repo is recommended so this course does not handle credentials; for private repos see Module 4 troubleshooting).
Connection to the prerequisite courses: If you still have the kind cluster from the Kubernetes course lab (context kind-lab, 1 control-plane + 2 workers), reuse it directly; namespaces already in it shop will not affect this course. If you have no results from the previous course, follow step 1 below to create one from scratch; this is the course's “minimum starting point”.

Step 1: create (or reuse) the kind cluster lab

kind get clusters                      # if lab already exists, skip to step 2
mkdir -p ~/gitops-lab/bootstrap
cat > ~/gitops-lab/bootstrap/kind-lab.yaml <<'EOF'
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
name: lab
nodes:
- role: control-plane
  image: kindest/node:v1.37.0@sha256:a1ed56cfb0e7b93589bdf97c8cd566405a265939e3620fc4f5de89adff580ae5
- role: worker
  image: kindest/node:v1.37.0@sha256:a1ed56cfb0e7b93589bdf97c8cd566405a265939e3620fc4f5de89adff580ae5
- role: worker
  image: kindest/node:v1.37.0@sha256:a1ed56cfb0e7b93589bdf97c8cd566405a265939e3620fc4f5de89adff580ae5
EOF
kind create cluster --config ~/gitops-lab/bootstrap/kind-lab.yaml
kubectl config use-context kind-lab
kubectl get nodes
Creating cluster "lab" ...
 ✓ Ensuring node image (kindest/node:v1.37.0) 🖼
 ✓ Preparing nodes 📦 📦 📦
 ...
Set kubectl context to "kind-lab"
NAME                STATUS   ROLES           AGE   VERSION
lab-control-plane   Ready    control-plane   60s   v1.37.0
lab-worker          Ready    <none>          40s   v1.37.0
lab-worker2         Ready    <none>          40s   v1.37.0

The kind config file is placed under bootstrap/ , so that “how to rebuild the cluster” itself enters Git; this is the first step of GitOps thinking. Node image digests match the Kubernetes course (the v1.37.0 image given in the kind v0.33.0 release notes).

Step 2: install the argocd CLI v3.6.1

# Linux amd64 (macOS can use brew install argocd; check the version)
VERSION=v3.6.1
curl -sSL -o /tmp/argocd https://github.com/argoproj/argo-cd/releases/download/${VERSION}/argocd-linux-amd64
sudo install -m 555 /tmp/argocd /usr/local/bin/argocd
rm /tmp/argocd
argocd version --client --short
argocd: v3.6.1+<commit>
Version alignment CLI and server major/minor versions should match (all use v3.6.x). Since v3.0, the RBAC subject for Dex SSO has changed to federated_claims.user_id, and the official upgrade notes require using the new CLI to obtain tokens containing the correct claims; this is used in Hour 4 when doing SSO.

Step 3: create GitHub repo gitops-lab and write the skeleton

Create a new one on the GitHub website empty repo gitops-lab (do not tick README), then initialize it locally. All the files below are the directory conventions shared by Hours 1–8; later courses will only add content into them.

cd ~/gitops-lab
git init -b main
mkdir -p apps/podinfo/base apps/podinfo/overlays/{dev,staging,prod} \
         argocd/apps argocd/appsets argocd/projects bootstrap
touch argocd/appsets/.gitkeep argocd/projects/.gitkeep
gitops-lab/
├── README.md
├── apps/
│   └── podinfo/
│       ├── base/                  # Kustomize base: Deployment + Service
│       │   ├── kustomization.yaml
│       │   ├── deployment.yaml
│       │   └── service.yaml
│       └── overlays/
│           ├── dev/kustomization.yaml       # podinfo-dev, 1 replica, 6.16.0
│           ├── staging/kustomization.yaml   # podinfo-staging, 2 replicas
│           └── prod/kustomization.yaml      # podinfo-prod, 3 replicas
├── argocd/
│   ├── apps/                      # Application manifests (this lesson: podinfo-dev.yaml)
│   ├── appsets/                   # ApplicationSet (Hour 3)
│   └── projects/                  # AppProject (Hour 4)
└── bootstrap/
    ├── kind-lab.yaml              # cluster definition
    └── argocd-values.yaml         # Argo CD Helm values (Module 3)

apps/podinfo/base/deployment.yaml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: podinfo
  labels:
    app.kubernetes.io/name: podinfo
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: podinfo
  template:
    metadata:
      labels:
        app.kubernetes.io/name: podinfo
    spec:
      containers:
      - name: podinfod
        image: ghcr.io/stefanprodan/podinfo:6.17.0
        ports:
        - name: http
          containerPort: 9898
          protocol: TCP
        env:
        - name: PODINFO_UI_MESSAGE
          value: "hello from base"
        readinessProbe:
          httpGet:
            path: /readyz
            port: http
          periodSeconds: 5
        livenessProbe:
          httpGet:
            path: /healthz
            port: http
          periodSeconds: 10
        resources:
          requests:
            cpu: 10m
            memory: 32Mi
          limits:
            memory: 128Mi

apps/podinfo/base/service.yaml

apiVersion: v1
kind: Service
metadata:
  name: podinfo
  labels:
    app.kubernetes.io/name: podinfo
spec:
  type: ClusterIP
  selector:
    app.kubernetes.io/name: podinfo
  ports:
  - name: http
    port: 9898
    targetPort: http
    protocol: TCP

apps/podinfo/base/kustomization.yaml

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- deployment.yaml
- service.yaml

apps/podinfo/overlays/dev/kustomization.yaml

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: podinfo-dev
resources:
- ../../base
images:
- name: ghcr.io/stefanprodan/podinfo
  newTag: "6.16.0"          # Module 6 upgrades this via a Git commit to 6.17.0
replicas:
- name: podinfo
  count: 1
patches:
- target:
    kind: Deployment
    name: podinfo
  patch: |-
    - op: replace
      path: /spec/template/spec/containers/0/env/0/value
      value: "hello from dev"

apps/podinfo/overlays/staging/kustomization.yaml

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: podinfo-staging
resources:
- ../../base
images:
- name: ghcr.io/stefanprodan/podinfo
  newTag: "6.16.0"
replicas:
- name: podinfo
  count: 2
patches:
- target:
    kind: Deployment
    name: podinfo
  patch: |-
    - op: replace
      path: /spec/template/spec/containers/0/env/0/value
      value: "hello from staging"

apps/podinfo/overlays/prod/kustomization.yaml

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: podinfo-prod
resources:
- ../../base
images:
- name: ghcr.io/stefanprodan/podinfo
  newTag: "6.16.0"
replicas:
- name: podinfo
  count: 3
patches:
- target:
    kind: Deployment
    name: podinfo
  patch: |-
    - op: replace
      path: /spec/template/spec/containers/0/env/0/value
      value: "hello from prod"
    - op: replace
      path: /spec/template/spec/containers/0/resources/limits/memory
      value: 256Mi

README.md

# gitops-lab

GitOps repository for the 8-hour Argo CD course (default branch main).

- apps/      workload manifests (Kustomize / Helm); Argo CD reads the desired state from here
- argocd/    Argo CD's own objects: apps/ (Application), appsets/, projects/, root.yaml
- bootstrap/ bootstrap files: kind cluster definition, Argo CD Helm values

Rule: every change to the cluster goes through a Pull Request merged into main; no direct kubectl apply.

Step 4: local validation and push

cd ~/gitops-lab
kubectl kustomize apps/podinfo/overlays/dev | grep -E 'namespace:|image:|replicas:|hello from'
git add -A
git commit -m "gitops-lab skeleton: podinfo base + dev/staging/prod overlays"
git remote add origin https://github.com/<you>/gitops-lab.git
git push -u origin main
  namespace: podinfo-dev
  namespace: podinfo-dev
  replicas: 1
          value: hello from dev
        image: ghcr.io/stefanprodan/podinfo:6.16.0
Note Replace <you> with your GitHub username; all following https://github.com/<you>/gitops-lab.git is the same. kubectl kustomize Use the Kustomize built into kubectl; Argo CD's repo-server renders with its own bundled kustomize binary, so the two versions may differ. Hour 2 explains how to pin the version. Note that the base image is 6.17.0, and the dev overlay uses images.newTag changed to 6.16.0 — this is so that Module 6 can demonstrate an “upgrade” with a single Git commit.

Warm-up: answer from memory (30 seconds)

What does a Kubernetes “controller” do?

An infinite loop: watch the actual state → compare it with the desired state (spec) → take action to close the gap → write back status. Argo CD's Application Controller extends this same pattern to “desired state in Git vs actual state in the cluster”.

helm upgrade --install Afterwards, someone kubectl edit changed the replica count. Will Helm know?

No. Helm only compares when you run a command (three-way merge); normally no process watches the cluster. This is exactly the “drift” problem Module 1 addresses.

Environment self-check list

Module 1 · GitOps principles: declarative, versioned, pull-based, continuously reconciled

00:00 – 06:00 · GitOps is not “putting YAML into Git”; it is “having an agent in the cluster keep pulling reality back to what Git describes”
6 minutesOpenGitOps v1.0.0★★★★☆
Learning objectives
  • Recite and explain the four OpenGitOps principles: Declarative, Versioned and Immutable, Pulled Automatically, Continuously Reconciled.
  • Compare push-based (inside CI, kubectl apply / helm upgrade) and pull-based (in-cluster agent) deployment in terms of credential exposure, drift detection, rollback and auditing.
  • Recognize “pseudo-GitOps”: YAML in Git but pushed by CI, someone bypassing Git to change the cluster directly, or Git holding only templates with no fixed version; weigh the benefits and costs of GitOps.
  • Compare Argo CD and Flux by object model, UI, multi-tenancy, multi-cluster and Helm handling Argo CD and Flux, and make a selection for a given scenario.
Prerequisites: The Kubernetes controller pattern; the GitOps introduction in Hour 5 of the Helm course. Importance:★★★★☆ (the basis for all later design decisions)

What: what GitOps is

GitOps is an operations model: the system's desired state is stored as declarative files in a version control system (usually Git), and a software agent running in the target environment automatically pulls these declarations and continuously reconciles the actual state to the desired state. The OpenGitOps working group under CNCF summarizes this as 4 principles (v1.0.0):

PrincipleKey points of the original textHow it appears in Argo CDTypical symptoms when violated
1. DeclarativeThe system's desired state is expressed declarativelyKubernetes manifests, Kustomize, Helm chart + values; the Application itself is also a CRDeployment relies on a chain of imperative scripts (kubectl scale,set image)
2. Versioned and ImmutableStorage of the desired state is enforced as immutable and versioned, with full history retainedGit commit SHA; targetRevision resolved to a concrete SHA and recorded in sync historyImages used with latest; chart version not pinned; force push rewrites history
3. Pulled AutomaticallyA software agent automatically pulls desired-state declarations from the sourcerepo-server periodically git fetch (default 120s + up to 60s jitter), or triggered by a WebhookCI holds cluster-admin credentials and “pushes” changes in
4. Continuously ReconciledThe agent continuously observes the actual state and attempts to apply the desired stateApplication Controller watches the cluster, computes the diff, auto-syncs + selfHealAligned only at deploy time; later manual changes go unnoticed (drift)

Why: why GitOps

  • Security: with pull-based deployment, cluster credentials never leave the cluster; CI only needs Git write access (push a commit or open a PR), not a kubeconfig.
  • Auditable and rollback-able: every change is a commit (who, when, why, who approved), and rollback is just git revert.
  • Drift detection and self-heal: the controller compares continuously; manual changes show as OutOfSync, and with selfHeal enabled they are automatically reverted.
  • Disaster recovery: a new cluster with Argo CD installed, pointed at the same repo, can rebuild all applications (Hour 3, App of Apps).
  • Developer experience: developers only deal with Git / PRs; the platform team sets boundaries through repo structure and AppProject.

How: the lifecycle of a change

Developer commits code → CI builds and pushes the image podinfo:6.17.0 → CI (or a human, or Image Updater) commits to gitops-lab the commit “change dev's newTag to 6.17.0” → merged into main → Argo CD detects the new commit at the next poll or Webhook → repo-server renders the manifests → controller computes the diff → sync (kubectl apply semantics) → health check → status and history written back to the Application.

When: when it fits / does not fit

  • Suitable: applications and platform components on Kubernetes (Ingress controllers, cert-manager, monitoring stacks), multi-environment / multi-cluster setups, teams with audit requirements.
  • Needs extra design: secrets (cannot be stored in plaintext in Git; Hour 5), database schema migrations (hooks and Sync Waves; Hour 2), production releases that need manual approval (PR approval + sync windows).
  • Not a great fit: frequently changing runtime data (current HPA replica count, Job instances), cloud resources themselves (usually Terraform, or Crossplane to turn them into K8s resources and then GitOps them).

Comparison with similar technologies

Push-based CI/CD (kubectl / helm in CI)Argo CDFlux CD
Who performs the deploymentCI runner (outside the cluster)Application Controller inside the clusterkustomize-controller / helm-controller inside the cluster
Where cluster credentials liveIn CI secret variablesIn-cluster ServiceAccountIn-cluster ServiceAccount
Drift detectionNone (only overwritten at the next deployment)Continuous comparison + visual diff in UI + selfHealContinuous reconciliation (periodic re-apply)
InterfaceCI logsWeb UI, CLI, API, multi-tenant RBACMainly CLI; UI needs a third party
Helm semanticsA real Helm releasehelm template Rendered and then applied by Argo CD (no Helm release record)helm-controller uses the Helm SDK and keeps the release

Note: the OpenGitOps original text says “state store” and does not require Git. OCI image registries (Flux's OCIRepository, Argo CD's OCI sources) can equally satisfy “versioned and immutable”. Git is just the most common implementation.

What GitOps is not

Looks like GitOpsWhich principle is missingWhy it does not count
Runs after CI merges kubectl apply -f k8s/ or helm upgrade③ pull, ④ continuous reconciliationDeployment happens only at the moment the pipeline runs; CI holds cluster credentials; later drift goes unnoticed
YAML is in Git, but people often also use kubectl edit to change production② source of truthGit is no longer the only source of truth; rolling back to a commit cannot reproduce the real state
Manifest references image: app:latest, chart version written *② immutableThe same commit renders different results at different times
Deployment script deploy.sh calls the API step by step① declarativeDescribes “how to do it”; the agent cannot compare “desired vs actual”
A CronJob in the cluster runs every hour kubectl apply once④ (partial)Close to pull-based, but has no diff detection, health assessment, status feedback or pruning; deleted files stay in the cluster forever

Benefits and costs

Benefits
  • Credentials never leave the cluster; CI only needs Git write access
  • Changes = PRs: review, approval, audit, rollback (git revert)
  • Drift is visible and self-healing
  • Disaster recovery: a new cluster pointed at the same repo can be rebuilt
  • Environment differences made explicit (diff of overlays / values)
Costs
  • One more platform component that must be operated, upgraded and monitored
  • Secrets cannot be stored in plaintext in Git; extra tooling is needed (Hour 5)
  • “Emergency manual changes” need a process (pause auto-sync / commit afterwards)
  • Repo structure, branches and promotion strategy must be designed (environments = directories, not branches)
  • Debugging chain gets longer: Git → render → diff → apply → health

Argo CD vs Flux: two mainstream GitOps implementations

Both are CNCF graduated projects and both satisfy the four principles. This course chooses Argo CD; Flux was already practiced in Hour 5 of the Helm course(HelmRelease, OCI charts) and Hour 5 of the AKS course(the AKS GitOps extension microsoft.flux). Here it is only compared at the architecture level, without re-teaching. Verified versions: Argo CD v3.6.1 (2026-11-04), Flux v2.10.0 (2026-10-26).

DimensionArgo CDFlux (v2 / GitOps Toolkit)
Core API objectsApplication (one source → one target),ApplicationSet (template + generator),AppProject (boundary)Sources: GitRepository / OCIRepository / HelmRepository / Bucket; applications: Kustomization,HelmRelease; plus notification and image-automation CRDs
ArchitectureAll-in-one: API Server + Repo Server + Application Controller + RedisA set of independent controllers: source-controller, kustomize-controller, helm-controller, notification-controller, image-reflector / image-automation-controller
InterfaceBuilt-in Web UI (resource tree, diff, logs, manual sync), CLI, APIMainly CLI (flux) and CRDs; UI comes from third parties or cloud platforms (such as the GitOps view in the Azure portal)
Multi-tenancy modelArgo CD's own RBAC (Casbin policies) + SSO groups + AppProject restricting source / destination / resource kindsEntirely relies on Kubernetes RBAC: each tenant's Kustomization / HelmRelease uses serviceAccountName impersonating a restricted SA
Multi-clusterCommonly hub-and-spoke: one Argo CD manages multiple registered clusters (or one per cluster)Commonly one per cluster Flux, each pulling from the same repo; remote clusters can also be referenced with kubeConfig
Helm handlingrepo-server uses helm template to render plain manifests and then apply them: no Helm release record,helm list not visible; Helm hooks are mapped to Argo CD hooks, and lookup and similar functions behave differentlyhelm-controller uses Helm SDK to perform the real install / upgrade: keeps release history and supports Helm-native hooks, tests and failure rollback (remediation)
Drift handlingContinuous comparison, UI shows the diff; corrected immediately when selfHeal is onRe-applied periodically by interval ; HelmRelease can enable drift detection
Bootstrap methodHelm / manifest install (this course), can self-manage laterflux bootstrap Commit Flux's own manifests to Git and self-manage
How to chooseChoose Argo CD: you need a visual interface and self-service for dev teams, centralized management of multiple clusters, fine-grained RBAC + SSO, and want to see diffs and resource trees in the UI. Choose Flux: you prefer “pure Kubernetes-native”, lightweight components without a UI, rely on Helm-native semantics (release history, hooks, automatic rollback), or use a managed cloud GitOps extension (AKS / Azure Arc's microsoft.flux). Avoid letting both manage the same object; they will keep “correcting” each other.
Common misconceptions① “Putting manifests in Git is GitOps” — if CI still runs kubectl apply, the “pull” and “continuous reconciliation” parts are missing, and manual changes will not be detected. ② “GitOps means you cannot use kubectl” — read operations during troubleshooting are perfectly fine, and in an emergency you can change things temporarily, but then either commit to Git afterwards or accept that selfHeal will revert them. ③ “GitOps only applies to Kubernetes” — the principles are platform-independent; Kubernetes's declarative API and controller pattern simply make it easiest to adopt. ④ “With Argo CD you no longer need CI” — building, testing and image scanning remain in CI; GitOps takes over only the “deployment” stage.

Comparison diagram: push vs pull

Push-based (Push) Developergit push code CI RunnerHolds kubeconfig (high privilege) kube-apiserverNeeds network access open to CI Later kubectl editNobody notices → drift apply Pull-based (Pull / GitOps) Developer / CIChanges only Git (PR) Git repository gitops-labSingle source of truth · immutable history Cluster lab (Argo CD runs inside the cluster) Argo CDPull · compare · sync Workloadspodinfo-dev fetch apply watch actual state → detect drift → self-heal
Figure 1-1: pull-based moves “the identity that performs deployment” from CI into the cluster and adds the continuous comparison step

Principle relationship diagram: all four principles are required

① Declarative“What is wanted” rather than “how to do it” ② Versioned · immutableCommit SHA identifies each state ③ Automatically pulledThe agent actively fetches ④ Continuously reconciledObserve → compare → act → loop ①② decide “where the desired state lives and what it looks like” ③④ decide “who makes reality catch up with it, and how often”
Figure 1-2: doing only ①② is “configuration as code”; adding ③④ makes it GitOps

Interactive animation: the different outcomes of the same “manually change the replica count” under push vs GitOps

Click “Next” to step through. The left is the push-based pipeline; the right is Argo CD (with automatic sync and selfHeal enabled). Observe where the credentials live and whether the drift is detected.

Push-based
CI holds the kubeconfig
Git: replicas=2 · cluster: —
Pull-based (Argo CD)
Credentials exist only inside the cluster
Git: replicas=2 · cluster: —

Commands related to this module (conceptual level)

CommandPurposeGitOps perspective
git log --oneline -- apps/podinfo/overlays/devView the change history of the dev environment“Who changed dev, and when” — auditing is the Git history
git revert <sha>Generate a reverse commitThe recommended GitOps rollback method (keeps Git = cluster)
kubectl diff -k apps/podinfo/overlays/devCompare the local manifests with the clustera one-off manual comparison; Argo CD turns it into a continuous, automatic one
argocd app history podinfo-devsync history (each entry corresponds to a Git SHA)trace back from a deployment to its commit
argocd app diff podinfo-devGit render output vs live cluster statedirect evidence of drift (Module 6)
# Experience “without GitOps, drift cannot be detected” (do this before installing Argo CD in Module 3)
kubectl create namespace drift-demo
kubectl apply -k ~/gitops-lab/apps/podinfo/base -n drift-demo
kubectl -n drift-demo scale deploy podinfo --replicas=3     # “emergency manual scale-out”
kubectl diff -k ~/gitops-lab/apps/podinfo/base -n drift-demo; echo "exit=$?"
deployment.apps/podinfo scaled
diff -u -N /tmp/LIVE-1234/apps.v1.Deployment.drift-demo.podinfo /tmp/MERGED-5678/apps.v1.Deployment.drift-demo.podinfo
@@ -6,7 +6,7 @@
-  generation: 2
+  generation: 3
...
-  replicas: 3
+  replicas: 1
exit=1

Note:kubectl diff It only tells you about drift if you remember to run it; exit code 1 means there is a difference. Common errors: Writing -k as -f pointing at a directory bypasses Kustomize and parses kustomization.yaml directly, which errors. Cleanup:kubectl delete namespace drift-demo.

Lab 1: do a GitOps health check on your current deployment workflow (about 4 minutes)

Reproduce the push-based drift blind spot: follow the drift-demo steps in the “Commands” page and record the READY column of kubectl get deploy -n drift-demo (3/3), whereas Git says 1.
Answer 4 questions (each maps to one principle; write them at the gitops-lab/README.md end as a team convention):
## GitOps health check
1. Declarative: can the environment's entire desired state be rendered from the repo alone? (Can kubectl kustomize produce the complete manifests?)
2. Versioned: are image tags pinned (no latest)? Is force push to main forbidden?
3. Pull-based: does CI still hold the production cluster kubeconfig?
4. Continuous reconciliation: how long until a manual change is detected? Who gets notified?
Protect the main branch on GitHub (Settings → Branches / Rulesets): require PRs and forbid force push. This is how “versioned and immutable” is implemented on the platform. For detailed steps see GitHub 8 hours.
Cleanup:
kubectl delete namespace drift-demo
cd ~/gitops-lab && git add README.md && git commit -m "docs: gitops checklist" && git push

Case 1: a kubeconfig leaked from CI

Problem: A team stored the production cluster's cluster-admin kubeconfig in CI variables, and a poisoned third-party Action read it and exfiltrated it. Approach: Migrate to Argo CD pull-based deployment: CI only has gitops commit access to the repo (fine-grained PAT or GitHub App), and the cluster API is no longer open to the CI network. Limitation: Git write access itself becomes a new critical asset and must be paired with branch protection, CODEOWNERS and signed commits.

Case 2: a “hotfix” overwritten by the next release

Problem: An on-call engineer fixed a configuration in the middle of the night; kubectl set env the routine release the next day overwrote it and the incident recurred. Approach: After enabling Argo CD, manual changes immediately show as OutOfSync, and with selfHeal enabled they are reverted within seconds. This forces the habit of “open a PR first, then fix”; in emergencies, temporarily turn off auto-sync in the UI and commit afterwards. Limitation: Requires incident process support (who may turn off auto-sync, and how soon a commit must follow).

Case 3: auditors ask “who approved this production change”

Approach: Changes to the production overlay must go through a PR with two-person approval; Argo CD sync history records the Git SHA, so any deployment can be traced back to its PR and approvers. Limitation: If parameter overrides are allowed in the UI during sync, state appears that exists outside Git; production projects should forbid this (Hour 4 RBAC).

Common “pseudo-GitOps” problems and fixes

The version running in the cluster differs from Git, with no alert at all

Cause: Deployment still happens through a push-based pipeline with no continuous comparison; or the Argo CD application has automatic sync off and nobody looks at the UI.

argocd app list -o wide | grep -v Synced

Fix: Bring all environments under Argo CD; at minimum configure notifications for OutOfSync (Hour 6 Notifications).

image: ghcr.io/stefanprodan/podinfo:latest — Git has not changed, but the image in the cluster has

Cause: A mutable tag violates “versioned and immutable”; when Pods were recreated they pulled a new image, which the Git history cannot explain.

Fix: Use a pinned tag or digest (@sha256:); have CI or Image Updater commit the new tag back to Git.

After git push --force to main, Argo CD deployed a “past” version

Cause: After history was rewritten the branch pointed to an old commit, and Argo CD faithfully synced it.

git reflog; argocd app history podinfo-dev

Fix: Restore the correct commit; enable branch protection to forbid force push.

Command-line questions
1. With one command, show the commits and authors of the last 5 changes to the dev environment.
git -C ~/gitops-lab log -5 --format='%h %an %ad %s' --date=short -- apps/podinfo/overlays/dev
2. Without Argo CD, check once whether the dev manifests match the cluster, and judge from the exit code.
kubectl diff -k ~/gitops-lab/apps/podinfo/overlays/dev >/dev/null; echo $?   # 0 = match, 1 = differences, >1 = error
Scenario analysis question
A team says “we are already GitOps: all YAML is in Git, and GitHub Actions runs helm upgrade after merge.” Please assess this and suggest improvements.

It satisfies declarative and versioned (provided the version is pinned), but not “automatically pulled” or “continuously reconciled”: CI holds cluster credentials, and manual changes go unnoticed. Improvement: deploy Argo CD in the cluster with an Application pointing at the same repo; change CI to only commit image tags; remove the CI kubeconfig; configure notifications for OutOfSync and gradually enable selfHeal. Note that Argo CD renders Helm with helm template , so when migrating, evaluate the differences between Helm hooks and lookup (Hour 2).

A platform team must roll out GitOps for 20 AKS clusters: the dev teams want a UI for self-service viewing of deployment status and diffs; the security team requires SSO and per-team isolation; and one team strongly depends on Helm release history and automatic rollback on failure. Argo CD or Flux?

Choose Argo CD as the main platform: a hub-and-spoke model with one control plane managing 20 clusters, a built-in UI (resource tree, diff), and SSO + RBAC + AppProject for per-team isolation (Hour 4). For the team that depends on native Helm semantics there are two options: evaluate switching to Argo CD hooks and sync retries / Rollouts to replace Helm's automatic rollback; or use Flux's HelmRelease only in their clusters / namespaces (for example via the AKS GitOps extension), but draw a clear boundary so that the same object is managed by only one tool.

Verified instructional videos

▶
What is GitOps, How GitOps works and Why it's so useful — TechWorld with Nana
English · GitOps concepts and push vs pull comparison; suitable for reviewing this module
▶
Argo CD - Applying GitOps Principles To Manage A Production Environment In Kubernetes — DevOps & AI Toolkit
English · a hands-on walkthrough of implementing GitOps principles with Argo CD (recorded earlier; for version details, follow this course)

Official docs

Video storyboard (about 90 seconds)

This courseware cannot directly generate video / MP3; the storyboard and narration script below can be handed to a video tool.

Shot 1 · 0–20s
Scene: a CI pipeline icon holds a key labeled kubeconfig and reaches toward the cluster.
Narration: in push-based deployment, CI carries the cluster key and pushes changes in. The key lives outside the cluster, and nobody watches the drift.
Shot 2 · 20–45s
Scene: the key is withdrawn into the cluster, and the Argo CD icon pulls from the Git repository with an arrow.
Narration: GitOps reverses the direction: an agent inside the cluster goes to Git itself to pull the desired state, and CI only needs to change Git.
Shot 3 · 45–70s
Scene: someone runs kubectl scale to 5, the replica icon turns yellow, and a few seconds later it returns to 1; the screen shows OutOfSync → Synced.
Narration: continuous reconciliation means any manual change will be detected, and with self-heal enabled it is reverted to what is in Git.
Shot 4 · 70–90s
Scene: four cards light up in turn: declarative, versioned, automatically pulled, continuously reconciled.
Narration: all four principles are required. Putting YAML into Git alone is not GitOps.
or score ≥ 70% on the quiz

Module 2 · Argo CD architecture: API Server, Repo Server, Application Controller and Redis

06:00 – 13:00 · three core processes + one cache, plus a few optional components; understand them and you have a map for all later troubleshooting
7 minutesv3.6.1 component list verified★★★★★
Learning objectives
  • State each component's responsibility and “what happens when it breaks”: argocd-server (API / UI / auth), argocd-repo-server (fetches Git, renders manifests), argocd-application-controller (compares, syncs, assesses health), Redis (cache).
  • State the optional components: ApplicationSet Controller, Dex (SSO), Notifications Controller, Commit Server (used by Source Hydrator).
  • Describe one reconciliation loop in order reconciliation loop: trigger → repo-server renders → controller compares with live state → computes Sync / Health → auto-sync / self-heal → writes back Application status.
Prerequisites: Kubernetes CRDs and controllers, and the watch mechanism. Importance:★★★★★

What: component list

Component (default resources in the Helm chart)TypeResponsibilityStateless?Behavior on failure
argocd-serverDeploymentgRPC / REST API, Web UI, authentication (local accounts / SSO), RBAC decisions; both the CLI and UI call itYesUI / CLI unavailable, but reconciliation continues (the controller does not depend on the server)
argocd-repo-serverDeploymentClones / fetches Git (or Helm / OCI repos), runs Kustomize, Helm (helm template), Jsonnet, CMP plugins, and returns rendered manifestsYes (has a local Git cache directory)Applications show ComparisonError, and Sync Status becomes Unknown
argocd-application-controllerStatefulSetWatches the live cluster state (a watch-based cache), compares desired and actual, performs sync, assesses health, and writes back to the Application statusNo (can be sharded by cluster; Hour 7)Status stops updating, no more auto-sync, no more self-heal
argocd-redisDeployment (redis-ha under HA)Caches render results, application resource trees and cluster info; not a source of truthCache (can be lost)Degraded performance, brief errors; refilled automatically after rebuild
argocd-applicationset-controllerDeploymentCreates Applications in bulk from generators (Hour 3)YesApplicationSet stops generating / updating applications
argocd-dex-serverDeploymentSSO proxy (GitHub, LDAP, SAML, etc.; Hour 4)YesSSO login fails; the local admin is unaffected
argocd-notifications-controllerDeploymentSends notifications based on triggers (Slack, Teams, Webhooks; Hour 6); merged into the Argo CD main repoYesNotifications stop being sent
argocd-commit-server (optional)DeploymentSource Hydrator commits rendered results back to Git (introduced in v3; disabled by default in the chart)Yes—

How: one reconciliation loop

  1. Triggers: ① periodic refresh (default timeout.reconciliation by default 120s, plus up to 60s of jitter, i.e. at most about 3 minutes); ② Git Webhook push to argocd-server; ③ the user clicks Refresh / CLI --refresh; ④ the controller sees a managed resource change (this only triggers a “comparison”, with no need to re-fetch Git).
  2. Resolve version: the controller asks repo-server to resolve targetRevision: main to a concrete commit SHA.
  3. Render: if the “SHA + source config” is already cached in Redis, it is returned directly; otherwise repo-server fetches that commit, runs kustomize build (or helm template etc.) to get the manifest list, and writes it to the cache.
  4. Compare: the controller compares the desired manifests one by one against its cluster cache (the live objects maintained via watch), normalizing first (ignoring defaults,ignoreDifferences, status fields, etc.), and derives Synced / OutOfSync for each resource.
  5. Health assessment: runs built-in (or Lua custom) health checks on each resource and aggregates them into the application-level Health.
  6. Action: if automatic sync is enabled and the application is OutOfSync (and this SHA has not previously failed to sync), the controller starts a sync operation: applies the manifests in order (kubectl apply semantics, or Server-Side Apply); with prune enabled, deletes extra resources; selfHeal makes an “OutOfSync caused only by a cluster change” also trigger a sync.
  7. Write back: writes status.sync,status.health,status.operationState,status.history etc. back to the Application CR; argocd-server pushes the changes to the UI via watch.

v3 change: resource-level health is by default no longer written to status.resources[].health (status.resourceHealthSource: appTree, read from the resource tree in Redis), to reduce writes to etcd; to restore the old behavior, set argocd-cmd-params-cm in controller.resource.health.persist: "true".

CRDs: Argo CD is itself declarative

  • Application (applications.argoproj.io): a “source → destination” mapping.
  • AppProject: the boundary for a group of applications (allowed repos, target clusters / namespaces, resource kinds). It comes with a built-in default project after installation.
  • ApplicationSet: templates + generators for Applications.
  • Configuration mainly lives in ConfigMaps / Secrets: argocd-cm (general settings),argocd-cmd-params-cm (component startup parameters),argocd-rbac-cm (RBAC),argocd-secret, and Secrets with argocd.argoproj.io/secret-type: repository|cluster labels (repository and cluster credentials).

Comparison with similar technologies

Argo CDFluxkubectl / Helm CLI
Where rendering happensA separate repo-server (isolatable, scalable, pluggable)source-controller fetches + kustomize/helm-controller rendersThe operator's own machine
Live statewatch cache (whole-cluster resource tree, visualized in UI)Queried at the reconciliation intervalNone
Multi-clusterOne control plane manages multiple clusters (cluster Secrets)Usually one installation per clusterMultiple kubeconfigs
Common misconceptions① “If argocd-server goes down, syncing stops” — sync is performed by application-controller; the server is only the API / UI. ② “Redis holds important data and must be backed up” — Redis is only a cache; the real state lives in Kubernetes objects (Application CRs, ConfigMaps, Secrets) and in Git. ③ “Argo CD re-applies every 3 minutes” — periodic refresh only re-compares; apply happens only when the app is OutOfSync and automatic sync is enabled. ④ “repo-server accesses the cluster” — it only renders and needs no cluster permissions (a deliberate security isolation point: plugin code runs in repo-server).

Architecture diagram: components and data flow

User / CIUI · argocd CLI · API Git repositorygitops-labHelm / OCI repository argocd namespace (cluster lab) argocd-serverAPI · UI · auth · RBAC argocd-dex-serverSSO (optional) argocd-repo-servergit fetch · kustomize buildhelm template · CMP argocd-redisManifest cache · resource tree application-controllerwatch · diff · synchealth · write back status applicationset · notificationscontroller (Hour 3 / 6) kube-apiserverApplication CRargocd-cm etc.Workloadspodinfo-dev(or remote cluster lab2) gRPC/HTTPS fetch GenerateManifests (gRPC) watch/apply Read/write Application CRs
Figure 2-1: the server faces people, repo-server faces Git, the controller faces the cluster; Redis is the cache shared by all three

Sequence diagram: reconciliation loop

controllerrepo-serverRedisGitkube-apiserver ① resolve main → SHA git ls-remote / fetch ② check cache (SHA + source) miss → kustomize build ③ rendered manifests ④ (already established) watch cache → compare diff · health assessment ⑤ OutOfSync and automated → apply / prune ⑥ PATCH Application status (sync / health / history) ⑦ resource tree written to Redis (read by UI)
Figure 2-2: message order of one reconciliation loop (on a cache hit, the Git render is skipped)

Core animation: one reconciliation loop

Choose a trigger scenario, then step through. The highlighted box is the component currently working; the terminal below shows real information (examples) that you would see in the corresponding component logs or CLI. Tick “automated / selfHeal” to observe the branch at step 5.

Triggerpolling / Webhook / watch repo-serverResolve SHA · render controllerdiff vs live state StatusSync / Health Auto-sync/ self-heal Write back Application statussync · health · operationState · history Cluster lab · podinfo-devDeployment podinfo · image 6.16.0 · replicas 1 watch apply / prune

Commands for observing the components

CommandPurposeNotes
kubectl -n argocd get pods,svc,sts,deployList all componentsThe controller is a StatefulSet, and its Pod name is fixed to argocd-application-controller-0
kubectl get crd | grep argoprojView CRDsapplications / applicationsets / appprojects
kubectl -n argocd logs sts/argocd-application-controllerReconciliation logssearch Reconciliation completed,Updated sync status
kubectl -n argocd logs deploy/argocd-repo-serverRender logssearch manifest,git,kustomize
kubectl -n argocd get cm argocd-cm -o yamlGeneral configurationtimeout.reconciliation,url, resource tracking method, etc.
kubectl -n argocd get cm argocd-cmd-params-cm -o yamlComponent parametersserver.insecure,controller.status.processors etc.
kubectl -n argocd get pods -o wide
kubectl -n argocd logs argocd-application-controller-0 --tail=200 | grep -E 'Reconciliation completed|Updated sync status|Updated health status' | tail -5
NAME                                                READY   STATUS    RESTARTS   AGE
argocd-application-controller-0                     1/1     Running   0          10m
argocd-applicationset-controller-6d8b7c9f7d-x2k4p   1/1     Running   0          10m
argocd-notifications-controller-7c9c6b8d5f-9bq7m    1/1     Running   0          10m
argocd-redis-5b6f8d7c9b-kd8sn                       1/1     Running   0          10m
argocd-repo-server-7f9d8c6b5d-mz2wq                 1/1     Running   0          10m
argocd-server-6c8b9f7d4c-p7lrx                      1/1     Running   0          10m

time="..." level=info msg="Reconciliation completed" application=argocd/podinfo-dev ... comparison-level=1 ... time_ms=48
time="..." level=info msg="Updated sync status: OutOfSync -> Synced" application=podinfo-dev ...
time="..." level=info msg="Updated health status: Progressing -> Healthy" application=podinfo-dev ...

How to read:comparison-level indicates how far this reconciliation went (only refreshed the resource tree / compared against cached manifests / re-rendered). Note: This course's values turn off Dex (Module 3), so there is no argocd-dex-server; in the chart, commit-server and redis-ha are off by default; for which components are actually enabled, refer to helm get values argocd -n argocd --all and the actual Pods are authoritative. Log formats and fields may differ slightly between versions.

Lab 2: component “health check” and fault injection (do after installing in Module 3, about 5 minutes)

List the components and CRDs:
kubectl -n argocd get deploy,sts,svc
kubectl get crd -o name | grep argoproj.io
customresourcedefinition.apiextensions.k8s.io/applications.argoproj.io
customresourcedefinition.apiextensions.k8s.io/applicationsets.argoproj.io
customresourcedefinition.apiextensions.k8s.io/appprojects.argoproj.io
Verify that “the cluster still reconciles when the server is down” (requires that Module 4 has created podinfo-dev with automatic sync enabled; you can come back after finishing Module 7):
kubectl -n argocd scale deploy argocd-server --replicas=0
kubectl -n podinfo-dev scale deploy podinfo --replicas=4      # create drift
sleep 15; kubectl -n podinfo-dev get deploy podinfo           # selfHeal still reverts it to 1
kubectl -n argocd scale deploy argocd-server --replicas=1
NAME      READY   UP-TO-DATE   AVAILABLE   AGE
podinfo   1/1     1            1           20m
Verify that “Redis is only a cache”:
kubectl -n argocd delete pod -l app.kubernetes.io/name=argocd-redis
kubectl -n argocd rollout status deploy/argocd-redis
argocd app get podinfo-dev --refresh | head -20     # briefly slower, then back to normal
Observe repo-server rendering:
argocd app manifests podinfo-dev --source git | grep -E 'kind:|image:'

--source git shows the desired manifests rendered by repo-server,--source live shows the live objects in the cluster.

Case 1: repo-server OOMKilled causes all applications to be Unknown

Problem: A large Helm chart (hundreds of templates) exceeded repo-server's memory limit while rendering, and every application showed ComparisonError … rpc error: code = Unavailable. Approach: Raise the repo-server memory limit and increase the replica count, and limit concurrent rendering with reposerver.parallelism.limit ; split the giant application. Limitation: Scaling repo-server cannot solve the memory peak of a single huge render; it must be optimized at the manifest structure level (Hour 7).

Case 2: mistaking a frozen UI for an Argo CD outage

Problem: An expired Ingress certificate made the UI unreachable; the on-call engineer restarted the controller, which actually triggered a full re-comparison. Approach: Separate by component: UI / CLI problems look at argocd-server and the Ingress; status not updating looks at the controller; ComparisonError looks at repo-server. Limitation: At large scale, a controller restart costs several minutes of cache rebuilding.

Case 3: security isolation for plugin code

Problem: A team wanted to run custom scripts during rendering. Approach: Run the Config Management Plugin as a sidecar inside the repo-server Pod; repo-server has no cluster access, and a NetworkPolicy allows it to reach only Git. Limitation: A plugin can still read the repository credentials mounted into repo-server, so plugin images must be reviewed (Hours 2 and 5).

Locate problems by component

ComparisonError: rpc error: code = Unavailable desc = connection error: ... dial tcp ...:8081: connect: connection refused

Cause: The controller cannot reach repo-server (port 8081): repo-server is not ready, is restarting from OOM, or is blocked by a NetworkPolicy.

kubectl -n argocd get pods -l app.kubernetes.io/name=argocd-repo-server
kubectl -n argocd describe pod -l app.kubernetes.io/name=argocd-repo-server | grep -A5 'Last State'

Fix: Restore repo-server; if it is OOM, raise memory or limit concurrency.

The UI opens, but application status does not change for minutes

Cause: application-controller is unhealthy, its work queue is backed up, or RBAC cannot watch certain resources.

kubectl -n argocd logs argocd-application-controller-0 --tail=100
kubectl -n argocd get pod argocd-application-controller-0

Fix: Check the errors in the logs; in large environments adjust controller.status.processors / controller.operation.processors or shard (Hour 7).

dial tcp: lookup argocd-redis on 10.96.0.10:53: no such host / redis: connection refused

Cause: Redis is not ready, or the Service name is inconsistent (for example, after enabling redis-ha the service name becomes argocd-redis-ha-haproxy).

kubectl -n argocd get svc | grep redis

Fix: Wait for Redis to be ready; when using the Helm chart, let the chart configure the Redis address automatically and do not override it by hand.

Command-line questions
1. View the desired manifests and the live manifests for podinfo-dev; each should show only the kind and image lines.
argocd app manifests podinfo-dev --source git  | grep -E '^kind:|image:'
argocd app manifests podinfo-dev --source live | grep -E '^kind:|image:'
2. View the current periodic refresh interval configuration.
kubectl -n argocd get cm argocd-cm -o jsonpath='{.data.timeout\.reconciliation}{" / jitter "}{.data.timeout\.reconciliation\.jitter}{"\n"}'
Scenario analysis question
All applications suddenly show Sync Status = Unknown, but Health is still Healthy and the workloads are normal. Which component is most likely at fault? Why are the workloads unaffected?

Most likely repo-server (or Git is unreachable): the controller cannot obtain the desired manifests, so it cannot compare, and Sync is Unknown; health assessment depends only on live state, so it can still compute Healthy. Argo CD is not in the data path, so a component failure does not affect running workloads; it only pauses “changes and self-healing”.

Verified instructional videos

▶
ArgoCD Tutorial for Beginners | GitOps CD for Kubernetes — TechWorld with Nana
English · Argo CD working model and architecture overview + beginner demo (recorded in the v2 era; installation methods and v3 defaults follow this course)
▶
Introduction to Argo CD : Kubernetes DevOps CI/CD — That DevOps Guy
English · introduction to components and workflow

Official docs

Video storyboard (about 100 seconds)

Shot 1 · 0–20s
Scene: three boxes appear in turn: server (person icon), repo-server (Git icon), controller (gear). Redis flashes in the middle.
Narration: Argo CD has three core processes: the API server facing people, the repo server facing Git, and the application controller facing the cluster. Redis is the cache they share.
Shot 2 · 20–50s
Scene: a new commit appears in Git, an arrow flows to repo-server, and a stack of YAML is generated.
Narration: each reconciliation, the controller first asks the repo server to resolve the branch to a commit SHA, then renders the manifests. Results for the same SHA are cached.
Shot 3 · 50–80s
Scene: desired manifests on the left, live cluster objects on the right; red diff lines appear in the middle and the status badge changes to OutOfSync.
Narration: the controller compares desired and actual one by one to derive the sync status; then it runs health checks to derive the health status.
Shot 4 · 80–100s
Scene: the automatic sync switch turns on, an apply arrow enters the cluster, the status badge changes to Synced and Healthy, and the result is written back to the Application.
Narration: with automatic sync on, the controller performs the apply, then writes the result back to the Application status, and the interface updates accordingly.
or score ≥ 70% on the quiz

Module 3 · Install Argo CD: Helm chart, core mode and CLI login

13:00 – 21:00 · declaratively install v3.6.1 with a values file, get the initial password, log in with the CLI, and understand Core headless mode
8 minutesargo-cd chart 10.18.0 → v3.6.1The lab uses a self-signed certificate★★★★★
Learning objectives
  • Compare three installation methods: the official manifests install.yaml (and the HA version), the official manifests core-install.yaml (core mode), and the community-maintained Helm chart argo/argo-cd, and explain why this course chooses the Helm chart.
  • Write ~/gitops-lab/bootstrap/argocd-values.yaml, and use helm upgrade --install to install the argocd release in the namespace argocd.
  • From argocd-initial-admin-secret get the initial password,port-forward access the UI,argocd login log in with the CLI, change the password and delete the initial Secret.
Prerequisites: The Helm course's values,helm upgrade --install, and the relationship between CRDs and Helm. Importance:★★★★★

What: three installation methods

MethodSourceContentsSuitable for
manifests/install.yamlargoproj/argo-cd repo (one manifest per version)All components, single replica; requires kubectl apply --server-side --force-conflicts (the CRDs are large)Quick trial, one-to-one correspondence with the official docs
manifests/ha/install.yamlSame as aboveMulti-replica + redis-haProduction (official manifest route)
manifests/core-install.yamlSame as aboveCore mode: only controller, repo-server, Redis, ApplicationSet, etc.,no API Server / UI, Dex or local usersPlatform teams that treat Argo CD only as an “in-cluster GitOps engine”, with access controlled by Kubernetes RBAC
Helm chart argo/argo-cdargoproj/argo-helm (community-maintained)All components corresponding to the official manifests, with all settings managed via valuesChosen by this course: configuration is centralized in one values file, which can be versioned, and later courses use helm upgrade incremental changes

The chart version and the Argo CD version are two separate numbering schemes: chart 10.18.0 → appVersion v3.6.1 (released 2026-11-11). When upgrading Argo CD, read Argo CD's upgrade notes first (the Upgrading page), then the changes for the corresponding major version in the chart's README.

How: this course's values file (full text)

# Argo CD Helm values — shared by the 8-hour Argo CD course
# chart: argo/argo-cd 10.18.0  (appVersion v3.6.1)
# Install/upgrade: helm upgrade --install argocd argo/argo-cd -n argocd --create-namespace \
#             --version 10.18.0 -f ~/gitops-lab/bootstrap/argocd-values.yaml
# Later courses only append/modify settings in this file, then repeat the command above.

global:
  # URL used to generate argocd-cm (UI links, SSO callbacks, links in notifications)
  # The lab accesses it via kubectl port-forward, so localhost:8080 is written
  domain: localhost:8080

crds:
  install: true
  keep: true          # keep CRDs (and the Application objects in them) on helm uninstall

configs:
  cm:
    # v3 defaults to annotations; written out explicitly here for review and cross-version consistency
    application.resourceTrackingMethod: annotation
    # Periodic refresh: 120s + up to 60s jitter (chart default, written out explicitly)
    timeout.reconciliation: 120s
    timeout.reconciliation.jitter: 60s
    admin.enabled: true
    exec.enabled: false
  params:
    # Keep argocd-server terminating TLS itself (self-signed certificate); port-forward to 443
    server.insecure: false

# Lab environment: no SSO (enabled and configured via dex.config in Hour 4)
dex:
  enabled: false

# Single-replica lab configuration (switched to HA in Hour 7)
controller:
  replicas: 1
server:
  replicas: 1
repoServer:
  replicas: 1
applicationSet:
  replicas: 1
redis-ha:
  enabled: false

# Notification controller kept (triggers and templates configured in Hour 6)
notifications:
  enabled: true

Every item corresponds to chart 10.18.0's values.yaml Keys in: global.domain,crds.install/keep,configs.cm (written to argocd-cm),configs.params (written to argocd-cmd-params-cm),dex.enabled,redis-ha.enabled,notifications.enabled.

Why: a few key design points

  • CRD lifecycle: Helm does not upgrade by default crds/ CRDs in the directory, whereas the argo-cd chart manages CRDs as ordinary templates (crds.install: true), and uses crds.keep: true plus helm.sh/resource-policy: keep, to avoid helm uninstall deleting the CRDs during uninstall, which would cascade-delete all Applications.
  • Initial password: a random password is generated on first start and stored in argocd-initial-admin-secret (plain base64). The official advice is to log in, change the password, and then delete this Secret; when needed you can use argocd admin initial-password to read it (while the Secret still exists).
  • TLS: argocd-server uses a self-signed certificate by default to serve both HTTPS and gRPC. --insecure only makes the CLI skip verification of this self-signed certificate; production should use a trusted certificate provided via Ingress / Gateway + cert-manager (Hour 4 / AKS course).
  • Who manages Argo CD itself: this course installs it manually with Helm (the bootstrap problem: you need Argo CD before you can do GitOps). Hour 3 turns Argo CD itself into an Application (“Argo CD manages itself”).

When: when to use core mode

Core mode suits scenarios where “cluster admins only want a GitOps engine and do not need a multi-tenant UI or SSO”: access control relies entirely on Kubernetes RBAC, and the CLI argocd login --core talks directly to the Kubernetes API using kubeconfig; when a temporary UI is needed, use argocd admin dashboard -n argocd to start a local UI. The cost is no Argo CD RBAC, SSO, Webhook receiver endpoint (no API Server), UI links in notifications, etc.

Comparison with similar technologies

Argo CD (Helm chart)Argo CD (official manifests)Flux (flux bootstrap)Managed service (AKS GitOps extension, etc.)
Configuration methodvalues fileKustomize overlay on official manifestscommit its own manifests to Git during bootstrapCloud platform API / CLI
Upgradehelm upgrade + change the chart versionchange the version number in the URLflux bootstrap re-runHandled by the platform
Common misconceptions① “argocd login --insecure “--insecure” means the connection is plaintext”——the connection is still TLS, it just does not verify the certificate. ② “Turning server.insecure: true the server's insecure flag on makes it safer”——on the contrary, it makes the server serve plain HTTP and should only be used behind an Ingress that terminates TLS. ③ “Chart version = Argo CD version”——10.18.0 is the chart version, corresponding to Argo CD v3.6.1. ④ “helm uninstall cleanly uninstalls”——CRDs are retained (keep), and the Application objects and the workloads they manage are still there; handle them with the “cleanup” steps.

Installation flow diagram

argocd-values.yamlGit: bootstrap/ helm upgrade--install argocd namespace argocdCRD ×3 · ConfigMap ×N · SecretDeploy ×5 · StatefulSet ×1 · Svc argocd-initial-admin-secretserver generates on first start kubectl port-forwardsvc/argocd-server 8080:443 Browser https://localhost:8080Self-signed certificate warning argocd loginlocalhost:8080 --insecure Change passwordDelete initial Secret
Figure 3-1 From the values file to a logged-in Argo CD

Core mode vs full installation

Full installation (this course) server + UIrepo-servercontrollerredisappset · notifdex (disabled) Core mode core-install.yaml no server/UIrepo-servercontrollerredisappsetAccess = K8s RBAC
Figure 3-2 Core mode removes the people-facing parts; the CLI uses --core direct access to the Kubernetes API

Interactive animation: after helm install, components become ready in turn

Click “Start install” and watch how Kubernetes creates each component. You can tick “Simulate slow repo-server image pull” to get a feel for helm --wait what it is waiting for.

Ready: will run helm upgrade --install argocd argo/argo-cd --version 10.18.0 -n argocd --create-namespace -f argocd-values.yaml --wait
$ helm repo add argo https://argoproj.github.io/argo-helm

Install and login commands

CommandPurposeKey parameters
helm repo add argo https://argoproj.github.io/argo-helmAdd the chart repositorythen helm repo update
helm search repo argo/argo-cd --versions | headList available chart versions and appVersionPin --version, do not use “latest”
helm upgrade --install argocd argo/argo-cdInstall or upgrade-n argocd --create-namespace --version 10.18.0 -f … --wait --timeout 10m
argocd admin initial-password -n argocdRead the initial passwordUses the current kubeconfig; no login required
kubectl -n argocd port-forward svc/argocd-server 8080:443Access the UI / API locallyKeep this terminal running
argocd login localhost:8080 --insecureCLI login--username admin --password …; credentials are saved in ~/.config/argocd/config
argocd account update-passwordChange the current account's password--current-password … --new-password …
argocd login --coreCore mode / bypass the API Serveruses kubeconfig; argocd admin dashboard start a local UI
helm repo add argo https://argoproj.github.io/argo-helm
helm repo update
helm search repo argo/argo-cd --versions | head -3
NAME            CHART VERSION   APP VERSION   DESCRIPTION
argo/argo-cd    10.18.0         v3.6.1        A Helm chart for Argo CD, a declarative, GitOps...
argo/argo-cd    10.17.2         v3.6.1        A Helm chart for Argo CD, a declarative, GitOps...
# First render to see what would be created (does not touch the cluster)
helm template argocd argo/argo-cd --version 10.18.0 -n argocd \
  -f ~/gitops-lab/bootstrap/argocd-values.yaml | grep -E '^kind:' | sort | uniq -c | sort -rn | head

How to verify: The rendered output should contain no dex-related Deployment (disabled in values). Common errors: Writing in values as configs.cm.timeout.reconciliation the nested form —argocd-cm the key name itself contains a dot, so it must be written as timeout.reconciliation: 120s a single key like this.

Lab 3: install Argo CD v3.6.1 and log in (about 7 minutes)

Write the values file: copy the argocd-values.yaml full text from the “Theory” page and save it to ~/gitops-lab/bootstrap/argocd-values.yaml, then commit:
cd ~/gitops-lab
git add bootstrap/argocd-values.yaml bootstrap/kind-lab.yaml
git commit -m "bootstrap: argo-cd chart 10.18.0 values" && git push
Install:
kubectl config use-context kind-lab
helm upgrade --install argocd argo/argo-cd \
  --namespace argocd --create-namespace \
  --version 10.18.0 \
  -f ~/gitops-lab/bootstrap/argocd-values.yaml \
  --wait --timeout 10m
helm list -n argocd
kubectl -n argocd get pods
Release "argocd" does not exist. Installing it now.
NAME: argocd
NAMESPACE: argocd
STATUS: deployed
REVISION: 1
...
NAME    NAMESPACE  REVISION  UPDATED  STATUS    CHART           APP VERSION
argocd  argocd     1         ...      deployed  argo-cd-10.18.0 v3.6.1

NAME                                                READY   STATUS      RESTARTS   AGE
argocd-application-controller-0                     1/1     Running     0          90s
argocd-applicationset-controller-6d8b7c9f7d-x2k4p   1/1     Running     0          90s
argocd-notifications-controller-7c9c6b8d5f-9bq7m    1/1     Running     0          90s
argocd-redis-5b6f8d7c9b-kd8sn                       1/1     Running     0          90s
argocd-redis-secret-init-xxxxx                      0/1     Completed   0          95s
argocd-repo-server-7f9d8c6b5d-mz2wq                 1/1     Running     0          90s
argocd-server-6c8b9f7d4c-p7lrx                      1/1     Running     0          90s

argocd-redis-secret-init is the chart's pre-install Job, which generates the Redis auth password (redisSecretInit.enabled: true by default); after completion it stays as Completed or is cleaned up — both are normal.

Access the UI (open a new terminal and keep it running):
kubectl -n argocd port-forward svc/argocd-server 8080:443

Open in the browser https://localhost:8080, accept the self-signed certificate warning. Username admin, password: see the next step. When running the lab on a remote VM, use ssh -L 8080:localhost:8080 user@vm to forward the port to the local machine.

Get the initial password and log in with the CLI:
ARGO_PWD=$(argocd admin initial-password -n argocd | head -1)
# Equivalent: kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath='{.data.password}' | base64 -d
argocd login localhost:8080 --username admin --password "$ARGO_PWD" --insecure
argocd version --short
argocd cluster list
'admin:login' logged in successfully
Context 'localhost:8080' updated
argocd: v3.6.1+...
argocd-server: v3.6.1+...
SERVER                          NAME        VERSION  STATUS   MESSAGE                                                  PROJECT
https://kubernetes.default.svc  in-cluster           Unknown  Cluster has no applications and is not being monitored.

in-cluster refers to the cluster where Argo CD itself runs (https://kubernetes.default.svc). With no applications, a status of Unknown is normal.

Change the password and delete the initial Secret:
argocd account update-password --current-password "$ARGO_PWD" --new-password 'Lab-Argo-2026!'
kubectl -n argocd delete secret argocd-initial-admin-secret
argocd login localhost:8080 --username admin --password 'Lab-Argo-2026!' --insecure
Security note The example password is for local lab use only. In production: log in via SSO and disable the local admin (admin.enabled: "false", Hour 4); do not write passwords into shell history (you can use read -s).
(Optional) Try the CLI in core mode: bypasses the API Server and uses kubeconfig directly:
kubectl config set-context --current --namespace=argocd
argocd login --core
argocd app list            # now goes through the Kubernetes API
kubectl config set-context --current --namespace=default
argocd login localhost:8080 --username admin --password 'Lab-Argo-2026!' --insecure   # switch back to normal mode
Outputs of this step (later courses depend on them) Helm release argocd (namespace argocd, chart argo-cd-10.18.0), values file ~/gitops-lab/bootstrap/argocd-values.yaml, CLI context localhost:8080. In later courses, all configuration changes follow the same pattern: edit values → commit → repeat this step's helm upgrade --install command.

Cleanup (do this after the course is fully finished)

helm uninstall argocd -n argocd           # CRDs are kept because of keep
kubectl get crd -o name | grep argoproj.io | xargs kubectl delete   # deletes the remaining Application and other objects
kubectl delete namespace argocd

Case 1: values go into Git, not the command line --set

Problem: Multiple people using different --set upgrade Argo CD; one upgrade lost the SSO configuration and nobody could log in. Approach: All settings are written in bootstrap/argocd-values.yaml, changes go through PRs; upgrade commands are fixed in the README / Makefile. Limitation: The bootstrap stage still needs one manual helm install; afterwards Argo CD can manage itself (Hour 3).

Case 2: accidentally deleting CRDs makes all applications disappear

Problem: To “reinstall cleanly”, someone deleted the applications.argoproj.io CRDs; all Application objects were cascade-deleted; applications with resources-finalizer also deleted their workloads. Approach: the chart's crds.keep: true; all Application manifests are in Git (argocd/apps/), so they can be rebuilt; use cascade-delete finalizers cautiously for production applications. Limitation: Rebuilding Applications triggers a full sync; the impact must be assessed.

Case 3: a private cluster cannot reach the public chart repository

Approach: Mirror the argo/argo-cd chart and images (quay.io/argoproj/argocd,ecr-public.aws.com/docker/library/redis etc.; follow the image settings in values) to an internal registry, and use global.image.repository etc. to override values. Limitation: New images must be mirrored on every upgrade.

Common install and login errors

FATA[0000] dial tcp [::1]:8080: connect: connection refused

Cause: port-forward is not running (or has disconnected).

Fix: Re-run in another terminal kubectl -n argocd port-forward svc/argocd-server 8080:443; port-forward disconnects when the Pod restarts and must be run again.

x509: certificate signed by unknown authority

Cause: argocd-server uses a self-signed certificate, and the CLI verifies certificates by default.

Fix: In the lab environment add --insecure; in production configure a trusted certificate (Ingress + cert-manager).

FATA[0000] rpc error: code = Unauthenticated desc = Invalid username or password

Cause: Wrong password; the initial Secret has been deleted; or the password has already been changed.

kubectl -n argocd get secret argocd-initial-admin-secret   # check whether it still exists

Fix: If the password is forgotten, the official FAQ approach is to clear the argocd-secret in admin.password and admin.passwordMtime and restart argocd-server to regenerate the initial password (lab environments only):

kubectl -n argocd patch secret argocd-secret -p '{"data": {"admin.password": null, "admin.passwordMtime": null}}'
kubectl -n argocd rollout restart deploy/argocd-server
Error: INSTALLATION FAILED: ... CustomResourceDefinition "applications.argoproj.io" ... exists and cannot be imported into the current release

Cause: The cluster already has Argo CD installed with kubectl apply -f install.yaml ; the CRDs do not belong to this Helm release.

Fix: In the lab environment, first uninstall the old installation (kubectl delete -n argocd -f install.yaml); when the CRDs must be kept, add Helm ownership labels and annotations to them (app.kubernetes.io/managed-by=Helm,meta.helm.sh/release-name=argocd,meta.helm.sh/release-namespace=argocd) and then install.

Error: context deadline exceeded (helm --wait timed out)

Cause: Slow or failed image pulls, or insufficient node resources.

kubectl -n argocd get pods
kubectl -n argocd describe pod POD | tail -20

Fix: Investigate the events ImagePullBackOff / Insufficient memory; once images can be pulled, re-run helm upgrade --install (idempotent).

Command-line questions
1. View the dex-related parts of all values actually in effect for the current release (including defaults).
helm get values argocd -n argocd --all | grep -A3 '^dex:'
2. Without logging in to the API Server, list all Applications.
kubectl -n argocd get applications.argoproj.io
# or: kubectl config set-context --current --namespace=argocd && argocd login --core && argocd app list
Scenario analysis question
The security team requires “Argo CD must not expose any web interface; only the platform team operates it with kubectl”. How would you install it? What is the cost?

Use core mode (core-install.yaml, or disable components such as server / dex in the chart; follow the chart documentation). Access control is delegated to Kubernetes RBAC, and the platform team uses argocd login --core or kubectl directly to manage Applications. Cost: no Argo CD RBAC / SSO / multi-tenant UI, no Webhook receiver endpoint (polling only; change detection takes up to about 3 minutes), and UI links in notifications are unavailable; when a temporary UI is needed, use argocd admin dashboard.

Verified instructional videos

▶
ArgoCD Tutorial: Step-by-Step Installation and UI App Deployment | KodeKloud — KodeKloud
English · installation, initial password, deploying the first application via the UI (versions and install methods in the video may differ from this course; follow v3.6.1 + chart 10.18.0 in this course)
▶
Argo CD Demo — Argo Proj
English · early demo from the official Argo project channel; useful for understanding the UI and basic workflow

Official docs

Video storyboard (about 90 seconds)

Shot 1 · 0–20s
Scene: the editor opens argocd-values.yaml, highlighting global.domain and dex.enabled false.
Narration: first write all installation settings into one values file and commit it to the bootstrap directory in Git.
Shot 2 · 20–45s
Scene: the terminal runs helm upgrade --install, and the Pods change to Running one by one.
Narration: install with a pinned chart version. Chart 10.18.0 corresponds to Argo CD 3.6.1.
Shot 3 · 45–70s
Scene: port-forward, browser certificate warning, login page.
Narration: access the UI through port forwarding; the initial password is in argocd-initial-admin-secret.
Shot 4 · 70–90s
Scene: argocd login succeeds, update-password runs, the initial Secret is deleted.
Narration: after logging in on the command line, change the password immediately and delete the initial password Secret.
or score ≥ 70% on the quiz

Module 4 · First Application: source, destination and sync

21:00 – 28:00 · Application = “where it is fetched from (source)” + “where it is placed (destination)” + “how it is synced (syncPolicy)”
7 minutesargoproj.io/v1alpha1★★★★★
Learning objectives
  • Read and write the key Application fields: project,source.repoURL / targetRevision / path,destination.server|name / namespace,syncPolicy.syncOptions, and the resource-deletion finalizer.
  • Use argocd app create to create podinfo-dev, then run the first manual sync and wait for health.
  • Understand that “the Application itself is a declarative object”: it should be placed in the Git argocd/apps/ directory (the comprehensive lab completes this step).
Prerequisites: Module 0's repo skeleton and Module 3's CLI login. Importance:★★★★★

What: the structure of an Application

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: podinfo-dev
  namespace: argocd                 # the Application object lives in the namespace where Argo CD runs
spec:
  project: default                  # AppProject: restricts usable sources and destinations (Hour 4)
  source:
    repoURL: https://github.com/<you>/gitops-lab.git
    targetRevision: main            # branch / tag / commit SHA; HEAD = default branch
    path: apps/podinfo/overlays/dev # if the directory contains kustomization.yaml → automatically detected as Kustomize
  destination:
    server: https://kubernetes.default.svc   # in-cluster; or use name: in-cluster
    namespace: podinfo-dev          # applies only to “resources without a namespace set”
  syncPolicy:
    syncOptions:
    - CreateNamespace=true          # create the target namespace if it does not exist
FieldMeaningNotes
source.repoURLGit repo, Helm repo or OCI repo addressPrivate repos require registering credentials first (argocd repo add, credentials are stored as a Secret with the argocd.argoproj.io/secret-type: repository label)
source.targetRevisionVersion to trackBranch → follows the latest commit; tag / SHA → pinned version (common in production). Every sync records the actual SHA in the history
source.pathDirectory in the repoTool type is detected automatically: if there is kustomization.yaml → Kustomize; if there is Chart.yaml → Helm; otherwise → plain YAML / JSON in the directory
destinationTarget cluster and default namespaceserver and name pick one; resources whose manifest already sets a namespace (written by Kustomize in this example) are not affected, but inconsistency between the two is confusing, so keep them consistent
projectbelonging to the AppProjectdefault A project that allows any source and destination — only suitable for labs
syncPolicy.automatedAutomatic sync (Module 6)Not enabled in this module yet; observe the manual workflow
metadata.finalizersresources-finalizer.argocd.argoproj.ioWhen an Application is deleted, the resources it manages are cascade-deleted; without this, only the Application is deleted and the workloads are kept

How: what the first sync does

  1. After the Application is created, the controller immediately performs one reconciliation: renders the manifests and compares them. The cluster has none of these resources, so Sync = OutOfSync, Health = Missing.
  2. argocd app sync Writing operation field on the Application; once the controller sees it, it performs the sync: first runs the PreSync hooks (if any), then applies resources in resource-type order (Namespace → … → Service → Deployment) and sync waves, and finally PostSync.
  3. After the sync completes, Sync = Synced; during the Deployment rollout Health = Progressing, and once ready, Healthy.
  4. Results are written to status.operationState and status.history (including the commit SHA), you can use argocd app history to view,argocd app rollback roll back to a historical version (only available when automatic sync is not enabled).

Why: why the Application should also go into Git

An Application created with the CLI / UI only exists in the cluster's etcd, and is lost if the cluster is rebuilt. Putting the Application YAML in argocd/apps/ and managing it with a “root application” (Hour 3 App of Apps) is complete GitOps. This module uses the CLI first to understand the fields; the comprehensive lab switches to declarative.

When: choosing CLI, UI or declarative

MethodSuitable forNot suitable for
UI “+ NEW APP”Learning, exploring fieldsAny environment that must be reproduced
argocd app createScripts, quick experiments; --upsert idempotentLong-term management (state is not in Git)
kubectl apply -f argocd/apps/*.yamlDeclarative, reviewable in Git— (recommended)
Common misconceptions① “destination.namespace overrides the namespace in the manifest” — no, it is only a default. ② “Deleting an Application deletes the workloads” — only when it has the resource finalizer (or when cascade deletion is selected in the UI / CLI). ③ “targetRevision: main means every push deploys immediately” — it depends on whether automatic sync is enabled and when the change is detected (polling or Webhook, Module 6). ④ “An Application can live in any namespace” — by default only Applications in the argocd namespace are recognized; “applications in any namespace” requires extra configuration (Hour 4).

Field mapping diagram: Application → Git → cluster

Application podinfo-dev project: defaultsource.repoURLsource.targetRevision: mainsource.path: …/overlays/devdestination.server: in-clusterdestination.namespace: podinfo-devsyncOptions: CreateNamespace=true GitHub: <you>/gitops-lab main → 7c1e9a2 (resolved SHA)apps/podinfo/base/apps/podinfo/overlays/dev/ ← kustomization.yaml (Kustomize) Cluster lab Namespace podinfo-dev (created automatically)Deployment podinfo (6.16.0 ×1)Service podinfo :9898annotation argocd.argoproj.io/tracking-id = podinfo-dev:apps/Deployment:…
Figure 4-1 source points to a directory in Git (at a resolved SHA), destination points to the cluster and default namespace

Sync operation flow

app syncWrite .operation PreSync hook(none in this example) apply in wave / type orderNamespace → Svc → Deploy PostSync hookafter health is reached operationState: Succeededhistory += {revision: 7c1e9a2}
Figure 4-2 Stages of one sync operation (hooks and Sync Waves are covered in Hour 2)

Interactive: Application field builder

Change the fields on the left; the YAML and the equivalent CLI command are generated live on the right, with validation hints (these hints correspond to real errors or risks you will encounter).

Common Application commands

CommandPurposeKey parameters
argocd app create NAMECreate an application--repo --path --revision --dest-server|--dest-name --dest-namespace --project --sync-option CreateNamespace=true --upsert
argocd app get NAMEStatus and resource list--refresh,--hard-refresh,-o yaml|json|tree
argocd app sync NAMEManual sync--prune,--dry-run,--resource GROUP:KIND:NAME,--revision
argocd app wait NAMEwait until reaching the state--sync --health --timeout 120
argocd app history NAMESync historyID and Git SHA
argocd app delete NAMEDelete an application--cascade=false Keep resources; -y skip confirmation
argocd repo add URLRegister a private repository--username --password (PAT) or --ssh-private-key-path, GitHub App parameters
argocd app create podinfo-dev \
  --project default \
  --repo https://github.com/<you>/gitops-lab.git \
  --revision main \
  --path apps/podinfo/overlays/dev \
  --dest-server https://kubernetes.default.svc \
  --dest-namespace podinfo-dev \
  --sync-option CreateNamespace=true
argocd app get podinfo-dev
application 'podinfo-dev' created
Name:               argocd/podinfo-dev
Project:            default
Server:             https://kubernetes.default.svc
Namespace:          podinfo-dev
URL:                https://localhost:8080/applications/podinfo-dev
Source:
- Repo:             https://github.com/<you>/gitops-lab.git
  Target:           main
  Path:             apps/podinfo/overlays/dev
SyncWindow:         Sync Allowed
Sync Policy:        Manual
Sync Status:        OutOfSync from main (7c1e9a2)
Health Status:      Missing

GROUP  KIND        NAMESPACE    NAME     STATUS     HEALTH   HOOK  MESSAGE
       Service     podinfo-dev  podinfo  OutOfSync  Missing
apps   Deployment  podinfo-dev  podinfo  OutOfSync  Missing

How to read it:“OutOfSync from main (7c1e9a2)” means the desired state comes from commit 7c1e9a2 on the main branch; Missing means the resource does not exist in the cluster. Common errors:--path Starting with / or a misspelled directory will produce app path does not exist.

Lab 4: create and manually sync podinfo-dev (about 6 minutes)

Create the application: run the command from the “Commands” page argocd app create and confirm OutOfSync / Missing.
Preview the changes that will be made:
argocd app diff podinfo-dev | head -30
argocd app sync podinfo-dev --dry-run
Sync and wait for health:
argocd app sync podinfo-dev
argocd app wait podinfo-dev --sync --health --timeout 180
kubectl -n podinfo-dev get deploy,svc,pod
Name:               argocd/podinfo-dev
...
Operation:          Sync
Sync Revision:      7c1e9a2...
Phase:              Succeeded
Message:            successfully synced (all tasks run)

GROUP  KIND        NAMESPACE    NAME         STATUS   HEALTH       HOOK  MESSAGE
       Namespace                podinfo-dev  Running  Synced             namespace/podinfo-dev created
       Service     podinfo-dev  podinfo      Synced   Healthy            service/podinfo created
apps   Deployment  podinfo-dev  podinfo      Synced   Progressing        deployment.apps/podinfo created
...
NAME                      READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/podinfo   1/1     1            1           40s
Verify the application itself:
kubectl -n podinfo-dev port-forward svc/podinfo 9898:9898 &
sleep 2; curl -s localhost:9898 | grep -E '"version"|"message"'; kill %1
  "version": "6.16.0",
  "message": "hello from dev",
View the tracking annotations and history:
kubectl -n podinfo-dev get deploy podinfo -o jsonpath='{.metadata.annotations.argocd\.argoproj\.io/tracking-id}{"\n"}'
argocd app history podinfo-dev
podinfo-dev:apps/Deployment:podinfo-dev/podinfo
ID  DATE                           REVISION
0   2026-11-17 10:21:33 +0000 UTC  main (7c1e9a2)

v3 uses annotations by default argocd.argoproj.io/tracking-id (format app-name:group/kind:namespace/name) to decide “which application this resource belongs to”; this is what prune relies on in Module 7.

Case 1: a production application tracking a branch leads to an “accidental release”

Problem: A production application targetRevision: main has automatic sync enabled, and a base change prepared for dev was merged and went straight into production. Approach: Isolate environments with directories (overlays), and make sure base changes are reviewed; production can track a tag (such as prod-2026.11.17) or have its SHA updated by a promotion process (Hour 6 Kargo / Hour 3). Limitation: When tracking a fixed SHA, the Application itself must be changed on every release.

Case 2: deleting an Application by mistake takes the production database with it

Problem: While cleaning up a “duplicate application”, an Application with a resource finalizer was deleted, cascade-deleting the StatefulSet and PVC. Approach: Add annotations to stateful resources argocd.argoproj.io/sync-options: Delete=false (Hour 2), and before deleting the application first --cascade=false; restrict the delete permission with RBAC. Limitation: Resources must be tagged in advance.

Case 3: a private repository credential expires

Problem: A personal PAT expired, and every application reported ComparisonError. Approach: Register the repository using a GitHub App or deploy key, and manage it uniformly with a credential template (matched by URL prefix). Limitation: A GitHub App requires an organization administrator to install it.

Common errors at creation and first sync

rpc error: code = InvalidArgument desc = application spec for podinfo-dev is invalid: InvalidSpecError: Unable to generate manifests in apps/podinfo/overlay/dev: rpc error: code = Unknown desc = apps/podinfo/overlay/dev: app path does not exist

Cause: Path typo (overlay vs overlays), or the path has not been pushed to the branch targetRevision points to.

git -C ~/gitops-lab ls-tree -d --name-only -r origin/main | grep overlays

Fix: Correct --path; confirm git push is done.

failed to list refs: authentication required: Repository not found.

Cause: The repository is private (or the URL is mistyped), and Argo CD has no credentials.

argocd repo add https://github.com/<you>/gitops-lab.git --username <you> --password <fine-grained-PAT-read-only Contents>
argocd repo list

Fix: Register read-only credentials; in production use a GitHub App or SSH deploy key.

namespaces "podinfo-dev" not found

Cause: not set CreateNamespace=true, and the target namespace does not exist.

argocd app set podinfo-dev --sync-option CreateNamespace=true

Fix: Add the sync option and sync again; or put the Namespace manifest into Git (which allows labels, quotas, etc., and gives more control).

application destination server 'https://kubernetes.default.svc' and namespace 'podinfo-dev' do not match any of the allowed destinations in project 'xxx'

Cause: A restricted AppProject is being used, and the destination is not in the spec.destinations allow list.

Fix: This course uses --project default; project restrictions are explained in detail in Hour 4.

Command-line questions
1. Export podinfo-dev as YAML, keep only the spec, and use it as the starting point for putting it into Git.
kubectl -n argocd get application podinfo-dev -o yaml | yq '{"apiVersion": .apiVersion, "kind": .kind, "metadata": {"name": .metadata.name, "namespace": .metadata.namespace}, "spec": .spec}'
2. Delete the podinfo-dev application but keep the workloads in the cluster.
argocd app delete podinfo-dev --cascade=false -y
Scenario analysis question
A colleague changed destination.namespace to default, but after sync podinfo is still in podinfo-dev . Why? What are the risks of this configuration?

The Kustomize overlay has already written the namespace on all resources through namespace: podinfo-dev ; destination.namespace only applies to resources in the manifest that have no namespace. Risks: the configuration appears to point to default, which does not match reality and is misleading; any resource added later without a namespace would land in default; in a restricted project, destination validation is based on this field, so a mismatch with the actual resource location can lead to unexpected permission decisions. Keep the two consistent.

Verified instructional videos

▶
ArgoCD Tutorial for Beginners | GitOps CD for Kubernetes — TechWorld with Nana
English · the second half of the video demonstrates writing an Application in YAML and syncing it
▶
ArgoCD Tutorial: Step-by-Step Installation and UI App Deployment | KodeKloud — KodeKloud
English · the complete workflow for creating an application in the UI

Official docs

Video storyboard (about 80 seconds)

Shot 1 · 0–20s
Scene: the Application YAML is split into three highlighted blocks: source, destination, syncPolicy.
Narration: an Application answers three questions: where to fetch from, where to put it, and how to sync.
Shot 2 · 20–45s
Scene: argocd app create runs, and yellow OutOfSync and Missing cards appear in the UI.
Narration: right after creation, the resources are not yet in the cluster, so the status is out of sync and missing.
Shot 3 · 45–65s
Scene: click Sync; the resource tree shows Namespace, Service and Deployment in turn, and the Deployment changes from Progressing to green.
Narration: sync creates resources in type order, and the Deployment becomes healthy once its rollout completes.
Shot 4 · 65–80s
Scene: the app history list shows commit SHAs.
Narration: every sync records its corresponding commit, so deployments can be traced back to Git.
or score ≥ 70% on the quiz

Module 5 · State model: Sync Status and Health Status

28:00 – 35:00 · Two independent dimensions: “Does the cluster match Git?” and “Is it running well?”
7 minutesv3: resource health is not written into the CR by default★★★★★
Learning objectives
  • State the 3 values of Sync Status and the 6 values of Health Status, and explain any combination (for example Synced + Degraded, or OutOfSync + Healthy).
  • Know how built-in health checks judge Deployment, Service, Ingress, PVC, Job and other resources, and how application-level health is aggregated from resource health.
  • Distinguish between the operation state (operationState.phase: Running / Succeeded / Failed / Error / Terminating) and Sync Status.
Prerequisites: Module 4; the Kubernetes Deployment rollout status and progressDeadlineSeconds. Importance:★★★★★

What: two dimensions

Sync Status — compared with Git
  • Synced: the live state of all managed resources matches the rendered desired state (after normalization and ignoreDifferences).
  • OutOfSync: at least one resource differs, is missing, or (when prune is considered) is extra.
  • Unknown: cannot be compared — usually a rendering failure (ComparisonError) or an unreachable repository.
Health Status — based on the live state itself
  • Healthy: the resource is 100% healthy.
  • Progressing: not yet healthy, but still progressing and expected to become healthy (for example during a rollout).
  • Degraded: failed, or could not become healthy within the time limit.
  • Suspended: paused, waiting for an external event (a paused CronJob, a paused Deployment / Rollout).
  • Missing: the resource does not exist in the cluster.
  • Unknown: health assessment failed; status unknown.

How: how health is determined

ResourceBuilt-in health check rules (summary)
Deployment / ReplicaSet / StatefulSet / DaemonSetWhether the observed generation has caught up with the spec; whether the updated and available replica counts reach the desired values; a Deployment that exceeds progressDeadlineSeconds (default 600 seconds) → Degraded; spec.paused → Suspended
Servicetype: LoadBalancer requires status.loadBalancer.ingress a value to be Healthy, otherwise Progressing (common in kind!); other types are Healthy directly
IngressSame as above, requires status.loadBalancer.ingress
PersistentVolumeClaimBound → Healthy; Pending → Progressing
Pod / JobJudged by Pod phase / Job conditions; a failed Job → Degraded
CRDs such as Argo Rollouts and cert-manager CertificateBuilt-in Lua health scripts (can be customized in argocd-cm of resource.customizations.health.<group_kind> , Hour 2)
Stateless objects such as ConfigMaps and SecretsNo health concept; not included in the aggregation

Application-level health = the “worst” of the resource healths (the severity order is roughly Healthy < Suspended < Progressing < Missing < Degraded < Unknown; follow the official Resource Health docs). Hook resources are not included in application health aggregation.

v3 change

  • Resource-level health by default is no longer persisted to .status.resources[].health, and the Application status shows resourceHealthSource: appTree; scripts that need resource health should use argocd app get <app> -o json or the resource tree in the API. To restore the old behavior: argocd-cmd-params-cm in controller.resource.health.persist: "true".
  • Metrics argocd_app_sync_status,argocd_app_health_status etc. have been removed; the information is merged into argocd_app_info labels (related to the Prometheus & Grafana course).
  • ignoreResourceStatusField Default is all: each resource's status field differences no longer cause OutOfSync.

Operation state (do not confuse with Sync Status)

status.operationState.phase Description Most recent sync operation: Running → Succeeded / Failed / Error, or terminated (Terminating). A sync can Succeed and then someone modifies the resources, so the app becomes OutOfSync again; a sync can also Fail (for example, apply rejected by admission control), and the app remains OutOfSync.

When: how to judge using these two dimensions

CombinationTypical meaningWhat to check first
Synced + HealthyAll normal—
Synced + ProgressingJust synced, rolling out; or a LoadBalancer has not yet received an IPWait; if it times out, check the resource events
Synced + DegradedThe Git content itself is bad (wrong image, wrong configuration)Fix Git (revert), rather than syncing again
OutOfSync + HealthyDrift, or new commits not yet syncedargocd app diff
OutOfSync + MissingNew resources not yet created / deleted by someoneSync (or enable self-heal)
Unknown + anythingCannot render / compareCheck status.conditions for the ComparisonError

Comparison with similar technologies

Argo CDFluxkubectl
ConsistencySync Status (per-resource diff)Kustomization Ready Conditions + last applied revisionkubectl diff (one-off)
HealthHealth Status (built-in + Lua custom)kstatus-style readiness judgment (wait / healthChecks)kubectl rollout status
Common misconceptions① “Synced means the application is fine” — Synced only means it matches Git; the version in Git may itself be bad (Degraded). ② “Healthy means it matches Git” — the two are independent; a replica count changed by hand can still be healthy. ③ “Re-syncing fixes Degraded” — if it is Synced + Degraded, a sync only reapplies the same bad configuration. ④ “Progressing must be changing” — a LoadBalancer that never gets an IP will stay Progressing forever.

Status matrix diagram

Sync \ Health HealthyProgressingDegradedSuspendedMissingUnknown SyncedOutOfSyncUnknown All normal Rolling out/ waiting for LB IP The version in Gitis itself bad Intentionally paused (rare) Health check error Drift / new commitnot yet synced Syncing Bad changeor broken by a change paused manually before first creation/ deleted — Cannot render / compare: ComparisonError (path error, Kustomize syntax error, repository unreachable, repo-server failure)Health may still be computable (based on live state)
Figure 5-1 Sync and Health are two orthogonal dimensions; the most worrying combinations are Synced + Degraded and Unknown

Decision flow for Deployment health

spec.paused?Yes → Suspended observedGeneration< generation → Progressing Progressing conditionProgressDeadlineExceeded → Degraded updated / available< replicas → Progressing Healthy
Figure 5-2 Rough order of the built-in Deployment health check (consistent with the logic of kubectl rollout status )

Interactive simulator: events → state combinations

Starting from podinfo-dev in “Synced + Healthy”, click the events in turn and observe how the two states change, and what Argo CD displays when automatic sync is not enabled (manual mode).

Sync Status
Synced
main (7c1e9a2)
Health Status
Healthy
operationState: Succeeded

Commands for reading status

CommandPurposeNotes
argocd app listSYNC / HEALTH columns for all applicationsby default -o wide; can filter by -p project,-l label,-r repository (there is no parameter to filter by health; use -o json | jq)
argocd app get NAMEStatus and message of applications and each resourcethe MESSAGE column gives the reason for the health status
argocd app get NAME -o json | jq '.status.health, .status.sync'Machine-readableSince v3 resource health is not in the CR; CLI output still contains resource-tree information
argocd app resources NAMEResource list and status--orphaned View orphaned resources
kubectl -n argocd get applicationsRead status without going through the API ServerColumns SYNC STATUS / HEALTH STATUS
argocd app list
kubectl -n argocd get applications.argoproj.io
kubectl -n argocd get application podinfo-dev -o jsonpath='{.status.sync.status}{" / "}{.status.health.status}{" / "}{.status.operationState.phase}{"\n"}'
NAME                PROJECT  CLUSTER                         NAMESPACE    STATUS  HEALTH   SYNCPOLICY  CONDITIONS  REPO                                       PATH                       TARGET
argocd/podinfo-dev  default  https://kubernetes.default.svc  podinfo-dev  Synced  Healthy  Manual      <none>      https://github.com/<you>/gitops-lab.git  apps/podinfo/overlays/dev  main
NAME          SYNC STATUS   HEALTH STATUS
podinfo-dev   Synced        Healthy
Synced / Healthy / Succeeded

Lab 5: produce Missing and Degraded (about 6 minutes)

Missing: delete the Service and observe the status (the application is still in manual sync mode):
kubectl -n podinfo-dev delete svc podinfo
argocd app get podinfo-dev --refresh | tail -4
GROUP  KIND        NAMESPACE    NAME     STATUS     HEALTH   HOOK  MESSAGE
       Service     podinfo-dev  podinfo  OutOfSync  Missing
apps   Deployment  podinfo-dev  podinfo  Synced     Healthy

Application level: OutOfSync + Missing (the “worst” resource health). Run argocd app sync podinfo-dev to restore.

Degraded (a parameter override for the demo,is not a recommended GitOps practice):
# 1) Use a Kustomize image override to point dev at a non-existent tag
argocd app set podinfo-dev --kustomize-image ghcr.io/stefanprodan/podinfo:0.0.0
# 2) Only to shorten the demo: change progressDeadlineSeconds to 60 (this field is not declared in Git, so Argo CD will not revert it)
kubectl -n podinfo-dev patch deploy podinfo --type merge -p '{"spec":{"progressDeadlineSeconds":60}}'
argocd app sync podinfo-dev
sleep 75; argocd app get podinfo-dev | grep -E 'Health Status|Deployment'
Health Status:      Degraded
apps   Deployment  podinfo-dev  podinfo  Synced  Degraded        deployment.apps/podinfo configured  Deployment "podinfo" exceeded its progress deadline

Synced + Degraded: the desired state (including the override) is itself bad. The old ReplicaSet's Pods are still running (rolling-update protection), so the service was not interrupted.

Restore: remove the override and return to the definition in Git:
argocd app unset podinfo-dev --kustomize-image ghcr.io/stefanprodan/podinfo
argocd app sync podinfo-dev
argocd app wait podinfo-dev --health --timeout 120
kubectl -n podinfo-dev patch deploy podinfo --type json -p '[{"op":"replace","path":"/spec/progressDeadlineSeconds","value":600}]'
Why parameter overrides are not GitOpsargocd app set --kustomize-image This changes the Application object (in the cluster), not Git. As long as the Application itself is not managed in Git, such an override is “state outside Git”. The comprehensive lab puts the Application into Git, and then such overrides will be overwritten back by the definition in Git.

Case 1: a LoadBalancer Service leaves the application “Progressing forever”

Problem: In a local / private cluster without a cloud load balancer,type: LoadBalancer never obtains an IP, so the application stays Progressing for a long time and blocks subsequent sync waves. Approach: In kind, use ClusterIP + port-forward, or install cloud-provider-kind / MetalLB; in production, check the load-balancer controller. Limitation: Do not use custom health checks to hide real problems just to turn the status green.

Case 2: monitoring watched only Sync and missed Degraded

Problem: Alerts were configured only for OutOfSync, so after a bad-image release the application stayed Synced + Degraded for hours with nobody aware of it. Approach: Configure separate alerts for Health=Degraded, Sync=OutOfSync for more than N minutes, and operationState=Failed (Notifications, Hour 6; metrics argocd_app_info, Prometheus course).

Case 3: after the v3 upgrade, a custom script cannot read resource health

Problem: The script reads .status.resources[].health, which becomes empty after upgrading to v3. Approach: Change it to argocd app get -o json or the resource tree from the API; if necessary, temporarily set controller.resource.health.persist: "true". Limitation: Persisting it adds etcd writes, which is not recommended in large environments.

Common status-related problems

Health Status: Progressing —— Waiting for rollout to finish: 0 of 1 updated replicas are available...

Cause: New Pods not ready: image pull failure, failing probes, insufficient resources.

kubectl -n podinfo-dev get pods
kubectl -n podinfo-dev describe pod -l app.kubernetes.io/name=podinfo | tail -15

Fix: Handle according to the Pod events; if it is a configuration error in Git,git revert.

Service podinfo Synced Progressing Waiting for the LoadBalancer to get an IP

Cause: The cluster has no load-balancer implementation.

Fix: Change to ClusterIP, or install cloud-provider-kind / MetalLB in kind.

Sync Status: Unknown —— ComparisonError: Failed to load target state: failed to generate manifest for source 1 of 1: rpc error: code = Unknown desc = `kustomize build ...` failed exit status 1: Error: ...

Cause: Rendering failed (YAML syntax, Kustomize field error, referenced file does not exist).

kubectl kustomize ~/gitops-lab/apps/podinfo/overlays/dev
argocd app get podinfo-dev -o json | jq '.status.conditions'

Fix: Run kubectl kustomize locally first; add render validation to CI (kustomize build + kubeconform).

Command-line questions
1. List all applications that are Degraded.
argocd app list -o json | jq -r '.[] | select(.status.health.status=="Degraded") | .metadata.name'
# or without going through the API Server:
kubectl -n argocd get applications -o json | jq -r '.items[] | select(.status.health.status=="Degraded") | .metadata.name'
2. Output podinfo-dev's sync status, health status and most recent operation phase in one command.
kubectl -n argocd get app podinfo-dev -o jsonpath='{.status.sync.status} {.status.health.status} {.status.operationState.phase}{"\n"}'
Scenario analysis question
While on duty you see podinfo-prod showing Synced + Degraded, and a colleague suggests “just click Sync and see”. How do you respond, and what is the correct order of handling?

Synced means the cluster already matches Git; syncing again only reapplies the same configuration and will not fix the problem. Order: ① argocd app get check which resource is Degraded and its message; ② check the Pod events / logs to confirm the cause; ③ confirm which recent commit introduced it (argocd app history the corresponding SHA,git log); ④ fix Git through git revert (roll back the GitOps way), then wait for sync or sync manually; ⑤ afterwards add CI validation or progressive delivery (Hour 6).

Verified instructional videos

No verified video was found that specifically explains the Argo CD v3 Sync / Health state model. The following is a general introductory video (which shows the status display); use it together with the storyboard.

▶
ArgoCD Tutorial for Beginners | GitOps CD for Kubernetes — TechWorld with Nana
English · Synced / Healthy status display in the UI

Official docs

Video storyboard (about 80 seconds)

Shot 1 · 0–20s
Scene: two dashboards, the left labeled “Does it match Git?”, the right labeled “Is it running well?”
Narration: Argo CD describes an application with two independent states: sync status and health status.
Shot 2 · 20–45s
Scene: Git commits a bad image; the left turns green Synced, and the right changes from blue Progressing to red Degraded.
Narration: a successful sync does not mean the application is healthy. If the configuration in Git is bad, you will see synced but degraded.
Shot 3 · 45–65s
Scene: kubectl scale; the left turns yellow OutOfSync, and the right stays green.
Narration: conversely, a manual change can leave the application out of sync while it is still completely healthy.
Shot 4 · 65–80s
Scene: the worst red state among the resource list spreads to the application card.
Narration: an application's health is the worst health of all its resources.
or score ≥ 70% on the quiz

Module 6 · Diff, refresh and manual / automatic sync

35:00 – 42:00 · When does Argo CD “know” that Git changed? What exactly does it compare? When does it act on its own?
7 minutespolling 120s + 60s jitterautomated.enabled field★★★★★
Learning objectives
  • Explain three kinds of “refresh”: periodic refresh (timeout.reconciliation), normal refresh, hard refresh (clears the manifest cache and re-renders), and the role of Git Webhooks.
  • Read argocd app diff output and exit codes, and know which normalization happens before the diff.
  • Configure automatic sync syncPolicy.automated, understand its trigger conditions (only when OutOfSync), the rule that “a failed same SHA is not retried”, and the retry configuration.
Prerequisites: The reconciliation loop from Module 2 and the state model from Module 5. Importance:★★★★★

What: refresh and sync are two different things

ActionWhat it doesDoes it change the cluster?Trigger
Periodic refreshRe-resolves targetRevision, re-renders when necessary, and re-comparesNoevery timeout.reconciliation (default 120s) + random jitter of at most 60s, i.e. at most about 3 minutes; setting it to 0 disables polling (must be combined with a Webhook)
Normal refreshPerforms the comparison above immediately; if the SHA has not changed, uses the cached manifestsNoUI “Refresh”,argocd app get --refresh, annotation argocd.argoproj.io/refresh: normal, Webhook
Hard refreshInvalidates the manifest cache and forces repo-server to re-renderNoUI “Hard Refresh”,--hard-refresh, annotation value hard; periodic hard refresh timeout.hard.reconciliation (default 0s , i.e. off)
SyncApplies the desired manifests to the cluster (and can prune)YesManual (UI / CLI), or automatic sync policy

When is a hard refresh needed? When the render result depends on something other than Git while the SHA has not changed: the content of a remote repository that a Helm chart depends on has changed, a CMP plugin read external data, or the cache is suspected to be corrupted. Routine Git commits only need a normal refresh (the SHA changes, so the cache key naturally differs).

How: what the diff compares

  1. Desired state: the manifests rendered by repo-server. Live state: the objects in the controller's cache.
  2. Normalization: removes the default values and metadata that Kubernetes fills in automatically (managedFields,resourceVersion etc.), ignores fields by default in v3 ( status ), and applies the rules in ignoreResourceStatusField: all and ignoreDifferences (Hour 2). resource.customizations By default, differences are computed with client-side three-way merge semantics (consistent with
  3. by default, differences are computed with client-side three-way merge semantics (consistent with kubectl apply , based on the last-applied annotation); enabling Server-Side Diff (argocd.argoproj.io/compare-options: ServerSideDiff=true, or when v3.6 uses the ServerSideApply=true sync option, automatically enabled) computes via the kube-apiserver dry-run, which handles admission webhooks and defaults more accurately, at the cost of extra API Server load.
  4. Any resource with a difference → the application is OutOfSync.

How: the automatic sync policy

spec:
  syncPolicy:
    automated:
      enabled: true      # explicit switch; when false, other fields are kept but automatic sync is off (treated as on when unset)
      prune: false       # Module 7
      selfHeal: false    # Module 7
      allowEmpty: false  # prevents deleting all resources when the render output is empty
    syncOptions:
    - CreateNamespace=true
    retry:               # retry after a failed sync (example values, not defaults)
      limit: 5
      backoff:
        duration: 5s
        factor: 2
        maxDuration: 3m
  • only triggers when OutOfSync: applications that are Synced, or in an error state, are not auto-synced.
  • After the same SHA + parameters fail, automatic retries stop (to prevent loops), unless retry is configured or a new commit appears.
  • When selfHeal is not enabled, automatic sync only reacts to “Git changes”; drift on the cluster side shows as OutOfSync but is not corrected automatically (Module 7).
  • With automatic sync enabled,argocd app rollback is unavailable; rollback should be done through Git (git revert).

Why / When: manual or automatic

EnvironmentRecommendationRationale
devautomated + prune + selfHealFast feedback, Git is the truth
stagingautomated + prune + selfHealAn automated flow consistent with production validation
prodAutomatic sync + changes controlled by PR approval, or manual sync + sync windows (Hour 2)“Who presses the button” should be a PR merge, not a UI click; both are common, what matters is a consistent process

Webhook: shrink “up to about 3 minutes” to seconds

In the GitHub repository settings, point the Webhook at https://<argocd external address>/api/webhook (content type application/json), and argocd-secret in webhook.github.secret to verify the signature. After argocd-server receives a push event, it triggers a refresh for the applications that reference that repository and branch. In the kind lab, GitHub cannot reach your localhost, so this course uses a manual --refresh instead; Hour 7 demonstrates a Webhook with an in-cluster Gitea.

Comparison with similar technologies

Argo CDFlux
Change detectionPolling (default 120s + jitter) + WebhookEach Source's spec.interval + Receiver (Webhook)
Applicationautomatically syncs when OutOfSyncPeriodic apply at each Kustomization's interval
Manual triggerargocd app sync / UIflux reconcile kustomization … --with-source
Common misconceptions① “Refresh deploys” — no, Refresh only compares. ② “With automatic sync enabled, Argo CD applies every 3 minutes” — it only applies when OutOfSync. ③ “After a failed automatic sync it keeps retrying” — after the same SHA fails, automatic retries stop by default; you need a new commit, a manual sync, or a configured retry. ④ “Hard refresh fixes every OutOfSync” — it only clears the cache; real differences require a sync or a fix in Git.

Change detection paths

git pushmain → 9f3b6d1 ① periodic refresh≤ 120s + 60s jitter ② Webhook/api/webhook · seconds ③ manual RefreshUI / --refresh compare → OutOfSyncnew SHA 9f3b6d1 automatedsync immediately manualwait for someone to click Sync
Figure 6-1 The three detection paths arrive at the same place: first compare to get OutOfSync, then the sync policy decides whether to act

The relationship between cache and refresh

Normal refreshSHA unchanged → use cached manifests Hard refreshdelete cache → re-render Redis cache keyrepo + SHA + source config + tool version new commitSHA changes → natural cache miss
Figure 6-2 In most cases a normal refresh is enough; hard refresh is for when the SHA has not changed but the render output should change

Interactive timeline: how long after a git push it is deployed

Choose a detection method and sync policy, then click “Play”. The timeline is compressed at 1 second ≈ 10 seconds; the polling jitter is generated randomly each time (0–60 seconds), matching real behavior.

0s60s120s180s240s

Diff, refresh and sync commands

CommandPurposeNotes
argocd app diff NAMEDesired vs liveExit codes: 0 no difference, 1 differences, 2 error; --refresh / --hard-refresh; --local DIR preview using a local directory (uncommitted changes); --server-side-diff
argocd app get NAME --refreshNormal refreshyou can also add an annotation to the Application argocd.argoproj.io/refresh=normal
argocd app get NAME --hard-refreshHard refreshclear the manifest cache
argocd app sync NAMEManual sync--dry-run,--prune,--resource apps:Deployment:podinfo,--revision SHA (temporarily sync to a specified version)
argocd app set NAME --sync-policy automatedEnable automatic sync--sync-policy none Disable; --auto-prune,--self-heal,--allow-empty
argocd app terminate-op NAMEterminate an in-progress syncUse when a sync is stuck
argocd app rollback NAME IDRoll back to a historical versionOnly available in manual sync mode
argocd app diff podinfo-dev --refresh; echo "exit=$?"
===== apps/Deployment podinfo-dev/podinfo ======
33c33
<         image: ghcr.io/stefanprodan/podinfo:6.16.0
---
>         image: ghcr.io/stefanprodan/podinfo:6.17.0
exit=1

How to read it:< is the live cluster state,> is the desired state. You can set the environment variable KUBECTL_EXTERNAL_DIFF="diff -u" (or tools such as dyff) to change the output format.

# preview an uncommitted local change (bypassing Git)
argocd app diff podinfo-dev --local ~/gitops-lab/apps/podinfo/overlays/dev

Lab 6: upgrade 6.16.0 → 6.17.0 via a Git commit (about 7 minutes)

Modify Git:
cd ~/gitops-lab
sed -i 's/newTag: "6.16.0"/newTag: "6.17.0"/' apps/podinfo/overlays/dev/kustomization.yaml
git diff
git commit -am "dev: podinfo 6.16.0 -> 6.17.0" && git push

On macOS, sed needs to be written as sed -i ''.

Without waiting for polling, refresh immediately and view the diff:
argocd app get podinfo-dev --refresh | grep -E 'Sync Status|Health Status'
argocd app diff podinfo-dev
Sync Status:        OutOfSync from main (9f3b6d1)
Health Status:      Healthy
Manually sync and watch the rollout:
argocd app sync podinfo-dev
argocd app wait podinfo-dev --health --timeout 180
kubectl -n podinfo-dev get deploy podinfo -o jsonpath='{.spec.template.spec.containers[0].image}{"\n"}'
argocd app history podinfo-dev
ghcr.io/stefanprodan/podinfo:6.17.0
ID  DATE                           REVISION
0   2026-11-17 10:21:33 +0000 UTC  main (7c1e9a2)
1   2026-11-17 10:40:02 +0000 UTC  main (9f3b6d1)
Enable automatic sync, then change Git once more:
argocd app set podinfo-dev --sync-policy automated
cd ~/gitops-lab
sed -i 's/value: "hello from dev"/value: "hello from dev (auto-sync)"/' apps/podinfo/overlays/dev/kustomization.yaml
git commit -am "dev: change UI message" && git push
# auto-syncs after at most about 3 minutes; to see the effect immediately:
argocd app get podinfo-dev --refresh >/dev/null
argocd app wait podinfo-dev --sync --health --timeout 300
argocd app get podinfo-dev | grep -E 'Sync Policy|Sync Status'
Sync Policy:        Automated
Sync Status:        Synced to main (1d4e8c0)
Understand “rollback goes through Git”:
argocd app rollback podinfo-dev 1        # expected to fail: not allowed while automatic sync is enabled
cd ~/gitops-lab && git revert --no-edit HEAD && git push   # the correct approach
argocd app get podinfo-dev --refresh >/dev/null
FATA[0000] rpc error: code = FailedPrecondition desc = rollback cannot be initiated when auto-sync is enabled

Case 1: many applications with default polling overwhelm the Git server

Problem: Thousands of applications point at the same monorepo, every 3 minutes ls-remote and rendering triggers GitHub rate limits. Approach: Configure a Webhook, and increase timeout.reconciliation (for example to 600s); use the manifest-generate-paths annotation to re-render only when the relevant directories change (Hour 7). Limitation: If Webhooks are lost, detection slows down, so polling must be kept as a fallback.

Case 2: going “silent” after an automatic sync fails

Problem: A sync failed because an admission webhook rejected it; afterwards the app stayed OutOfSync and nobody noticed, because the same SHA is not retried automatically. Approach: Configure retry (limited attempts and backoff); alert on operationState.phase=Failed alerts. Limitation: Retries cannot fix configuration errors; they only suit transient errors (API timeouts, CRDs not yet ready).

Case 3: risk of deleting all resources because the render output is empty

Problem: A refactor wrote the overlay's resources incorrectly, so the render output was empty. Approach: Keep allowEmpty: false (default); Argo CD refuses to empty an application under automatic sync + prune. Limitation: Manual sync can still run, so the diff must be reviewed.

Common sync and refresh problems

git push has already been done, but after several minutes the UI still shows Synced (old SHA)

Cause: The polling interval has not yet elapsed; the push went to another branch; the Application tracks a tag or a fixed SHA; the Webhook is not configured or the signature does not match.

argocd app get podinfo-dev --refresh | grep -E 'Target|Sync Status'
git -C ~/gitops-lab log -1 --format=%h origin/main

Fix: Confirm the branch and targetRevision; configure the Webhook; check the webhook processing records in the argocd-server logs.

rollback cannot be initiated when auto-sync is enabled

Cause: Under automatic sync a rollback would be overwritten immediately, so it is forbidden.

Fix:git revert; in an emergency, first argocd app set NAME --sync-policy none, then after rolling back, fix Git and restore automatic sync.

another operation is already in progress

Cause: The previous sync is still running (waiting for health, hooks not finished).

argocd app get podinfo-dev | sed -n '/Operation/,/Message/p'
argocd app terminate-op podinfo-dev

Fix: Wait or terminate, then sync again; identify the stuck resource.

The diff shows many differences related to replicas and default fields, and they reappear after sync

Cause: The fields are modified by other controllers (HPA, mutating webhooks).

Fix: Use ignoreDifferences or Server-Side Diff (Hour 2); in HPA scenarios do not write replicas in Git.

Command-line questions
1. In CI, check whether the cluster matches Git, and fail the pipeline if there are differences.
argocd app diff podinfo-dev --refresh --exit-code=true >/dev/null
rc=$?; [ $rc -eq 0 ] && echo "in sync" || { echo "drift or error ($rc)"; exit 1; }
2. Without using the CLI, add an annotation to the Application to trigger a hard refresh.
kubectl -n argocd annotate application podinfo-dev argocd.argoproj.io/refresh=hard --overwrite
Scenario analysis question
Developers complain that “after merging, it takes several minutes to deploy”, and the platform team worries that shortening the polling interval would overwhelm Git. Propose a solution.

Configure a Git Webhook (on argocd-server's /api/webhook, together with a signing secret) to achieve second-level refresh; you can also timeout.reconciliation increase it appropriately as a fallback to reduce Git load. When Argo CD is not exposed to the public internet, you can use the Git platform's outbound proxy or an internal Gitea, or have CI call argocd app get --refresh (requires a restricted token).

Verified instructional videos

▶
Argo CD - Applying GitOps Principles To Manage A Production Environment In Kubernetes — DevOps & AI Toolkit
English · demonstrates automatic sync and the Git-driven change workflow (recorded in the v1/v2 era)

Official docs

Video storyboard (about 80 seconds)

Shot 1 · 0–20s
Scene: a timeline, with git push at 10 seconds, and polling points appearing randomly between 120 and 180 seconds.
Narration: by default Git is checked every two minutes plus up to one minute of jitter, so the wait can be up to about three minutes.
Shot 2 · 20–40s
Scene: a Webhook lightning icon, with the detection point right next to the push.
Narration: once a Webhook is configured, a refresh is triggered within seconds of a push.
Shot 3 · 40–60s
Scene: diff view, old on the left, new on the right.
Narration: refresh only compares. To change the cluster, you need to sync.
Shot 4 · 60–80s
Scene: the automatic sync switch is turned on; as soon as OutOfSync appears it automatically changes to Synced.
Narration: with automatic sync enabled, whenever a difference appears the controller syncs by itself. To roll back, use git revert.
or score ≥ 70% on the quiz

Module 7 · Self-heal and prune: selfHeal, prune and drift

42:00 – 50:00 · who gets reverted, who gets deleted, and who Argo CD cannot see at all
8 minutesv3 uses annotation-based tracking by defaultprune is destructive★★★★★
Learning objectives
  • Distinguish four kinds of drift: a field declared in Git was modified, a managed resource was deleted, an unmanaged resource was added to the cluster, and a resource was removed from Git; state the outcome of each under the selfHeal / prune switches.
  • Understand resource tracking (v3 default annotation, annotation argocd.argoproj.io/tracking-id) decides “which application this resource belongs to”, and how it relates to prune.
  • Protect critical resources with resource-level annotations (Prune=false,Delete=false), and know the roles of PruneLast and allowEmpty .
Prerequisites: Module 6's automatic sync; kubectl apply's three-way merge (last-applied annotation). Importance:★★★★★

What: two switches

SwitchEffectDefaultCLI
automated.selfHeal: trueWhen OutOfSync is caused by a cluster-side change (not a new Git commit), it also auto-syncs, restoring the live state to the desired state. To avoid “fighting” with other controllers, it waits for the self-heal timeout before correcting (default 5 seconds, controller parameter --self-heal-timeout-seconds)falseargocd app set NAME --self-heal
automated.prune: trueDuring automatic sync, deletes resources that are “still tracked by this application but no longer in the Git render output”false (safety first)argocd app set NAME --auto-prune

Both only take effect when automated are enabled. For manual sync, use argocd app sync --prune to decide whether to prune this time.

How: the outcome of the four kinds of drift

DriftWhat Argo CD seesautomated (no selfHeal)+ selfHeal+ prune
① Modify a field declared in Git (kubectl scale,set image)OutOfSync (the diff shows the field)stays OutOfSync, not correctedreverted after about 5 seconds—
② Delete a managed resource (kubectl delete svc podinfo)OutOfSync + Missingstays Missingrecreated—
③ Add a resource / field to the cluster that Git does not have (kubectl create cm,kubectl label, adding an env var)Resource: not visible (no tracking annotation, belongs to no application); field: fields not declared in Git do not take part in the comparisonnot handlednot handlednot deleted (unmanaged)
④ Remove a resource from Git (delete the file and remove it from kustomization)OutOfSync; the resource is marked “requires pruning”not deletednot deleteddeleted

Key takeaway: Argo CD only manages “what is declared in Git”. Type ③ is the blind spot of GitOps: manually added resources need the AppProject's orphaned resource monitoring (orphanedResources, Hour 4) or admission policies (Kyverno / Gatekeeper) to be detected or blocked; manually added fields (for example an extra environment variable) are not detected under the default client-side diff, because the three-way merge only compares “fields last applied by Argo CD”.

How: resource tracking (Resource Tracking)

  • v3 default annotation: Argo CD writes to every resource of the application argocd.argoproj.io/tracking-id: <app-name>:<group>/<kind>:<namespace>/<name>. A resource belongs to the application only if the annotation content exactly matches “application + resource identity”; copying someone else's resource (carrying the annotation) will not be mistaken for it.
  • label (v2 default): uses a label to record the owning application. The upstream Argo CD default label key is app.kubernetes.io/instance, whereas the argo-cd Helm chart sets application.instanceLabelKey by default to argocd.argoproj.io/instance (visible in the chart 10.18.0 values). Problems: label values are limited to 63 characters, and app.kubernetes.io/instance conflicts with a same-named label commonly used by Helm charts.
  • annotation+label: the annotation is authoritative, and labels are also written (to make querying with label selectors easy).
  • Where to configure: argocd-cm in the application.resourceTrackingMethod (this course explicitly writes annotation in values). When switching from label to annotation, the annotations appear only after the next sync; the official note warns that during the first sync after switching, deletions may not be recognized correctly, so sync once first.

Why: why prune is off by default

prune is a destructive operation: one accidental deletion in Git (or a wrong Kustomize path) can cause production resources to be deleted. Argo CD provides multiple layers of protection: allowEmpty: false (refuses to auto-prune all resources when the render output is empty), resource-level annotations argocd.argoproj.io/sync-options: Prune=false (never prune this resource),Delete=false (keep on application deletion), sync options PruneLast=true (prune last, after other resources are healthy), and the confirmation before pruning in the UI.

When: recommended combinations

ScenarioselfHealpruneNotes
dev / stagingOnOnGit is the truth; the fastest way to expose problems
prod stateless serviceOnOn (combined with PR review and PruneLast)prevents long-term drift from accumulating
prod stateful resources (PVCs, databases)Onapplication-level on,resource-level Prune=false + Delete=falseprevent accidental deletion
during incident handlingtemporarily turn off (--sync-policy none)—allows the on-call engineer to intervene manually, then backfill Git afterwards

Comparison with similar technologies

Argo CDFlux
Self-healselfHeal (triggered by cluster changes; corrected after a 5-second timeout)each interval re-apply (Kustomization); HelmRelease can enable drift detection
Pruneprune, based on tracking annotations / labelsspec.prune: true, based on labels Flux writes and the inventory
Common misconceptions① “Turning on selfHeal makes the cluster exactly match Git” — fields and resources not declared in Git are outside its scope. ② “prune deletes every resource in the namespace that is not in Git” — it only deletes resources tracked by this application. ③ “Turning selfHeal off stops automatic sync” — new Git commits still trigger automatic sync. ④ “selfHeal is instantaneous” — by default there is a 5-second wait and it depends on watch events; when it conflicts with controllers such as HPA it keeps fighting (remove replicas from Git or use ignoreDifferences).

Decision diagram: how a resource is handled

Resource has a tracking-idand belongs to this application? No → unmanagednot compared · not fixed · not deleted Yes → is it in the Git renderoutput? Yes → any diff?(only compares fields declared in Git) No → requires pruningdeleted only if prune=true diff → OutOfSyncreverted only if selfHeal=true no diff → Synced
Figure 7-1 Tracked → in the desired state? → any difference? Three questions decide a resource's fate

selfHeal timeline

t=0 kubectl scale 5 watch event → compareOutOfSync (cluster-side change) wait for self-heal timeout (default 5s) automatic sync: apply replicas=1 Syncedextra Pods terminated
Figure 7-2 Self-heal is driven by watch events, usually completes within seconds, and does not depend on the 3-minute polling

Drift simulator

Turn selfHeal and prune on / off (assuming automated is enabled), then perform actions on the cluster or Git and observe Argo CD's reaction. Each result corresponds to the table on the “Theory” page.

Application status:Synced · Healthy
Git (apps/podinfo/overlays/dev)
Cluster (podinfo-dev namespace)

Commands related to self-heal and prune

Command / configurationPurposeNotes
argocd app set NAME --self-healEnable self-healDisable: --self-heal=false
argocd app set NAME --auto-pruneEnable automatic pruningDisable: --auto-prune=false
argocd app sync NAME --prunePrune during manual syncfirst --dry-run preview
argocd app resources NAMEList resources, including the “requires pruning” marker--orphaned List orphaned resources (requires orphaned-resource monitoring enabled in the project)
annotation argocd.argoproj.io/sync-options: Prune=falsethis resource is never prunedthe application keeps showing an OutOfSync warning
annotation argocd.argoproj.io/sync-options: Delete=falsekeep this resource when the application is deletedPVCs, databases, etc.
Sync option PruneLast=trueprune after other resources have synced and become healthyapplication-level or resource-level
argocd app set podinfo-dev --self-heal --auto-prune
argocd app get podinfo-dev -o json | jq '.spec.syncPolicy'
{
  "automated": {
    "prune": true,
    "selfHeal": true
  }
}

Note: Fields in the output depend on the actual version (for example whether it shows enabled). Verify:argocd app get podinfo-dev | grep "Sync Policy" shows Automated (Prune).

Lab 7: drift, self-heal and prune (about 8 minutes)

Enable only automatic sync, not selfHeal; create drift:
argocd app set podinfo-dev --sync-policy automated --self-heal=false --auto-prune=false
kubectl -n podinfo-dev scale deploy podinfo --replicas=3
sleep 10; argocd app get podinfo-dev | grep -E 'Sync Status|Deployment'
kubectl -n podinfo-dev get deploy podinfo
Sync Status:        OutOfSync from main (2a7f5c3)
apps   Deployment  podinfo-dev  podinfo  OutOfSync  Healthy
NAME      READY   UP-TO-DATE   AVAILABLE   AGE
podinfo   3/3     3            3           30m

Drift is detected (OutOfSync), but not corrected.

Enable selfHeal:
argocd app set podinfo-dev --self-heal
sleep 10; kubectl -n podinfo-dev get deploy podinfo
kubectl -n podinfo-dev scale deploy podinfo --replicas=5; sleep 10; kubectl -n podinfo-dev get deploy podinfo
NAME      READY   UP-TO-DATE   AVAILABLE   AGE
podinfo   1/1     1            1           31m
deployment.apps/podinfo scaled
NAME      READY   UP-TO-DATE   AVAILABLE   AGE
podinfo   1/1     1            1           31m
Observe the blind spot:
kubectl -n podinfo-dev label deploy podinfo team=manual
kubectl -n podinfo-dev create configmap manual-cm --from-literal=k=v
sleep 10; argocd app get podinfo-dev | grep -E 'Sync Status'
kubectl -n podinfo-dev get deploy podinfo --show-labels; kubectl -n podinfo-dev get cm manual-cm

The application is still Synced: the label and the ConfigMap are both outside the scope declared in Git. Cleanup: kubectl -n podinfo-dev label deploy podinfo team- ; kubectl -n podinfo-dev delete cm manual-cm.

Pruning: first add a ConfigMap in Git, then delete it.
apiVersion: v1
kind: ConfigMap
metadata:
  name: demo-cm
data:
  purpose: "prune demo"
cd ~/gitops-lab
cat > apps/podinfo/overlays/dev/demo-cm.yaml <<'EOF'
apiVersion: v1
kind: ConfigMap
metadata:
  name: demo-cm
data:
  purpose: "prune demo"
EOF
sed -i 's#^- ../../base#- ../../base\n- demo-cm.yaml#' apps/podinfo/overlays/dev/kustomization.yaml
kubectl kustomize apps/podinfo/overlays/dev | grep -A3 'kind: ConfigMap'
git add -A && git commit -m "dev: add demo-cm" && git push
argocd app get podinfo-dev --refresh >/dev/null; argocd app wait podinfo-dev --sync --timeout 120
kubectl -n podinfo-dev get cm demo-cm -o jsonpath='{.metadata.annotations.argocd\.argoproj\.io/tracking-id}{"\n"}'

# now delete it from Git (prune is still off)
git rm -q apps/podinfo/overlays/dev/demo-cm.yaml
sed -i '/- demo-cm.yaml/d' apps/podinfo/overlays/dev/kustomization.yaml
git commit -am "dev: remove demo-cm" && git push
argocd app get podinfo-dev --refresh | grep -E 'Sync Status|ConfigMap'
podinfo-dev:/ConfigMap:podinfo-dev/demo-cm
Sync Status:        OutOfSync from main (5b2c9e8)
       ConfigMap   podinfo-dev  demo-cm  OutOfSync           requires pruning
argocd app set podinfo-dev --auto-prune
sleep 10; kubectl -n podinfo-dev get cm demo-cm
Error from server (NotFound): configmaps "demo-cm" not found

For core resources (empty group), the group part of the tracking-id is empty, so it is podinfo-dev:/ConfigMap:….

State at the end of this modulepodinfo-dev: automated + selfHeal + prune, image 6.17.0; compared with Module 0, the dev overlay in Git differs only in newTag. The comprehensive lab writes these settings into argocd/apps/podinfo-dev.yaml.

Case 1: HPA and selfHeal fight each other

Problem: The Deployment in Git sets replicas: 3, HPA scales to 8, selfHeal reverts to 3, and the replica count oscillates repeatedly. Approach: Workloads that use HPA do not set replicas in Git (remove that field in Kustomize), or configure /spec/replicas for ignoreDifferences (Hour 2). Limitation: On first creation it uses the default of 1 replica until HPA takes over.

Case 2: a directory rename deleted production

Problem: A refactor renamed overlays/prod but the Application's path was not updated, so rendering failed; in another case the path was corrected but the resource name changed, and prune deleted the Deployment with the old name, causing a brief outage. Approach: For rename-type changes, turn off prune first and clean up only after confirming the new resources are healthy; use PruneLast=true; production PRs must attach argocd app diff --local results.

Case 3: on-call manual scale-out gets “reverted”

Problem: Traffic spiked, and the on-call engineer kubectl scale scaled out, and selfHeal reverted it 5 seconds later. Approach: Incident runbook: ① pause automatic sync for this application in the UI / CLI (--sync-policy none), ② handle it manually, ③ raise a PR to make it permanent, ④ restore automatic sync. A better approach is HPA. Limitation: While paused, new Git commits will not be deployed automatically either.

Common self-heal and prune problems

The application stays OutOfSync, and the resource MESSAGE is "requires pruning"

Cause: The resource was removed from Git but prune is not enabled (or the resource carries Prune=false).

argocd app resources podinfo-dev | grep -i prun
argocd app sync podinfo-dev --prune --dry-run

Fix: After confirming it can be deleted, argocd app sync --prune or enable --auto-prune.

The replica count jumps back and forth between two values (selfHeal conflicts with HPA / other controllers)

Cause: Multiple controllers manage the same field.

kubectl -n podinfo-dev get hpa
kubectl -n podinfo-dev get deploy podinfo -o yaml | grep -B2 -A6 managedFields | head -30

Fix: Remove the field from Git or configure ignoreDifferences.

A manually added environment variable is never removed by selfHeal

Cause: The default client-side three-way merge only compares fields Argo CD has applied; entries not declared in Git do not take part in the comparison.

Fix: This is expected behavior; when strict control is needed, use admission policies to forbid manual changes, or evaluate the field-ownership semantics of Server-Side Apply / Server-Side Diff (Hour 2).

After switching to annotation tracking, old resources were not pruned

Cause: Old resources do not yet have the tracking annotation (annotations are written only after the next sync).

Fix: After switching, first run one sync on all applications, and only then make deletion-type changes (the recommendation in the official v3 upgrade notes).

Command-line questions
1. Protect a PVC: never prune it, and keep it when the application is deleted.
kubectl -n podinfo-dev annotate pvc data argocd.argoproj.io/sync-options='Prune=false,Delete=false' --overwrite
# A more GitOps approach: write this annotation into the PVC manifest in Git
2. Find all objects in the cluster that carry a tracking annotation and belong to podinfo-dev (Deployments and Services among any kinds).
kubectl -n podinfo-dev get deploy,svc,cm -o json | jq -r '.items[] | select(.metadata.annotations["argocd.argoproj.io/tracking-id"] // "" | startswith("podinfo-dev:")) | .kind + "/" + .metadata.name'
Scenario analysis question
A security audit found an “unclaimed” Deployment in the production namespace, while Argo CD shows all applications as Synced. Why did Argo CD not notice it? How can this be prevented?

The Deployment has no application's tracking annotation, so it belongs to no application, and Argo CD will neither compare nor prune it (type ③ drift). Prevention: enable in the AppProject orphanedResources orphaned resource monitoring (warn: true, Hour 4) so orphaned resources are visible in the UI / status; use Kubernetes RBAC to restrict human users' write permissions on production namespaces; use admission policies (Kyverno / Gatekeeper) to require resources to carry tracking annotations or to reject writes from non-Argo CD service accounts.

Verified instructional videos

▶
ArgoCD Tutorial for Beginners | GitOps CD for Kubernetes — TechWorld with Nana
English · the video demonstrates selfHeal and prune configuration (from the v2 era; for tracking defaults, follow this course)

Official docs

Video storyboard (about 90 seconds)

Shot 1 · 0–25s
Scene: kubectl scale to 5, the replica icon increases and the Argo CD card turns yellow; after the selfHeal switch is turned on, a 5-second countdown, and the replicas shrink back to 1.
Narration: self-heal handles cluster-side drift: a field declared in Git that was changed is reverted within seconds.
Shot 2 · 25–50s
Scene: the demo-cm file is deleted in Git; in the cluster demo-cm shows a red “requires pruning” marker; it disappears once prune is turned on.
Narration: prune handles resources deleted from Git. It is off by default because deletion is destructive.
Shot 3 · 50–75s
Scene: kubectl create configmap manual-cm; Argo CD does not react, and a magnifying glass and a question mark appear beside it.
Narration: resources without a tracking annotation belong to no application; Argo CD cannot see them and will not delete them.
Shot 4 · 75–90s
Scene: a shield labeled Prune=false, Delete=false is attached to the PVC.
Narration: for stateful resources, add protection with annotations.
or score ≥ 70% on the quiz

Module 8 · Readiness review and introductory troubleshooting

50:00 – 60:00 · what to check before handing the first application to the team; in what order to look when something goes wrong
10 minutesInteractive troubleshooting tree★★★★☆
Learning objectives
  • Review the Argo CD installation and the first application against a 12-item readiness checklist (security, rebuildability, observability, process).
  • Master the fixed order of troubleshooting: application status and conditions → resource-level messages → Kubernetes events → Argo CD component logs.
  • Independently resolve 5 types of beginner problems: ComparisonError, authentication failures, sync failures (apply rejected), stuck Progressing, and stuck OutOfSync.
Prerequisites: Modules 1–7. Importance:★★★★☆

What: readiness checklist (within the scope of this course)

#CategoryCheck itemStatus in this courseCompleted in
1RebuildableAll Argo CD installation parameters are in Git (bootstrap/argocd-values.yaml), chart version pinned✓—
2RebuildableApplication manifests are in Git (argocd/apps/)Completed in the comprehensive labHour 3 (App of Apps)
3SecurityChange the initial password and delete argocd-initial-admin-secret✓—
4SecurityUse SSO; disable or restrict the local admin✗ (lab)Hour 4
5SecurityDo not use default a project to host production applications✗ (lab)Hour 4
6SecurityRepository credentials are read-only and minimally scoped (GitHub App / deploy key)public repositoryHours 4–5
7SecurityTrusted TLS certificate (not relying on --insecure)✗ (lab)Hour 4 / AKS course
8VersionedImages use pinned tags / digests; the main branch is protected✓ / recommended—
9ObservableAlerts for Degraded, persistent OutOfSync, and sync failures✗Hour 6 Notifications, Prometheus course
10Processthe process and permissions for pausing automatic sync during an incidentDocumentedHour 4 RBAC
11ResilienceComponent resource requests/limits, HA, backup (argocd admin export)✗ (single replica)Hour 7
12Change detectionWebhook or a reasonable polling intervalPollingHour 7

How: the fixed troubleshooting order

  1. Application layer: argocd app get NAME — look at Sync / Health,CONDITIONS (ComparisonError, SyncError, InvalidSpecError, OrphanedResourceWarning, etc.), and the Operation's Phase and Message.
  2. Resource layer: the MESSAGE column of the resource table in the same output; argocd app resources; argocd app diff.
  3. Kubernetes layer: kubectl describe / kubectl get events / Pod logs — most health problems are found here.
  4. Argo CD component layer: for rendering problems check the repo-server logs; for sync, self-heal and status not updating check the application-controller logs; for login, Webhook and UI check the argocd-server logs.

Why: look at the reasons in conditions first

Argo CD aggregates problems such as comparison failures, sync failures and spec errors in status.conditions , together with the raw error text (usually the error reported by repo-server in kustomize build / git ). Most beginner problems can be located in the first step, without digging through component logs.

When: common problems grouped by layer

SymptomLayerTypical causes
Sync Unknown + ComparisonErrorRenderingWrong path, Kustomize syntax, repository authentication, repo-server failure
Sync failed (Operation Failed)Syncapply rejected (admission webhook, immutable field, CRD not installed, namespace does not exist)
Synced but stuck in Progressing / DegradedKubernetesImage, probes, insufficient resources, LoadBalancer without an IP
OutOfSync again right after syncDiffOther controllers modify fields, default-value normalization differences (Hour 2 ignoreDifferences / SSD)
CLI / UI login failureAPIport-forward, certificate, password, RBAC
Common misconceptions① “Restart the Argo CD components first when something goes wrong” — most problems can be found in the application conditions and Kubernetes events, and restarting loses the evidence. ② “Argo CD's Degraded is an Argo CD problem” — it only reports the workload status. ③ “Deleting and recreating the application fixes OutOfSync” — this usually only hides the root cause, and with a finalizer it will also delete the workloads.

Troubleshooting layer diagram

① Application layerargocd app get · Sync/Health · CONDITIONS · Operation Phase/Message ② Resource layerResource table MESSAGE · app resources · app diff · requires pruning ③ Kubernetes layerdescribe · events · Pod logs · rollout status ④ Argo CD component layerrepo-server (rendering) · controller (sync / status) · server (login / Webhook)
Figure 8-1 From top to bottom: the lower you go, the closer you get to the root cause, but the noisier the information

Quick routing by symptom

Symptom Unknown → repo-server / Git Sync Failed → apply error Degraded → K8s events reproduce locally with kubectl kustomize kubectl apply --dry-run=server fix Git with git revert after the fix, refresh / sync
Figure 8-2 First steps and fix directions for the three most common symptoms

Interactive: readiness scorecard

Tick the items that match your actual environment (results are saved in this browser). Each item is weighted by importance; red items must be resolved before going to production.

Troubleshooting command list

LayerCommandWhat to look at
Applicationargocd app get NAMECONDITIONS, Operation, resource MESSAGE
Applicationkubectl -n argocd get app NAME -o jsonpath='{.status.conditions}'does not depend on the API Server
Resourceargocd app diff NAME / argocd app manifests NAMEdesired vs live differences / render output
Kuberneteskubectl -n NS get events --sort-by=.lastTimestampscheduling, image pulls, probes
Kuberneteskubectl apply --dry-run=server -k DIRreproduce why apply was rejected
Componentkubectl -n argocd logs deploy/argocd-repo-server | grep -i errorrendering, Git
Componentkubectl -n argocd logs argocd-application-controller-0 | grep podinfo-devsync, self-heal
Componentkubectl -n argocd logs deploy/argocd-serverlogin, Webhook
Backupargocd admin export -n argocd > backup.yamlexport Applications / Projects / configuration (includes secrets; keep safe)
argocd app get podinfo-dev -o json | jq '{sync: .status.sync.status, health: .status.health.status, conditions: .status.conditions, op: .status.operationState.phase, msg: .status.operationState.message}'
{
  "sync": "Synced",
  "health": "Healthy",
  "conditions": null,
  "op": "Succeeded",
  "msg": "successfully synced (all tasks run)"
}

Lab 8: reproduce and fix 3 common failures (about 9 minutes)

Prerequisite: podinfo-dev has automated + selfHeal + prune enabled (the state at the end of Module 7). Every fault is created through Git and fixed through Git.

Fault A: Kustomize syntax error → ComparisonError
cd ~/gitops-lab
sed -i 's/^images:/imagez:/' apps/podinfo/overlays/dev/kustomization.yaml
git commit -am "break: typo in kustomization" && git push
argocd app get podinfo-dev --refresh | grep -A3 CONDITION
CONDITION        MESSAGE                                                                                              LAST TRANSITION
ComparisonError  Failed to load target state: failed to generate manifest for source 1 of 1: rpc error: code = Unknown desc = `kustomize build <path>/apps/podinfo/overlays/dev` failed exit status 1: Error: invalid Kustomization: json: unknown field "imagez"  ...
kubectl kustomize apps/podinfo/overlays/dev >/dev/null   # reproduce locally
git revert --no-edit HEAD && git push
argocd app get podinfo-dev --refresh | grep -E 'Sync Status|CONDITION'

Note: workloads are not affected while rendering fails (Argo CD does not delete anything just because it cannot render).

Fault B: non-existent image → Synced + Progressing / Degraded
sed -i 's/newTag: "6.17.0"/newTag: "6.99.99"/' apps/podinfo/overlays/dev/kustomization.yaml
git commit -am "break: bad image tag" && git push
argocd app get podinfo-dev --refresh >/dev/null; sleep 30
argocd app get podinfo-dev | grep -E 'Sync Status|Health Status|Deployment'
kubectl -n podinfo-dev get pods
kubectl -n podinfo-dev get events --sort-by=.lastTimestamp | tail -3
Sync Status:        Synced to main (e41a7b9)
Health Status:      Progressing
apps   Deployment  podinfo-dev  podinfo  Synced  Progressing  Waiting for rollout to finish: 1 old replicas are pending termination...
NAME                       READY   STATUS             RESTARTS   AGE
podinfo-5d8c7b9f6d-k2m4x   1/1     Running            0          20m
podinfo-7f6b5c4d3e-q9w8e   0/1     ImagePullBackOff   0          30s
... Failed to pull image "ghcr.io/stefanprodan/podinfo:6.99.99": ... not found
git revert --no-edit HEAD && git push
argocd app get podinfo-dev --refresh >/dev/null; argocd app wait podinfo-dev --health --timeout 180

The old Pods keep serving (protected by maxUnavailable during the rolling update); after progressDeadlineSeconds (default 600 seconds) is exceeded, health becomes Degraded.

Fault C: apply rejected → sync failure (changing the immutable Deployment field selector)
cat >> apps/podinfo/overlays/dev/kustomization.yaml <<'EOF'
- target:
    kind: Deployment
    name: podinfo
  patch: |-
    - op: add
      path: /spec/selector/matchLabels/tier
      value: web
    - op: add
      path: /spec/template/metadata/labels/tier
      value: web
EOF
kubectl kustomize apps/podinfo/overlays/dev | grep -A4 'selector:'
git commit -am "break: change immutable selector" && git push
argocd app get podinfo-dev --refresh >/dev/null; sleep 15
argocd app get podinfo-dev | sed -n '/Operation/,/Message/p'
Operation:          Sync
Sync Revision:      b7d2e10...
Phase:              Failed
Message:            one or more objects failed to apply, reason: Deployment.apps "podinfo" is invalid: spec.selector: Invalid value: ...: field is immutable

The appended block is patches: the second item of the list (the end of the file happens to be the patches list). The Deployment's selector is immutable, so apply is rejected by the API Server. The fix is to revert; if the selector really must change, use the sync option Replace=true or delete and then recreate (this interrupts service; Hour 2).

git revert --no-edit HEAD && git push
argocd app get podinfo-dev --refresh >/dev/null; argocd app wait podinfo-dev --sync --health --timeout 180
Closing check:
kubectl kustomize ~/gitops-lab/apps/podinfo/overlays/dev | grep -E 'image:|tier'
argocd app get podinfo-dev | grep -E 'Sync Status|Health Status'
        image: ghcr.io/stefanprodan/podinfo:6.17.0
Sync Status:        Synced to main (…)
Health Status:      Healthy

Case 1: a GitHub outage

Problem: GitHub is partially unavailable and all applications show ComparisonError; the on-call engineer mistakenly thought the cluster had failed. Approach: First check the error text in conditions (failed to list refs … 503), confirm it is an external dependency; workloads are not affected, only delivery is paused. Limitation: For long outages, consider an internal Git mirror.

Case 2: a sync failure went unalerted; production stayed on the old version for 2 days

Problem: A change to an immutable field caused the sync to fail, and automatic sync does not retry the same SHA. Approach: Alert on operationState.phase=Failed ; add kubectl apply --dry-run=server (against a test cluster) to catch such problems.

Case 3: readiness review as a go-live gate

Approach: The platform team uses this module's 12-item checklist as the admission condition for new teams joining Argo CD; each item maps to a capability taught in a later course (SSO, AppProject, notifications, HA). Limitation: The checklist must be updated with versions (for example, the v3 RBAC log-permission changes).

Interactive troubleshooting tree

Start from the symptom you see, click through step by step, and get diagnostic commands and fix suggestions.

Command-line questions
1. Without going through the Argo CD API Server, print all condition types and messages for podinfo-dev.
kubectl -n argocd get app podinfo-dev -o json | jq -r '.status.conditions[]? | .type + ": " + .message'
2. Before syncing, reproduce whether the API Server would reject the dev overlay.
kubectl apply --dry-run=server -k ~/gitops-lab/apps/podinfo/overlays/dev
Scenario analysis question
A new colleague says: “podinfo-dev is OutOfSync; I clicked Sync and it showed success, but after a while it is OutOfSync again.” How would you investigate?

A typical “drifts again after sync”. ① argocd app diff check which field; ② determine who is changing it: HPA (replicas), mutating webhooks (injecting sidecars / defaults), another controller, or a person; ③ kubectl get … -o yaml the managedFields in managedFields shows who manages each field; ④ fix: delete that field from Git,ignoreDifferences or enable Server-Side Diff to handle defaults correctly (Hour 2); if a person changed it by hand, enable selfHeal and constrain permissions.

Verified instructional videos

No verified video was found that specifically covers beginner troubleshooting for Argo CD v3; use the official docs and storyboard below.

Official docs

Video storyboard (about 90 seconds)

Shot 1 · 0–20s
Scene: a four-layer pyramid: application, resource, Kubernetes, component.
Narration: troubleshoot from the top down: first the application status and conditions, then the resource messages, then the Kubernetes events, and finally the Argo CD component logs.
Shot 2 · 20–45s
Scene: in a ComparisonError message, “unknown field imagez” is highlighted.
Narration: an unknown state plus a comparison error means rendering failed. The error text usually tells you directly which line is wrong.
Shot 3 · 45–70s
Scene: Synced + Progressing, and ImagePullBackOff in the Pod list.
Narration: synced but unhealthy means the problem is in the workload itself. Fix Git, not re-sync.
Shot 4 · 70–90s
Scene: Operation Failed, field is immutable.
Narration: a sync failure means the API server rejected the change. Automatic sync will not retry the same commit, so remember to set up an alert.
or score ≥ 70% on the quiz

Command cheat sheet

All commands and key configuration used in Hour 1, grouped by scenario
Environment and installation
kind create cluster --config ~/gitops-lab/bootstrap/kind-lab.yaml
kubectl config use-context kind-lab
helm repo add argo https://argoproj.github.io/argo-helm && helm repo update
helm upgrade --install argocd argo/argo-cd -n argocd --create-namespace \
  --version 10.18.0 -f ~/gitops-lab/bootstrap/argocd-values.yaml --wait
helm get values argocd -n argocd --all
kubectl -n argocd get pods
Login and accounts
kubectl -n argocd port-forward svc/argocd-server 8080:443
argocd admin initial-password -n argocd
argocd login localhost:8080 --username admin --insecure
argocd account update-password
kubectl -n argocd delete secret argocd-initial-admin-secret
argocd login --core          # core mode (uses kubeconfig)
argocd admin dashboard -n argocd
Create and view applications
argocd app create podinfo-dev --project default \
  --repo https://github.com/<you>/gitops-lab.git --revision main \
  --path apps/podinfo/overlays/dev \
  --dest-server https://kubernetes.default.svc --dest-namespace podinfo-dev \
  --sync-option CreateNamespace=true
kubectl apply -n argocd -f ~/gitops-lab/argocd/apps/podinfo-dev.yaml
argocd app list
argocd app get podinfo-dev [--refresh|--hard-refresh]
argocd app resources podinfo-dev
argocd app manifests podinfo-dev --source git|live
argocd app history podinfo-dev
Diff and sync
argocd app diff podinfo-dev            # 0 no difference / 1 differences / 2 error
argocd app diff podinfo-dev --local ~/gitops-lab/apps/podinfo/overlays/dev
argocd app sync podinfo-dev [--dry-run] [--prune]
argocd app wait podinfo-dev --sync --health --timeout 180
argocd app terminate-op podinfo-dev
argocd app rollback podinfo-dev ID     # manual sync mode only
kubectl -n argocd annotate app podinfo-dev argocd.argoproj.io/refresh=hard --overwrite
Sync policy
argocd app set podinfo-dev --sync-policy automated
argocd app set podinfo-dev --self-heal --auto-prune
argocd app set podinfo-dev --self-heal=false --auto-prune=false
argocd app set podinfo-dev --sync-policy none     # pause during an incident
argocd app set podinfo-dev --sync-option CreateNamespace=true
argocd app unset podinfo-dev --kustomize-image ghcr.io/stefanprodan/podinfo
Troubleshooting
kubectl -n argocd get app podinfo-dev -o jsonpath='{.status.conditions}'
kubectl kustomize ~/gitops-lab/apps/podinfo/overlays/dev
kubectl apply --dry-run=server -k ~/gitops-lab/apps/podinfo/overlays/dev
kubectl -n podinfo-dev get events --sort-by=.lastTimestamp
kubectl -n argocd logs deploy/argocd-repo-server --tail=100
kubectl -n argocd logs argocd-application-controller-0 --tail=100
kubectl -n argocd logs deploy/argocd-server --tail=100
argocd admin export -n argocd > argocd-backup.yaml

Key configuration at a glance

LocationKeyValue in this course / defaultMeaning
argocd-cmtimeout.reconciliation / .jitter120s / 60speriodic refresh interval and jitter (up to about 3 minutes)
argocd-cmtimeout.hard.reconciliation0s (off)periodic hard refresh
argocd-cmapplication.resourceTrackingMethodannotation (v3 default)resource tracking method
argocd-cmd-params-cmserver.insecurefalseserver terminates TLS itself
argocd-cmd-params-cmcontroller.resource.health.persistnot set (not persisted in v3)resource health written into CR
Applicationspec.syncPolicy.automated.{enabled,prune,selfHeal,allowEmpty}dev: true/true/true/falseAutomatic sync policy
Resource annotationsargocd.argoproj.io/sync-optionsPrune=false,Delete=falseresource-level protection
resource annotationargocd.argoproj.io/tracking-idapp:group/Kind:ns/namewritten by Argo CD; do not edit by hand

Status at a glance

SyncSynced · OutOfSync · Unknown
HealthHealthy · Progressing · Degraded · Suspended · Missing · Unknown (the application takes the worst)
OperationRunning · Succeeded · Failed · Error · Terminating

Comprehensive lab: fully hand podinfo-dev over to GitOps

Put the Application itself into Git, enable automatic sync / self-heal / prune, and verify drift is corrected — this is also the starting point of Hour 2
about 20 minutesOutput: argocd/apps/podinfo-dev.yaml

Scenario

The team requires: everything in the dev environment (including the Argo CD Application definition) comes from the gitops-lab repo; manual changes must be corrected within seconds; resources deleted from Git must disappear from the cluster. You need to deliver a declarative argocd/apps/podinfo-dev.yaml, and demonstrate drift and pruning.

Starting point If you have completed Modules 0–7: start directly. If you do not have the previous results: Create the cluster and repo skeleton following steps 1–4 of “Environment setup”, install Argo CD and log in following the Module 3 lab, then start from step 1 below (step 1 creates the application, so the Module 4 CLI steps are not needed).
Write a declarative Application (full file):
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: podinfo-dev
  namespace: argocd
  labels:
    app.kubernetes.io/part-of: podinfo
    env: dev
  finalizers:
  # When this Application is deleted, cascade-delete the resources it manages (acceptable for the dev environment)
  - resources-finalizer.argocd.argoproj.io
spec:
  project: default
  source:
    repoURL: https://github.com/<you>/gitops-lab.git
    targetRevision: main
    path: apps/podinfo/overlays/dev
  destination:
    server: https://kubernetes.default.svc
    namespace: podinfo-dev
  syncPolicy:
    automated:
      enabled: true
      prune: true
      selfHeal: true
      allowEmpty: false
    syncOptions:
    - CreateNamespace=true
    - PruneLast=true
    retry:
      limit: 3
      backoff:
        duration: 10s
        factor: 2
        maxDuration: 2m
Commit and apply:
cd ~/gitops-lab
git add argocd/apps/podinfo-dev.yaml
git commit -m "argocd: declarative podinfo-dev application" && git push
kubectl apply -n argocd -f argocd/apps/podinfo-dev.yaml
argocd app get podinfo-dev | grep -E 'Sync Policy|Sync Status|Health Status'
application.argoproj.io/podinfo-dev configured
Sync Policy:        Automated (Prune)
Sync Status:        Synced to main (…)
Health Status:      Healthy

If an application with the same name was created earlier with the CLI,kubectl apply it will take it over and update it (it may warn about a missing last-applied annotation, which can be ignored); parameter overrides applied earlier with argocd app set will be replaced by the definition in the YAML. From Hour 3, this file will be managed automatically by the root application argocd/root.yaml so there is no longer a need for kubectl apply.

Verify version and content:
kubectl -n podinfo-dev get deploy podinfo -o jsonpath='{.spec.template.spec.containers[0].image}{"  replicas="}{.spec.replicas}{"\n"}'
kubectl -n podinfo-dev get deploy podinfo -o jsonpath='{.metadata.annotations.argocd\.argoproj\.io/tracking-id}{"\n"}'
ghcr.io/stefanprodan/podinfo:6.17.0  replicas=1
podinfo-dev:apps/Deployment:podinfo-dev/podinfo

A reader starting from scratch will see 6.16.0 (Module 6's upgrade not yet done); this is also normal, and you can commit the upgrade following step 1 of the Module 6 lab.

Drift 1: modify a declared field:
kubectl -n podinfo-dev set image deploy/podinfo podinfod=ghcr.io/stefanprodan/podinfo:6.16.0
kubectl -n podinfo-dev scale deploy podinfo --replicas=4
sleep 15
kubectl -n podinfo-dev get deploy podinfo -o jsonpath='{.spec.template.spec.containers[0].image}{"  replicas="}{.spec.replicas}{"\n"}'
ghcr.io/stefanprodan/podinfo:6.17.0  replicas=1
Drift 2: delete a managed resource:
kubectl -n podinfo-dev delete svc podinfo
sleep 15; kubectl -n podinfo-dev get svc podinfo
NAME      TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)    AGE
podinfo   ClusterIP   10.96.88.143   <none>        9898/TCP   8s
Pruning: remove a resource through Git (first add a ConfigMap, then delete it, using the same method as step 4 of the Module 7 lab; file apps/podinfo/overlays/dev/demo-cm.yaml). After confirming the deletion, kubectl -n podinfo-dev get cm demo-cm it returns NotFound.
Audit:
argocd app history podinfo-dev
git -C ~/gitops-lab log --oneline -8

Every REVISION in the sync history can be found as a commit in git log.

Deliverables and cleanup: keep the environment (Hour 2 reuses it directly). The repository should contain: apps/podinfo/base/{kustomization,deployment,service}.yaml,apps/podinfo/overlays/{dev,staging,prod}/kustomization.yaml,argocd/apps/podinfo-dev.yaml,bootstrap/{kind-lab.yaml,argocd-values.yaml},argocd/appsets/.gitkeep,argocd/projects/.gitkeep,README.md. To release resources: kind delete cluster --name lab (everything in Git can be rebuilt within 15 minutes).

Acceptance checklist

Open-ended self-test (6 questions)

1. Explain the four GitOps principles in your own words, and give one example that violates each.

Declarative (violation: a deployment script that calls kubectl scale / set image step by step); versioned and immutable (violation: latest a mutable tag, force push); pulled automatically (violation: CI holds the kubeconfig and pushes); continuously reconciled (violation: aligned only at deploy time, manual changes go unnoticed).

2. When argocd-server, repo-server or application-controller goes down, what symptom appears in each case?

server: UI / CLI / Webhook unavailable, reconciliation and self-heal continue; repo-server: ComparisonError, Sync Unknown, no new changes are deployed; controller: status does not update, no sync, no self-heal. None of the three affects running workloads.

3. Why does this course install Argo CD with the Helm chart and put the values file into Git?

All settings are centralized in one reviewable, versioned file; later courses only need to modify values and helm upgrade; the installation can be reproduced fully when the cluster is rebuilt; the chart handles details such as CRD retention.

4. What do Synced + Degraded and OutOfSync + Healthy each mean? How does the handling differ?

The former: the cluster matches Git, but the version in Git itself is faulty → fix Git (revert). The latter: the cluster differs from Git but runs normally → look at the diff, decide whether it is an unsynced new commit or drift, then sync or enable self-heal.

5. Which kinds of drift do selfHeal and prune each handle? Which drifts can neither of them handle?

selfHeal: declared fields that were changed and managed resources that were deleted. prune: resources removed from Git that are still tracked. Neither handles: resources without a tracking annotation (manually created), fields not declared in Git, and periods when Argo CD is paused or failing.

6. Your team is evaluating Argo CD and Flux. List three requirements that would push you toward Flux and three that would push you toward Argo CD.

Leaning Flux: relies on Helm-native release semantics and automatic rollback on failure; prefers a lightweight, UI-less solution with pure Kubernetes RBAC; uses the AKS / Arc managed GitOps extension. Leaning Argo CD: dev teams need a UI to view the resource tree and diff; centralized management of multiple clusters is needed; SSO + fine-grained RBAC + AppProject multi-tenancy is needed.

Final quiz (12 questions, covering all modules)

Sources and version notes

Verification basis for all technical facts in this course (verified 2026-11-17)
TopicVerified conclusionSource (accessed 2026-11-17)
Argo CD versionLatest stable v3.6.1 (2026-11-04); v3.6.0 (2026-11-03); patch lines v3.5.7, v3.4.13, v3.3.19 (2026-11-02)github.com/argoproj/argo-cd/releases
Helm chartargo/argo-cd 10.18.0 (2026-11-11), appVersion v3.6.1, kubeVersion >=1.25.0-0; values keys: global.domain,crds.install/keep,configs.cm (default timeout.reconciliation: 120s,timeout.reconciliation.jitter: 60s,timeout.hard.reconciliation: 0s,application.instanceLabelKey: argocd.argoproj.io/instance),configs.params,dex.enabled (default true),redis-ha.enabled (default false),notifications.enabled (default true),commitServer.enabled (default false),redisSecretInit.enabled (default true)argo-helm releases · charts/argo-cd (Chart.yaml, values.yaml @ argo-cd-10.18.0)
v2.14 → v3.0 changesannotation tracking by default; log RBAC enforced (removed server.rbac.log.enforce.enable); fine-grained update/delete RBAC not inherited; default resource.exclusions (Endpoints, EndpointSlice, Lease, etc.); removed argocd-cm in repositories,repository.credentials,helm.repositories; Dex subject changed to federated_claims.user_id; health no longer persisted (controller.resource.health.persist); ignoreResourceStatusField default all; ignoreDifferences also applies to resource updates; metrics argocd_app_sync_status etc. removedUpgrading 2.14 → 3.0
v3.5 → v3.6 changesServer-Side Diff is used automatically when ServerSideApply=true ; OTLP settings changed; app diff --local default includes *.tpl,Chart.lockUpgrading 3.5 → 3.6
automatic syncautomated.enabled/prune/selfHeal/allowEmpty; triggers only when OutOfSync; the same SHA is not auto-retried after failure; self-heal timeout defaults to 5 seconds; polling defaults to 120s + 60s jitter (up to about 3 minutes)Automated Sync Policy
CLIargocd app diff exit codes 0/1/2 and --refresh,--hard-refresh,--local; argocd app unset --kustomize-image; argocd app list no parameter to filter by healthCLI reference
GitOps principlesOpenGitOps v1.0.0 four principles: Declarative; Versioned and Immutable; Pulled Automatically; Continuously Reconciled (the original text uses “state store” and does not restrict it to Git)opengitops.dev · open-gitops/documents PRINCIPLES.md
FluxLatest v2.10.0 (2026-10-26); object model GitRepository / OCIRepository / HelmRepository, Kustomization, HelmRelease; helm-controller uses the Helm SDKfluxcd/flux2 releases · fluxcd.io/flux/components
kindv0.33.0 (2026-08-26), node image kindest/node:v1.37.0@sha256:a1ed56cf… (consistent with the Kubernetes course)kind releases
podinfo6.17.0 (2026-10-26), 6.16.0 (2026-10-26); port 9898,/healthz,/readyz, environment variable PODINFO_UI_MESSAGEstefanprodan/podinfo releases

Video verification notes

The following videos were checked for title and channel via the YouTube oEmbed API (https://www.youtube.com/oembed?url=…&format=json, 2026-11-17): TechWorld with Nana “What is GitOps, How GitOps works and Why it's so useful” (f5EpcWp0THw), “ArgoCD Tutorial for Beginners | GitOps CD for Kubernetes” (MeU5_k9ssrs); DevOps & AI Toolkit “Argo CD - Applying GitOps Principles To Manage A Production Environment In Kubernetes” (vpWQeoaiRM4); That DevOps Guy “Introduction to Argo CD : Kubernetes DevOps CI/CD” (2WSJF7d8dUg); KodeKloud “ArgoCD Tutorial: Step-by-Step Installation and UI App Deployment | KodeKloud” (8AJlVQy6Cx0); Argo Proj “Argo CD Demo” (0WAm0y2vLIo). Most of these videos were recorded in the Argo CD v1/v2 era, so follow this course for installation methods and defaults. No dedicated, verified videos were found for Modules 5 and 8, so storyboards are provided instead.

Voice narration notes

The “Voice” page uses the browser's Web Speech API (speechSynthesis, en-US) to read the narration script aloud in real time, with English terms pronounced in en-US. The result depends on the voices installed on the operating system. This courseware's build environment cannot call a TTS service, so no MP3 is embedded; for offline audio, give the narration script to any TTS tool.

Known limitations

  • Commands in this courseware have not been run on a real cluster; the “expected output” is an example written from the official docs and CLI behavior, and the commit SHAs, Pod name suffixes, IPs, times and log fields are example values; follow your own environment.
  • The keys of the values file were checked against chart 10.18.0's values.yaml verification; helm template rendered output and the Pod list (such as whether the redis-secret-init Job is kept) depend on the actual version.
  • The exact error messages (ComparisonError, immutable field, rollback refusal, etc.) may differ slightly between versions; locate them by keyword.
  • In a kind environment GitHub cannot reach localhost, so this course does not demonstrate a Git Webhook (Hour 7 demonstrates it with an in-cluster Gitea).
  • For Argo CD v3.6's official “tested Kubernetes versions”, follow the release notes; this course is written for kind's default v1.37.0.
  • The timings in the animations (polling jitter, the 5-second self-heal wait, component startup order) are illustrative, meant to explain the mechanism, and do not represent exact timing.
  • The Flux section is an architecture comparison only; no Flux commands are run in this course. Hands-on Flux content is in the Helm course and Hour 5 of the AKS course.