Argo CD is the tool most likely to be sitting in front of you on exam day, and the Application resource is its entire API: source, destination, and syncPolicy. Everything in the web UI is just a view over that object, and everything that breaks shows up in its status.
make coreOrientation
Two hours of hands-on Argo CD practice pays back more exam points than any other tool in this curriculum. Know the Application spec cold, keep the two status axes straight, drive the CLI without hesitation, and know which component produces the error when a sync goes sideways.
The components
| Component | Job | Errors it produces |
|---|---|---|
| repo-server | Clones git repos and renders Kustomize or Helm | Auth failures, template/render errors, missing paths |
| application-controller | Compares live vs git, syncs, and reports health | API server rejections, prune/hook failures, OutOfSync |
| api-server | Serves the UI, CLI, RBAC, and SSO | Login and permission errors |
| redis | Caches rendered manifests and live cluster state | Weird staleness after a Redis restart |
When a task says "the app won't sync", your first split is simple: did rendering fail (repo-server) or did applying fail (application-controller)? The error message tells you immediately, and knowing which pod's logs to pull cuts your debug time in half.
The Application spec
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: demo-staging
namespace: argocd # apps live in the controller's namespace
spec:
project: default # AppProject = the guardrails (see below)
source:
repoURL: http://gitea.lab:3000/lab/platform.git
targetRevision: HEAD # branch, tag, or commit SHA
path: demo-app/overlays/staging # or chart: + helm: for a chart source
destination:
server: https://kubernetes.default.svc # or name: in-cluster
namespace: team-a
syncPolicy:
automated: { prune: true, selfHeal: true }
syncOptions:
- CreateNamespace=true
retry:
limit: 3
backoff: { duration: 5s, factor: 2, maxDuration: 3m }For targetRevision, setting HEAD or a branch means "follow whatever moves there", while a tag or commit SHA means immutable. Pinning production apps to a SHA and promoting by bumping it is a clean, auditable pattern.
The two status axes
| Axis | Values | Answers |
|---|---|---|
| Sync | Synced · OutOfSync · Unknown | Does live state match git? |
| Health | Healthy · Progressing · Degraded · Missing · Suspended · Unknown | Are the running resources actually okay? |
Git told the cluster to run a broken image, and the cluster faithfully ran it broken. Sync is green because there's zero diff between git and live; health is red because the Deployment can't roll out. Clicking Sync again won't fix a thing; you need a git commit. Learn to spot this state on sight; section 2.6 opens with it.
Every combination tells a different story, and each has one clear first move:
Health is computed per resource kind using built-in checks (a Deployment is Healthy when its available replicas match desired, a LoadBalancer Service waits for an external IP, and so on). Custom kinds rely on custom Lua health checks, which is how Argo CD knows how to report on CRDs like Argo Rollouts. When a custom resource stays stuck in Progressing forever, either it has no health check registered or its status conditions never settle.
syncPolicy, decided before you need it
- Manual: flags
OutOfSyncand waits. Right for production environments where a human needs to approve the rollout. automated: syncs automatically whenever git moves.automated.selfHeal: true: continuously reverts live cluster drift back to git.automated.prune: true: deletes live resources whose manifests disappear from git. Watch this one carefully: leave it off and renaming a resource orphans the old copy forever; turn it on and deleting a file deletes production.
Sync options worth memorizing
| Option | What it fixes |
|---|---|
| CreateNamespace=true | Destination namespace doesn't exist yet |
| Replace=true | Immutable-field errors; uses kubectl replace instead of apply |
| ServerSideApply=true | Oversized CRDs, field-manager conflicts, and last-applied annotation size limits |
| SkipDryRunOnMissingResource=true | CRs whose CRD lands from elsewhere during the same sync |
| PrunePropagationPolicy=foreground | Ordered deletion of owned child resources |
| ApplyOutOfSyncOnly=true | Large apps where re-applying every unchanged manifest is too slow |
You can set these app-wide in spec.syncPolicy.syncOptions or on a single resource via the argocd.argoproj.io/sync-options annotation. Know both placements.
The rest of the sync options
| Option | What it does | Placement |
|---|---|---|
| Prune=false · Delete=false | Never prune this resource, or keep it alive when the Application is deleted (essential for PVCs and namespaces) | Resource annotation, or app-wide |
| Prune=confirm · Delete=confirm | Holds the sync in Running until a human approves via the argocd.argoproj.io/deletion-approved annotation (UI button or argocd app confirm-deletion) | Either |
| PruneLast=true | Runs pruning as a final implicit wave after every other resource is healthy | Either |
| RespectIgnoreDifferences=true | Honors ignoreDifferences during apply too, so Argo stops stomping on an HPA's replica count | App |
| FailOnSharedResource=true | Fails the sync if another Application already owns a resource | App |
| Validate=false | Skips OpenAPI schema validation (useful with ServerSideApply partial manifests or RawExtension kinds) | Either |
| Force=true | Deletes and recreates the resource; only applies with Replace=true or client-side apply | Resource annotation |
| ServerSideApply=true | Uses kubectl apply --server-side --force-conflicts; supports partial-manifest patches and auto-migrates client-side managedFields | Either (use ServerSideApply=false to opt one resource out) |
Replace=true takes precedence over ServerSideApply=true. Namespace metadata has one special rule: syncPolicy.managedNamespaceMetadata sets labels and annotations on namespaces created by CreateNamespace=true, though an explicit Namespace manifest in the repo always wins over it.
Ordering: waves and hooks
A sync runs in phases, and within the Sync phase it walks through numbered waves. Lower numbers run first (default is 0), so adding argocd.argoproj.io/sync-wave: "-1" puts a resource ahead of the pack. Argo CD waits for every resource in a wave to report Healthy before moving to the next one.
PreSync ──▶ Sync (wave -1 → 0 → 1 → …) ──▶ PostSync ──▶ SyncFail (only on failure) │ │ │ │ │ └─ smoke-test Job │ └─ CRDs, then CRs, then apps └─ db migration Job
Hooks are plain manifests carrying argocd.argoproj.io/hook: PreSync|Sync|PostSync|SyncFail|PostDelete|Skip, usually paired with hook-delete-policy (HookSucceeded, BeforeHookCreation, or HookFailed) so completed Jobs don't pile up. The classic pairing is a database migration Job in PreSync and a smoke test in PostSync.
If you own both the CRD and the CR, put the CRD in wave -1. If the CRD comes from somewhere you don't control, annotate the CR with SkipDryRunOnMissingResource=true so Argo CD's pre-apply dry run stops choking on it.
Scale patterns and guardrails
AppProject
An AppProject draws the security fence around a group of Applications: which sourceRepos they can pull from, which destinations (cluster + namespace pairs) they can target, which cluster-scoped and namespaced kinds are allowed or blocked, plus per-project RBAC roles and sync windows (time ranges when syncing is permitted or denied). In a multi-tenant platform, this is how teams self-serve deployments without being able to sneak a ClusterRoleBinding into kube-system. If a task says "team X may only deploy to namespace Y from repo Z", the answer is an AppProject, not a Kubernetes Role.
app-of-apps vs ApplicationSet
- app-of-apps: one root Application whose manifests are other Applications. Simple, explicit, and easy to review because you write each child yourself. It shines when bootstrapping a cluster's platform layer in a strict wave order.
- ApplicationSet: a template paired with generators that stamp out Applications automatically. Generators to know on sight:
list,clusters,git(directories or files in a repo),scmProvider(every matching repo in an org),pullRequest(ephemeral preview environments), andmatrix/mergeto combine them. SettinggoTemplate: trueswitches templating to Go templates with Sprig functions.
On the exam, the testable skill is reading a generator block and predicting exactly which Applications will be created. In this lab, examples/argocd-appset.yaml stamps out one app per overlay directory in git, and the Backstage golden path (section 3.6) uses an SCM generator watching the Gitea services org.
An ApplicationSet template sets destination.namespace on each generated app, but an explicit namespace: inside a manifest or kustomization always wins. That's why the lab's overlays land in team-a and team-b regardless of what the template's destination says.
Other clusters
destination.server: https://kubernetes.default.svc (or name: in-cluster) targets the local cluster. Any remote cluster has to be registered first: argocd cluster add <context> creates a ServiceAccount over there and saves its credentials in a Secret in argocd labeled argocd.argoproj.io/secret-type: cluster. That Secret is the exact object an ApplicationSet's clusters generator iterates over, so multi-cluster fan-out and "deploy to the second cluster" are really the same mechanism. Run argocd cluster list to see what's registered, and check the AppProject's destinations to see who's allowed to target it.
Diffing quirks
ignoreDifferences (using group/kind with jsonPointers or a jq path) keeps a mutating webhook or an HPA-managed replica count from causing permanent drift. argocd.argoproj.io/compare-options: IgnoreExtraneous hides extra resources Argo didn't create. Both exist because "stuck OutOfSync forever on a field nobody edits" is one of the most common day-2 headaches.
CLI, because the UI wastes exam time
argocd login <server> --username admin \
--password $(kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath='{.data.password}' | base64 -d) --insecure
argocd app list
argocd app get demo-staging
argocd app diff demo-staging # what would change
argocd app sync demo-staging # --prune, --force, --resource
argocd app history demo-staging # and: argocd app rollback demo-staging <id>
argocd app set demo-staging --sync-policy automated --self-healoutputcaptured 2026-08-26
$ argocd login 172.18.0.9 --username admin \
--password $(kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath='{.data.password}' | base64 -d) --insecure
WARNING: server is not configured with TLS. Proceed (y/n)? 'admin:login' logged in successfully
Context '172.18.0.9' updated
$ argocd app list
NAME CLUSTER NAMESPACE PROJECT STATUS HEALTH SYNCPOLICY CONDITIONS REPO PATH TARGET
argocd/demo-prod https://kubernetes.default.svc prod default Synced Progressing Auto-Prune <none> http://gitea.lab:3000/lab/platform.git demo-app/overlays/prod main
argocd/demo-staging https://kubernetes.default.svc staging default Synced Progressing Auto-Prune <none> http://gitea.lab:3000/lab/platform.git demo-app/overlays/staging main
$ argocd app get demo-staging
Name: argocd/demo-staging
Project: default
Server: https://kubernetes.default.svc
Namespace: staging
URL: https://argocd.example.com/applications/demo-staging
Source:
- Repo: http://gitea.lab:3000/lab/platform.git
Target: main
Path: demo-app/overlays/staging
SyncWindow: Sync Allowed
Sync Policy: Automated (Prune)
Sync Status: Synced to main (c7cb9a1)
Health Status: Progressing
GROUP KIND NAMESPACE NAME STATUS HEALTH HOOK MESSAGE
Namespace staging Running Synced namespace/staging created
Service team-a staging-demo Synced Healthy service/staging-demo created
apps Deployment team-a staging-demo Synced Progressing deployment.apps/staging-demo created
$ argocd app diff demo-staging # what would change
$ argocd app sync demo-staging # --prune, --force, --resource
TIMESTAMP GROUP KIND NAMESPACE NAME STATUS HEALTH HOOK MESSAGE
2026-08-26T22:17:01-04:00 Service team-a staging-demo Synced Healthy
2026-08-26T22:17:01-04:00 apps Deployment team-a staging-demo Synced Healthy
2026-08-26T22:17:02-04:00 Service team-a staging-demo Synced Healthy service/staging-demo unchanged
2026-08-26T22:17:02-04:00 apps Deployment team-a staging-demo Synced Healthy deployment.apps/staging-demo unchanged
Name: argocd/demo-staging
Project: default
Server: https://kubernetes.default.svc
Namespace: staging
URL: https://argocd.example.com/applications/demo-staging
Source:
- Repo: http://gitea.lab:3000/lab/platform.git
Target: main
Path: demo-app/overlays/staging
SyncWindow: Sync Allowed
Sync Policy: Automated (Prune)
Sync Status: Synced to main (c7cb9a1)
Health Status: Healthy
Operation: Sync
Sync Revision: c7cb9a1e37949219ff64e2c5dd17654109deea6d
Phase: Succeeded
Start: 2026-08-26 22:17:01 -0400 EDT
Finished: 2026-08-26 22:17:02 -0400 EDT
Duration: 1s
Message: successfully synced (all tasks run)
GROUP KIND NAMESPACE NAME STATUS HEALTH HOOK MESSAGE
Service team-a staging-demo Synced Healthy service/staging-demo unchanged
apps Deployment team-a staging-demo Synced Healthy deployment.apps/staging-demo unchanged
$ argocd app history demo-staging # and: argocd app rollback demo-staging <id>
SOURCE http://gitea.lab:3000/lab/platform.git
ID DATE REVISION
0 2026-08-26 22:16:43 -0400 EDT main (c7cb9a1)
1 2026-08-26 22:17:02 -0400 EDT main (c7cb9a1)
$ argocd app set demo-staging --sync-policy automated --self-healargocd app get --refresh forces a fresh comparison against git, while --hard-refresh also clears the manifest cache. Reach for --hard-refresh whenever you pushed a commit and Argo insists nothing changed.
Argo CD 3.x defaults and the vocabulary of status
Defaults that differ from what older tutorials assume
- Annotation tracking is now the default (
application.resourceTrackingMethod: annotation). Resources getargocd.argoproj.io/tracking-id: <app>:<group>/<kind>:<ns>/<name>instead of the oldapp.kubernetes.io/instancelabel (useannotation+labelif another tool still expects the label). Because the annotation names the exact object, copied resources like HNC copies stop showing up as false drift. - Fine-grained RBAC:
updateanddeleteonapplicationsno longer cover an Application's child resources; those requireupdate/*anddelete/*(or a scoped rule likeupdate/apps/Deployment/ns/name).logs, getis also a first-class permission now; without it, the UI logs tab renders blank. - Default
resource.exclusionskeep high-churn kinds out of the cache: Endpoints, EndpointSlice, Lease, the SubjectAccessReview family, CertificateSigningRequest, Kyverno reports, cert-manager CertificateRequest, and Cilium identities and endpoints. If a question asks why Argo CD "can't see" a Lease, this is why. - Status ignored in diffs across all resource kinds (previously CRDs only), so controllers writing to
.statusnever trigger falseOutOfSyncstates. - Minor-release milestones: 3.1 added
oci://sources and CLI plugins; 3.2 loosened OCI layer rules and unified UI deletion; 3.3 requires server-side apply to install the ApplicationSet CRD (it outgrew the client-side annotation size limit); 3.4 updated the cluster version format and Teams notifications; and 3.5 (August 2026) promoted the Source Hydrator and impersonation to beta while adding internal mTLS, git commit signature verification, ApplicationSets in any namespace, and Helm 4 support.
Status fields
| Field | Values | Read it when |
|---|---|---|
| status.sync.status | Synced · OutOfSync · Unknown | Unknown means comparison itself failed; go straight to conditions |
| status.health.status | Healthy · Progressing · Degraded · Suspended · Missing · Unknown | Aggregate health of managed resources; Missing means a desired resource doesn't exist live |
| status.operationState.phase | Running · Terminating · Succeeded · Failed · Error | Failed means the API server rejected an apply; Error means Argo itself hit a snag (render, network); Terminating follows argocd app terminate-op |
| status.operationState.syncResult.resources[].status | Synced · SyncFailed · Pruned · PruneSkipped | Per-resource result carrying the API server's rejection verbatim |
| status.conditions[].type | ComparisonError · InvalidSpecError · SyncError · DeletionError · UnknownError · SharedResourceWarning · RepeatedResourceWarning · ExcludedResourceWarning · OrphanedResourceWarning | Errors block reconciliation while warnings don't. SharedResourceWarning flags two apps claiming one resource; InvalidSpecError flags an AppProject refusal. |
| status.sourceHydrator.currentOperation.phase | Hydrating · Hydrated · Failed | Only populated when using the Source Hydrator |
When you see an InvalidSpecError saying "application repo X is not permitted in project Y" or "destination namespace Z is not permitted", that's the AppProject pushing back. Fix the project's sourceRepos or destinations, not the Application.
Deletion and refresh mechanics
- Cascade deletion is controlled by the finalizer
resources-finalizer.argocd.argoproj.io(foreground) orresources-finalizer.argocd.argoproj.io/background.argocd app delete Xadds it, whereas--cascade=falsestrips it so workloads stay running (the "unmanage without deleting" move). Withkubectl, patch the finalizer in or out before deleting.PreDeleteandPostDeletehooks run only on Application deletion and stall it with aDeletionErrorif they fail. - Refresh without the CLI: annotate the Application with
argocd.argoproj.io/refresh: normalorhard, and the controller strips the annotation once it runs. Addingargocd.argoproj.io/skip-reconcile: "true"freezes an Application completely (alpha; status stops updating). - Hooks and waves: hook cleanup defaults to
BeforeHookCreationif nohook-delete-policyis set. Don't putttlSecondsAfterFinishedon hook Jobs, or Kubernetes may garbage-collect a Job Argo CD is still waiting on. Pruning walks waves in reverse order, with a 2 s pause between waves (ARGOCD_SYNC_WAVE_DELAY).
Run argocd app get X, then kubectl -n argocd get app X -o jsonpath='{.status.conditions}'. The first gives you sync and health; the second gives you the exact condition type, which points straight at the broken object: InvalidSpecError → AppProject or spec, ComparisonError → repo-server or credentials, SyncError → API server rejection.
ApplicationSet behavior, RBAC and notifications
Generators: what each one yields
- list: literal
elements. The simplest fan-out and the one to reach for when a task hands you three clusters by name. - clusters: one parameter set per registered cluster Secret (
name,server, and Secret labels undermetadata.labels.*), filterable withselector. Note that the local cluster only shows up if you've explicitly registered it. - git directories:
path: apps/*emitspath.path,path.basename,path.basenameNormalized, andpath.segments. Entries withexclude: truedrop directories, and dot-directories are skipped. git files turns every matching JSON or YAML file into a parameter set populated with its keys. - matrix: cartesian product of exactly two generators. The second generator can reference parameters from the first, and combination generators only nest one level deep.
- merge: starts with a base generator and overrides matching entries from later generators on
mergeKeys, following the same nesting limit. - scmProvider (repos in an org) and pullRequest (open PRs matching
labels,branchMatch, ortitleMatch): Applications come and go automatically with repos or PRs, powering ephemeral preview environments.requeueAfterSecondssets the poll interval; webhooks make it immediate. - plugin (RPC to a custom service), clusterDecisionResource (a placement CR), and oci (directories or files inside an OCI artifact).
For templates, pair goTemplate: true with goTemplateOptions: ["missingkey=error"] so typos fail loudly instead of silently rendering an empty string, and use normalize or slugify to keep generated names DNS-safe. Watch out for collisions: two generated Applications with the same name silently collapse into one.
Controlling what the controller may do
spec.syncPolicy.applicationsSynccontrols lifecycle rights:sync(default: create, update, delete),create-only,create-update, orcreate-delete. The controller's global--policyflag overrides this unless policy override is enabled.spec.syncPolicy.preserveResourcesOnDeletion: truekeeps live workloads alive when the ApplicationSet is deleted. To preserve the child Applications themselves, you also need the finalizer on the ApplicationSet and background deletion.spec.ignoreApplicationDifferenceslets humans toggle settings like auto-sync on a generated Application without the ApplicationSet controller snapping them back.- Progressive syncs (experimental, opt-in): configure
strategy.type: RollingSyncwithsteps[].matchExpressionsover Application labels andmaxUpdate. Each cohort must reach Healthy before the next begins, and it forces auto-sync off on the generated Applications.
RBAC in one table
| Line in policy.csv | Meaning |
|---|---|
| p, role:team-a, applications, get, team-a/*, allow | Allows reading every Application in project team-a (object format is <project>/<app>) |
| p, role:team-a, applications, sync, team-a/*, allow | Allows syncing them; update, delete, override, and action/* are separate verbs |
| p, role:team-a, logs, get, team-a/*, allow | Required since 3.0 to view pod logs in the UI |
| g, oidc-group-team-a, role:team-a | Binds an SSO group (or user) to the role |
| policy.default: role:readonly | Fallback role for authenticated users with no explicit rule (leave empty to deny everything) |
Valid RBAC resources are applications, applicationsets, clusters, projects, repositories, accounts, certificates, gpgkeys, logs, exec, and extensions. The exact same syntax works inside an AppProject's spec.roles[].policies, scoped to that project, and project roles can mint JWTs for CI. Project-scoped repositories and clusters (adding a project: field to the Secret) let a team register its own sources without exposing them to anyone else.
Notifications and sync windows
- Notifications live in
argocd-notifications-cm(service.slack,service.webhook.<name>,trigger.on-sync-failed,template.app-sync-failed) with credentials inargocd-notifications-secret. Subscribe by annotating an Application or AppProject, e.g.notifications.argoproj.io/subscribe.on-sync-succeeded.slack: my-channel. Installing the built-in catalog gives you standard triggers likeon-deployed,on-health-degraded,on-sync-failed, andon-sync-status-unknown. - Sync windows on an AppProject take
kind: allow|deny, a cronschedule, aduration, and selectors forapplications,namespaces, orclusters. SettingmanualSync: truelets a human bypass a deny window, and an active deny always beats an active allow.
"Team A may deploy only from repo R into namespace N and must be able to sync but not delete" translates to an AppProject with sourceRepos: [R], destinations: [{server, namespace: N}], and a project role granting applications, get and applications, sync (without delete), bound to the team's group. Prove the guardrail works by pointing a test Application at a disallowed repo or namespace and checking its conditions for InvalidSpecError.
Exercises
Apply the example and predict its output before looking:
kubectl apply -f examples/argocd-appset.yaml
kubectl -n argocd get applications
kubectl -n team-a get deploy staging-demo && kubectl -n team-b get deploy prod-demooutputcaptured 2026-08-26
$ kubectl apply -f examples/argocd-appset.yaml
applicationset.argoproj.io/demo-envs created
$ kubectl -n argocd get applications
NAME SYNC STATUS HEALTH STATUS
demo-prod Synced Progressing
demo-staging Synced Progressing
$ kubectl -n team-a get deploy staging-demo && kubectl -n team-b get deploy prod-demo
NAME READY UP-TO-DATE AVAILABLE AGE
staging-demo 0/3 3 0 15s
NAME READY UP-TO-DATE AVAILABLE AGE
prod-demo 0/3 3 0 16sThe ApplicationSet template sets destination.namespace to the directory basename, but the overlays pin namespace: team-a and team-b inside their kustomizations. Because an explicit namespace in a manifest always overrides the Application's destination default, the workloads land in the tenant namespaces prefixed staging- and prod-. If an app gets stuck, inspect its conditions: kubectl -n argocd get app demo-staging -o jsonpath='{.status.conditions}' | jq.
demo-staging and demo-prod Applications exist (one per overlay directory in the platform repo), and both settle to Synced/Healthy.Your replica change from section 2.1 is already sitting in the platform repo, so demo-staging will pick it up on the next poll (up to ~3 min) or immediately if you run argocd app sync demo-staging.
kubectl -n team-a get deploy staging-demo -o jsonpath='{.spec.replicas}' matches your commit, and argocd app history demo-staging lists the revision.The ApplicationSet template enables automated sync, self-heal, and prune. Try scaling the live Deployment anyway:
kubectl -n team-a scale deploy staging-demo --replicas=5
kubectl -n team-a get deploy staging-demo -woutputcaptured 2026-08-26
$ kubectl -n team-a scale deploy staging-demo --replicas=5
deployment.apps/staging-demo scaled
$ kubectl -n team-a get deploy staging-demo -w
NAME READY UP-TO-DATE AVAILABLE AGE
staging-demo 3/5 3 3 21s
staging-demo 3/5 3 3 21s
staging-demo 3/5 5 3 22s
staging-demo 3/3 5 3 22s
staging-demo 3/3 5 3 23s
staging-demo 3/3 5 3 23s
staging-demo 3/3 3 3 23s
staging-demo 3/3 3 3 26s
staging-demo 3/3 3 3 55s
^CNext, test prune the safe way: service.yaml lives in demo-app/base/, so remove it from the base kustomization's resources list, push, and watch the live Service vanish from both tenants (a base edit hits every overlay, so always watch the blast radius). Revert the commit and watch both Services come right back.
argocd app get demo-staging never stays OutOfSync, and the Service round-trips with your commit. Git history is your undo button.Drop a manifest for a made-up CR (whose CRD doesn't exist) into the staging overlay, push, and read the sync error. Then fix it cleanly for the case where you own both: add the CRD to the same overlay with argocd.argoproj.io/sync-wave: "-1" and leave the CR at wave 0. Remember the companion tool too: argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true, for when the CRD comes from outside your repo.
kubectl get <your-kind> returns the CR. Clean up the overlay afterward since you'll reuse it.Push a bogus image tag (newTag: does-not-exist in the staging kustomization), sync, and check the two axes side by side with argocd app get demo-staging | head -20. Health stays Progressing for up to ten minutes (the Deployment's progressDeadlineSeconds) before flipping to Degraded, but the pod's ImagePullBackOff shows up in events immediately. Progressing-with-a-broken-pod already tells you the whole story.
Synced while health heads toward Degraded, and you can explain why hitting sync again won't help. Revert the commit; this exact confusion opens section 2.6.Sync status and health are high-level summaries. operationState is the detailed record of the last sync attempt, with a result code per resource, and it's where a failed sync tells you what actually broke. Capture a clean run first, then break one resource and inspect it again.
# the LoadBalancer IP only exists when cloud-provider-kind runs; the NodePort is always there
ARGO=$(kubectl get node cnpe-control-plane -o jsonpath='{.status.addresses[?(@.type=="InternalIP")].address}'):$(kubectl -n argocd get svc argocd-server -o jsonpath='{.spec.ports[?(@.port==80)].nodePort}')
argocd login "$ARGO" --username admin --password "$(kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath='{.data.password}' | base64 -d)" --plaintext --grpc-web
argocd app wait demo-staging --operation --timeout 180 || true
argocd app sync demo-staging --timeout 120 || true
kubectl -n argocd get app demo-staging -o jsonpath='{.status.operationState.phase}{"\n"}{range .status.operationState.syncResult.resources[*]}{.kind}/{.name} {.status} {.message}{"\n"}{end}'
kubectl -n team-a delete deploy staging-demo --cascade=orphan
kubectl apply -f - <<'EOF'
apiVersion: apps/v1
kind: Deployment
metadata: { name: staging-demo, namespace: team-a }
spec:
replicas: 1
selector: { matchLabels: { app: something-else } }
template:
metadata: { labels: { app: something-else } }
spec:
containers: [{ name: web, image: nginx:1.27-alpine }]
EOF
argocd app wait demo-staging --operation --timeout 180 || true
argocd app sync demo-staging --timeout 120 || true
kubectl -n argocd get app demo-staging -o jsonpath='{.status.operationState.phase}{"\n"}{range .status.operationState.syncResult.resources[*]}{.kind}/{.name} {.status} {.message}{"\n"}{end}'
kubectl -n team-a delete deploy staging-demo
argocd app wait demo-staging --operation --timeout 180 || true
argocd app sync demo-staging --timeout 120outputcaptured 2026-11-18
$ # the LoadBalancer IP only exists when cloud-provider-kind runs; the NodePort is always there
$ ARGO=$(kubectl get node cnpe-control-plane -o jsonpath='{.status.addresses[?(@.type=="InternalIP")].address}'):$(kubectl -n argocd get svc argocd-server -o jsonpath='{.spec.ports[?(@.port==80)].nodePort}')
$ argocd login "$ARGO" --username admin --password "$(kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath='{.data.password}' | base64 -d)" --plaintext --grpc-web
'admin:login' logged in successfully
Context '172.18.0.12:32162' updated
$ argocd app wait demo-staging --operation --timeout 180 || true
Name: argocd/demo-staging
Project: default
Server: https://kubernetes.default.svc
Namespace: staging
URL: https://argocd.example.com/applications/demo-staging
Source:
- Repo: http://gitea.lab:3000/lab/platform.git
Target: main
Path: demo-app/overlays/staging
SyncWindow: Sync Allowed
Sync Policy: Automated (Prune)
Sync Status: Synced to main (55f63ae)
Health Status: Healthy
Operation: Sync
Sync Revision: 55f63ae149b35bc4c3aec26031456109b16f4f4b
Phase: Succeeded
Start: 2026-11-18 00:45:46 -0500 EST
Finished: 2026-11-18 00:45:47 -0500 EST
Duration: 1s
Message: successfully synced (all tasks run)
GROUP KIND NAMESPACE NAME STATUS HEALTH HOOK MESSAGE
apps Deployment team-a staging-demo Synced Healthy deployment.apps/staging-demo configured
Service team-a staging-demo Synced Healthy
$ argocd app sync demo-staging --timeout 120 || true
TIMESTAMP GROUP KIND NAMESPACE NAME STATUS HEALTH HOOK MESSAGE
2026-11-18T00:46:17-05:00 Service team-a staging-demo Synced Healthy
2026-11-18T00:46:17-05:00 apps Deployment team-a staging-demo Synced Healthy
2026-11-18T00:46:18-05:00 Service team-a staging-demo Synced Healthy service/staging-demo unchanged
2026-11-18T00:46:18-05:00 apps Deployment team-a staging-demo Synced Healthy deployment.apps/staging-demo unchanged
Name: argocd/demo-staging
Project: default
Server: https://kubernetes.default.svc
Namespace: staging
URL: https://argocd.example.com/applications/demo-staging
Source:
- Repo: http://gitea.lab:3000/lab/platform.git
Target: main
Path: demo-app/overlays/staging
SyncWindow: Sync Allowed
Sync Policy: Automated (Prune)
Sync Status: Synced to main (55f63ae)
Health Status: Healthy
Operation: Sync
Sync Revision: 55f63ae149b35bc4c3aec26031456109b16f4f4b
Phase: Succeeded
Start: 2026-11-18 00:46:17 -0500 EST
Finished: 2026-11-18 00:46:18 -0500 EST
Duration: 1s
Message: successfully synced (all tasks run)
GROUP KIND NAMESPACE NAME STATUS HEALTH HOOK MESSAGE
Service team-a staging-demo Synced Healthy service/staging-demo unchanged
apps Deployment team-a staging-demo Synced Healthy deployment.apps/staging-demo unchanged
$ kubectl -n argocd get app demo-staging -o jsonpath='{.status.operationState.phase}{"\n"}{range .status.operationState.syncResult.resources[*]}{.kind}/{.name} {.status} {.message}{"\n"}{end}'
Succeeded
Service/staging-demo Synced service/staging-demo unchanged
Deployment/staging-demo Synced deployment.apps/staging-demo unchanged
$ kubectl -n team-a delete deploy staging-demo --cascade=orphan
deployment.apps "staging-demo" deleted from team-a namespace
$ kubectl apply -f - <<'EOF'
apiVersion: apps/v1
kind: Deployment
metadata: { name: staging-demo, namespace: team-a }
spec:
replicas: 1
selector: { matchLabels: { app: something-else } }
template:
metadata: { labels: { app: something-else } }
spec:
containers: [{ name: web, image: nginx:1.27-alpine }]
EOF
Warning: would violate PodSecurity "restricted:latest": allowPrivilegeEscalation != false (container "web" must set securityContext.allowPrivilegeEscalation=false), unrestricted capabilities (container "web" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or container "web" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container "web" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")
deployment.apps/staging-demo created
$ argocd app wait demo-staging --operation --timeout 180 || true
TIMESTAMP GROUP KIND NAMESPACE NAME STATUS HEALTH HOOK MESSAGE
2026-11-18T00:46:20-05:00 Service team-a staging-demo Synced Healthy
2026-11-18T00:46:20-05:00 apps Deployment team-a staging-demo OutOfSync Missing
2026-11-18T00:46:20-05:00 apps ReplicaSet team-a staging-demo-5fbf76bbbf Healthy
2026-11-18T00:46:21-05:00 apps Deployment team-a staging-demo OutOfSync Missing error when patching "/dev/shm/209529445": Deployment.apps "staging-demo" is invalid: spec.selector: Invalid value: {"matchLabels":{"app":"demo","app.kubernetes.io/part-of":"demo-app"}}: field is immutable
2026-11-18T00:46:32-05:00 apps Deployment team-a staging-demo OutOfSync Missing error when patching "/dev/shm/1110977579": Deployment.apps "staging-demo" is invalid: spec.selector: Invalid value: {"matchLabels":{"app":"demo","app.kubernetes.io/part-of":"demo-app"}}: field is immutable
2026-11-18T00:46:51-05:00 apps Deployment team-a staging-demo OutOfSync Missing error when patching "/dev/shm/2404680201": Deployment.apps "staging-demo" is invalid: spec.selector: Invalid value: {"matchLabels":{"app":"demo","app.kubernetes.io/part-of":"demo-app"}}: field is immutable
2026-11-18T00:47:31-05:00 apps Deployment team-a staging-demo OutOfSync Missing error when patching "/dev/shm/3648205654": Deployment.apps "staging-demo" is invalid: spec.selector: Invalid value: {"matchLabels":{"app":"demo","app.kubernetes.io/part-of":"demo-app"}}: field is immutable
2026-11-18T00:48:50-05:00 apps Deployment team-a staging-demo OutOfSync Healthy error when patching "/dev/shm/3648205654": Deployment.apps "staging-demo" is invalid: spec.selector: Invalid value: {"matchLabels":{"app":"demo","app.kubernetes.io/part-of":"demo-app"}}: field is immutable
2026-11-18T00:48:52-05:00 apps Deployment team-a staging-demo OutOfSync Healthy error when patching "/dev/shm/3391637429": Deployment.apps "staging-demo" is invalid: spec.selector: Invalid value: {"matchLabels":{"app":"demo","app.kubernetes.io/part-of":"demo-app"}}: field is immutable
This is the state of the app after wait timed out:
The command timed out waiting for the conditions to be met.
Name: argocd/demo-staging
Project: default
Server: https://kubernetes.default.svc
Namespace: staging
URL: https://argocd.example.com/applications/demo-staging
Source:
- Repo: http://gitea.lab:3000/lab/platform.git
Target: main
Path: demo-app/overlays/staging
SyncWindow: Sync Allowed
Sync Policy: Automated (Prune)
Sync Status: OutOfSync from main (55f63ae)
Health Status: Healthy
Operation: Sync
Sync Revision: 55f63ae149b35bc4c3aec26031456109b16f4f4b
Phase: Running
Start: 2026-11-18 00:46:20 -0500 EST
Finished: 2026-11-18 00:48:52 -0500 EST
Duration: 2m32s
Message: one or more objects failed to apply, reason: error when patching "/dev/shm/3391637429": Deployment.apps "staging-demo" is invalid: spec.selector: Invalid value: {"matchLabels":{"app":"demo","app.kubernetes.io/part-of":"demo-app"}}: field is immutable. Retrying attempt #5 at 2026-11-18T05:50:12Z.
GROUP KIND NAMESPACE NAME STATUS HEALTH HOOK MESSAGE
apps Deployment team-a staging-demo OutOfSync Healthy error when patching "/dev/shm/3391637429": Deployment.apps "staging-demo" is invalid: spec.selector: Invalid value: {"matchLabels":{"app":"demo","app.kubernetes.io/part-of":"demo-app"}}: field is immutable
... 3 more lines
$ argocd app sync demo-staging --timeout 120 || true
{"level":"fatal","msg":"rpc error: code = FailedPrecondition desc = another operation is already in progress","time":"2026-11-18T00:49:21-05:00"}
$ kubectl -n argocd get app demo-staging -o jsonpath='{.status.operationState.phase}{"\n"}{range .status.operationState.syncResult.resources[*]}{.kind}/{.name} {.status} {.message}{"\n"}{end}'
Running
Deployment/staging-demo SyncFailed error when patching "/dev/shm/3391637429": Deployment.apps "staging-demo" is invalid: spec.selector: Invalid value: {"matchLabels":{"app":"demo","app.kubernetes.io/part-of":"demo-app"}}: field is immutable
$ kubectl -n team-a delete deploy staging-demo
deployment.apps "staging-demo" deleted from team-a namespace
$ argocd app wait demo-staging --operation --timeout 180 || true
TIMESTAMP GROUP KIND NAMESPACE NAME STATUS HEALTH HOOK MESSAGE
2026-11-18T00:49:21-05:00 apps Deployment team-a staging-demo OutOfSync Healthy error when patching "/dev/shm/3391637429": Deployment.apps "staging-demo" is invalid: spec.selector: Invalid value: {"matchLabels":{"app":"demo","app.kubernetes.io/part-of":"demo-app"}}: field is immutable
2026-11-18T00:49:21-05:00 Service team-a staging-demo Synced Healthy
2026-11-18T00:49:21-05:00 apps ReplicaSet team-a staging-demo-5fbf76bbbf Healthy
2026-11-18T00:51:15-05:00 apps Deployment team-a staging-demo OutOfSync Missing error when patching "/dev/shm/3391637429": Deployment.apps "staging-demo" is invalid: spec.selector: Invalid value: {"matchLabels":{"app":"demo","app.kubernetes.io/part-of":"demo-app"}}: field is immutable
2026-11-18T00:51:32-05:00 apps Deployment team-a staging-demo OutOfSync Missing deployment.apps/staging-demo created
2026-11-18T00:51:32-05:00 apps Deployment team-a staging-demo Synced Progressing deployment.apps/staging-demo created
Name: argocd/demo-staging
Project: default
Server: https://kubernetes.default.svc
Namespace: staging
URL: https://argocd.example.com/applications/demo-staging
Source:
- Repo: http://gitea.lab:3000/lab/platform.git
Target: main
Path: demo-app/overlays/staging
SyncWindow: Sync Allowed
Sync Policy: Automated (Prune)
Sync Status: Synced to main (55f63ae)
Health Status: Healthy
Operation: Sync
Sync Revision: 55f63ae149b35bc4c3aec26031456109b16f4f4b
Phase: Succeeded
Start: 2026-11-18 00:46:20 -0500 EST
Finished: 2026-11-18 00:51:32 -0500 EST
Duration: 5m12s
Message: successfully synced (all tasks run)
GROUP KIND NAMESPACE NAME STATUS HEALTH HOOK MESSAGE
apps Deployment team-a staging-demo Synced Healthy deployment.apps/staging-demo created
Service team-a staging-demo Synced Healthy
$ argocd app sync demo-staging --timeout 120
TIMESTAMP GROUP KIND NAMESPACE NAME STATUS HEALTH HOOK MESSAGE
2026-11-18T00:51:35-05:00 Service team-a staging-demo Synced Healthy
2026-11-18T00:51:35-05:00 apps Deployment team-a staging-demo Synced Healthy
2026-11-18T00:51:36-05:00 apps Deployment team-a staging-demo Synced Healthy deployment.apps/staging-demo unchanged
2026-11-18T00:51:36-05:00 Service team-a staging-demo Synced Healthy service/staging-demo unchanged
Name: argocd/demo-staging
Project: default
Server: https://kubernetes.default.svc
Namespace: staging
URL: https://argocd.example.com/applications/demo-staging
Source:
- Repo: http://gitea.lab:3000/lab/platform.git
Target: main
Path: demo-app/overlays/staging
SyncWindow: Sync Allowed
Sync Policy: Automated (Prune)
Sync Status: Synced to main (55f63ae)
Health Status: Healthy
Operation: Sync
Sync Revision: 55f63ae149b35bc4c3aec26031456109b16f4f4b
Phase: Succeeded
Start: 2026-11-18 00:51:35 -0500 EST
Finished: 2026-11-18 00:51:36 -0500 EST
Duration: 1s
Message: successfully synced (all tasks run)
GROUP KIND NAMESPACE NAME STATUS HEALTH HOOK MESSAGE
Service team-a staging-demo Synced Healthy service/staging-demo unchanged
apps Deployment team-a staging-demo Synced Healthy deployment.apps/staging-demo unchangedSucceeded with every resource Synced. Once you break the selector, operationState reports Deployment/staging-demo SyncFailed error when patching ...: spec.selector: Invalid value ...: field is immutable, the exact line you'd paste into an incident channel. Don't be surprised if the manual sync in the middle returns another operation is already in progress: auto-sync is on, so the controller beat you to it.An AppProject is the fence between what a tenant asks for and what the platform permits. When it says no, the Application doesn't fail to sync; it fails validation, and that distinction tells you immediately where to look.
# the LoadBalancer IP only exists when cloud-provider-kind runs; the NodePort is always there
ARGO=$(kubectl get node cnpe-control-plane -o jsonpath='{.status.addresses[?(@.type=="InternalIP")].address}'):$(kubectl -n argocd get svc argocd-server -o jsonpath='{.spec.ports[?(@.port==80)].nodePort}')
argocd login "$ARGO" --username admin --password "$(kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath='{.data.password}' | base64 -d)" --plaintext --grpc-web
kubectl -n argocd patch appproject default --type merge -p '{"spec":{"sourceRepos":["http://gitea.lab:3000/lab/platform.git"]}}'
# a throwaway Application: argocd app set tests repo connectivity before it writes, and the
# ApplicationSet that generated demo-staging puts the old repo back within seconds
kubectl apply -f - <<'EOF'
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata: { name: forbidden-repo, namespace: argocd }
spec:
project: default
source:
repoURL: https://github.com/argoproj/argocd-example-apps.git
targetRevision: HEAD
path: guestbook
destination: { server: https://kubernetes.default.svc, namespace: default }
EOF
sleep 20
kubectl -n argocd get app forbidden-repo -o jsonpath='{.status.conditions}' | jq '.[] | {type, message}'
kubectl -n argocd delete app forbidden-repo
kubectl -n argocd patch appproject default --type merge -p '{"spec":{"sourceRepos":["*"]}}'
kubectl -n argocd get app demo-staging -o jsonpath='{.status.sync.status}{"\n"}'outputcaptured 2026-09-13
$ # the LoadBalancer IP only exists when cloud-provider-kind runs; the NodePort is always there
$ ARGO=$(kubectl get node cnpe-control-plane -o jsonpath='{.status.addresses[?(@.type=="InternalIP")].address}'):$(kubectl -n argocd get svc argocd-server -o jsonpath='{.spec.ports[?(@.port==80)].nodePort}')
$ argocd login "$ARGO" --username admin --password "$(kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath='{.data.password}' | base64 -d)" --plaintext --grpc-web
'admin:login' logged in successfully
Context '172.18.0.4:32015' updated
$ kubectl -n argocd patch appproject default --type merge -p '{"spec":{"sourceRepos":["http://gitea.lab:3000/lab/platform.git"]}}'
appproject.argoproj.io/default patched
$ # a throwaway Application: argocd app set tests repo connectivity before it writes, and the
$ # ApplicationSet that generated demo-staging puts the old repo back within seconds
$ kubectl apply -f - <<'EOF'
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata: { name: forbidden-repo, namespace: argocd }
spec:
project: default
source:
repoURL: https://github.com/argoproj/argocd-example-apps.git
targetRevision: HEAD
path: guestbook
destination: { server: https://kubernetes.default.svc, namespace: default }
EOF
application.argoproj.io/forbidden-repo created
$ sleep 20
$ kubectl -n argocd get app forbidden-repo -o jsonpath='{.status.conditions}' | jq '.[] | {type, message}'
{
"type": "InvalidSpecError",
"message": "application repo https://github.com/argoproj/argocd-example-apps.git is not permitted in project 'default'"
}
$ kubectl -n argocd delete app forbidden-repo
application.argoproj.io "forbidden-repo" deleted from argocd namespace
$ kubectl -n argocd patch appproject default --type merge -p '{"spec":{"sourceRepos":["*"]}}'
appproject.argoproj.io/default patched
$ kubectl -n argocd get app demo-staging -o jsonpath='{.status.sync.status}{"\n"}'
Syncedforbidden-repo gets an InvalidSpecError condition reading application repo https://github.com/argoproj/argocd-example-apps.git is not permitted in project 'default'. Notice that the API server accepted the object and the controller rejected it, which is why the error lands in status rather than on kubectl apply. Don't try this by repointing demo-staging directly: argocd app set tests repo connectivity before writing, and the ApplicationSet would revert your change within seconds anyway.Cascade deletion is just a finalizer, not a law of nature. Deleting an Application without cascading leaves every managed object running and unowned: exactly what you want during a migration, and exactly what you never want to trigger by accident.
# the LoadBalancer IP only exists when cloud-provider-kind runs; the NodePort is always there
ARGO=$(kubectl get node cnpe-control-plane -o jsonpath='{.status.addresses[?(@.type=="InternalIP")].address}'):$(kubectl -n argocd get svc argocd-server -o jsonpath='{.spec.ports[?(@.port==80)].nodePort}')
argocd login "$ARGO" --username admin --password "$(kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath='{.data.password}' | base64 -d)" --plaintext --grpc-web
# a standalone Application, not one the ApplicationSet generates: deleting a generated one
# only makes the generator recreate it, and deleting the generator takes the workload with it
kubectl -n argocd delete app orphan-demo --ignore-not-found
kubectl apply -f - <<'EOF'
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: orphan-demo
namespace: argocd
finalizers: [resources-finalizer.argocd.argoproj.io]
spec:
project: default
source:
repoURL: http://gitea.lab:3000/lab/platform.git
targetRevision: main
path: demo-app/base
destination: { server: https://kubernetes.default.svc, namespace: orphan }
syncPolicy:
automated: {}
syncOptions: [CreateNamespace=true]
EOF
argocd app wait orphan-demo --health --timeout 180
kubectl -n argocd get app orphan-demo -o jsonpath='{.metadata.finalizers}{"\n"}'
kubectl -n orphan get deploy
argocd app delete orphan-demo --cascade=false -y
sleep 15
kubectl -n argocd get app orphan-demo || echo 'application gone'
kubectl -n orphan get deploy
kubectl delete ns orphanoutputcaptured 2026-09-12
$ # the LoadBalancer IP only exists when cloud-provider-kind runs; the NodePort is always there
$ ARGO=$(kubectl get node cnpe-control-plane -o jsonpath='{.status.addresses[?(@.type=="InternalIP")].address}'):$(kubectl -n argocd get svc argocd-server -o jsonpath='{.spec.ports[?(@.port==80)].nodePort}')
$ argocd login "$ARGO" --username admin --password "$(kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath='{.data.password}' | base64 -d)" --plaintext --grpc-web
'admin:login' logged in successfully
Context '172.18.0.4:32015' updated
$ # a standalone Application, not one the ApplicationSet generates: deleting a generated one
$ # only makes the generator recreate it, and deleting the generator takes the workload with it
$ kubectl -n argocd delete app orphan-demo --ignore-not-found
$ kubectl apply -f - <<'EOF'
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: orphan-demo
namespace: argocd
finalizers: [resources-finalizer.argocd.argoproj.io]
spec:
project: default
source:
repoURL: http://gitea.lab:3000/lab/platform.git
targetRevision: main
path: demo-app/base
destination: { server: https://kubernetes.default.svc, namespace: orphan }
syncPolicy:
automated: {}
syncOptions: [CreateNamespace=true]
EOF
Warning: metadata.finalizers: "resources-finalizer.argocd.argoproj.io": prefer a domain-qualified finalizer name including a path (/) to avoid accidental conflicts with other finalizer writers
application.argoproj.io/orphan-demo created
$ argocd app wait orphan-demo --health --timeout 180
TIMESTAMP GROUP KIND NAMESPACE NAME STATUS HEALTH HOOK MESSAGE
2026-09-13T11:58:57-04:00 Service orphan demo OutOfSync Missing
2026-09-13T11:58:57-04:00 apps Deployment orphan demo OutOfSync Missing
2026-09-13T11:58:58-04:00 Namespace orphan Running Synced namespace/orphan created
Name: argocd/orphan-demo
Project: default
Server: https://kubernetes.default.svc
Namespace: orphan
URL: https://argocd.example.com/applications/orphan-demo
Source:
- Repo: http://gitea.lab:3000/lab/platform.git
Target: main
Path: demo-app/base
SyncWindow: Sync Allowed
Sync Policy: Automated
Sync Status: OutOfSync from main (b793ef2)
Health Status: Healthy
GROUP KIND NAMESPACE NAME STATUS HEALTH HOOK MESSAGE
Namespace orphan Running Synced namespace/orphan created
Service orphan demo Synced Healthy service/demo created
apps Deployment orphan demo OutOfSync Missing deployment.apps/demo created
$ kubectl -n argocd get app orphan-demo -o jsonpath='{.metadata.finalizers}{"\n"}'
["resources-finalizer.argocd.argoproj.io"]
$ kubectl -n orphan get deploy
NAME READY UP-TO-DATE AVAILABLE AGE
demo 0/2 2 0 1s
$ argocd app delete orphan-demo --cascade=false -y
application 'orphan-demo' deleted
$ sleep 15
$ kubectl -n argocd get app orphan-demo || echo 'application gone'
Error from server (NotFound): applications.argoproj.io "orphan-demo" not found
application gone
$ kubectl -n orphan get deploy
NAME READY UP-TO-DATE AVAILABLE AGE
demo 2/2 2 2 17s
$ kubectl delete ns orphan
namespace "orphan" deleted--cascade=false strips it before deletion runs.argocd app get --refresh is just a thin wrapper over an annotation. Knowing that annotation lets you trigger a refresh from any box with kubectl access, even when the argocd CLI isn't installed.
BEFORE=$(kubectl -n argocd get app demo-staging -o jsonpath='{.status.reconciledAt}'); echo "before: $BEFORE"
kubectl -n argocd annotate app demo-staging argocd.argoproj.io/refresh=hard --overwrite
sleep 10
kubectl -n argocd get app demo-staging -o jsonpath='{.metadata.annotations}' | jq
kubectl -n argocd get app demo-staging -o jsonpath='{.status.reconciledAt}{"\n"}' | sed 's/^/after: /'outputcaptured 2026-09-12
$ BEFORE=$(kubectl -n argocd get app demo-staging -o jsonpath='{.status.reconciledAt}'); echo "before: $BEFORE"
before: 2026-09-13T10:45:51Z
$ kubectl -n argocd annotate app demo-staging argocd.argoproj.io/refresh=hard --overwrite
application.argoproj.io/demo-staging annotated
$ sleep 10
$ kubectl -n argocd get app demo-staging -o jsonpath='{.metadata.annotations}' | jq
{
"argocd.argoproj.io/hydrate": "normal"
}
$ kubectl -n argocd get app demo-staging -o jsonpath='{.status.reconciledAt}{"\n"}' | sed 's/^/after: /'
after: 2026-09-13T10:49:16ZreconciledAt has bumped forward. The controller consumes the annotation as its signal, which is why you never see it hanging around on a healthy app.Automatic pruning is the setting that can wipe production if someone deletes a file by mistake. Prune=confirm turns deletion into a pause that waits for human sign-off, and the sync operation says so right in its status.
# the LoadBalancer IP only exists when cloud-provider-kind runs; the NodePort is always there
ARGO=$(kubectl get node cnpe-control-plane -o jsonpath='{.status.addresses[?(@.type=="InternalIP")].address}'):$(kubectl -n argocd get svc argocd-server -o jsonpath='{.spec.ports[?(@.port==80)].nodePort}')
argocd login "$ARGO" --username admin --password "$(kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath='{.data.password}' | base64 -d)" --plaintext --grpc-web
# git -C rather than cd: a cd here would follow you into every later command in the session
rm -rf /tmp/platform-prune && git clone "http://lab:${GITEA_PASS}@gitea.lab:3000/lab/platform.git" /tmp/platform-prune
# set it on the template: the ApplicationSet controller overwrites a spec edit on the generated Application
kubectl -n argocd patch applicationset demo-envs --type merge -p '{"spec":{"template":{"spec":{"syncPolicy":{"syncOptions":["CreateNamespace=true","Prune=confirm"]}}}}}'
sleep 15
git -C /tmp/platform-prune rm demo-app/base/service.yaml
sed -i '/service.yaml/d' /tmp/platform-prune/demo-app/base/kustomization.yaml
git -C /tmp/platform-prune commit -am 'drop the service' && git -C /tmp/platform-prune push
argocd app sync demo-staging --prune --timeout 60 || true
kubectl -n argocd get app demo-staging -o jsonpath='{.status.operationState.phase}{"\n"}{.status.operationState.message}{"\n"}'
kubectl -n argocd annotate app demo-staging argocd.argoproj.io/deletion-approved="$(date -u +%Y-%m-%dT%H:%M:%SZ)" --overwrite
sleep 20
kubectl -n argocd get app demo-staging -o jsonpath='{.status.operationState.phase}{"\n"}'
git -C /tmp/platform-prune revert --no-edit HEAD && git -C /tmp/platform-prune push
# unset removes the option; setting Prune=false would just record a different value
kubectl -n argocd patch applicationset demo-envs --type merge -p '{"spec":{"template":{"spec":{"syncPolicy":{"syncOptions":["CreateNamespace=true"]}}}}}'
argocd app sync demo-staging --timeout 120
kubectl -n argocd get app demo-staging -o jsonpath='{.spec.syncPolicy.syncOptions}{"\n"}'
rm -rf /tmp/platform-pruneoutputcaptured 2026-11-18
$ # the LoadBalancer IP only exists when cloud-provider-kind runs; the NodePort is always there
$ ARGO=$(kubectl get node cnpe-control-plane -o jsonpath='{.status.addresses[?(@.type=="InternalIP")].address}'):$(kubectl -n argocd get svc argocd-server -o jsonpath='{.spec.ports[?(@.port==80)].nodePort}')
$ argocd login "$ARGO" --username admin --password "$(kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath='{.data.password}' | base64 -d)" --plaintext --grpc-web
'admin:login' logged in successfully
Context '172.18.0.12:32162' updated
$ # git -C rather than cd: a cd here would follow you into every later command in the session
$ rm -rf /tmp/platform-prune && git clone "http://lab:${GITEA_PASS}@gitea.lab:3000/lab/platform.git" /tmp/platform-prune
Cloning into '/tmp/platform-prune'...
warning: redirecting to http://gitea.lab:3000/lab/platform.git/
$ # set it on the template: the ApplicationSet controller overwrites a spec edit on the generated Application
$ kubectl -n argocd patch applicationset demo-envs --type merge -p '{"spec":{"template":{"spec":{"syncPolicy":{"syncOptions":["CreateNamespace=true","Prune=confirm"]}}}}}'
applicationset.argoproj.io/demo-envs patched
$ sleep 15
$ git -C /tmp/platform-prune rm demo-app/base/service.yaml
rm 'demo-app/base/service.yaml'
$ sed -i '/service.yaml/d' /tmp/platform-prune/demo-app/base/kustomization.yaml
$ git -C /tmp/platform-prune commit -am 'drop the service' && git -C /tmp/platform-prune push
[main af211cc] drop the service
2 files changed, 8 deletions(-)
delete mode 100644 demo-app/base/service.yaml
warning: redirecting to http://gitea.lab:3000/lab/platform.git/
To http://gitea.lab:3000/lab/platform.git
55f63ae..af211cc main -> main
$ argocd app sync demo-staging --prune --timeout 60 || true
TIMESTAMP GROUP KIND NAMESPACE NAME STATUS HEALTH HOOK MESSAGE
2026-11-18T00:54:51-05:00 Service team-a staging-demo Synced Healthy
2026-11-18T00:54:51-05:00 apps Deployment team-a staging-demo Synced Healthy
This is the state of the app after wait timed out:
The command timed out waiting for the conditions to be met.
Name: argocd/demo-staging
Project: default
Server: https://kubernetes.default.svc
Namespace: staging
URL: https://argocd.example.com/applications/demo-staging
Source:
- Repo: http://gitea.lab:3000/lab/platform.git
Target: main
Path: demo-app/overlays/staging
SyncWindow: Sync Allowed
Sync Policy: Automated (Prune)
Sync Status: Synced to main (55f63ae)
Health Status: Healthy
Operation: Sync
Sync Revision: af211ccc2910226606fe3559f9f32f3861d70dbf
Phase: Running
Start: 2026-11-18 00:54:51 -0500 EST
Finished: <nil>
Duration: 1m0s
Message: waiting for pruning confirmation of /Service/staging-demo
GROUP KIND NAMESPACE NAME STATUS HEALTH HOOK MESSAGE
Service team-a staging-demo Synced Healthy
apps Deployment team-a staging-demo Synced Healthy
{"level":"fatal","msg":"timed out (60s) waiting for app \"demo-staging\" match desired state","time":"2026-11-18T00:55:51-05:00"}
$ kubectl -n argocd get app demo-staging -o jsonpath='{.status.operationState.phase}{"\n"}{.status.operationState.message}{"\n"}'
Running
waiting for pruning confirmation of /Service/staging-demo
$ kubectl -n argocd annotate app demo-staging argocd.argoproj.io/deletion-approved="$(date -u +%Y-%m-%dT%H:%M:%SZ)" --overwrite
application.argoproj.io/demo-staging annotated
$ sleep 20
$ kubectl -n argocd get app demo-staging -o jsonpath='{.status.operationState.phase}{"\n"}'
Succeeded
$ git -C /tmp/platform-prune revert --no-edit HEAD && git -C /tmp/platform-prune push
[main 34dd8a1] Revert "drop the service"
Date: Wed Nov 18 00:56:13 2026 -0500
2 files changed, 8 insertions(+)
create mode 100644 demo-app/base/service.yaml
warning: redirecting to http://gitea.lab:3000/lab/platform.git/
To http://gitea.lab:3000/lab/platform.git
af211cc..34dd8a1 main -> main
$ # unset removes the option; setting Prune=false would just record a different value
$ kubectl -n argocd patch applicationset demo-envs --type merge -p '{"spec":{"template":{"spec":{"syncPolicy":{"syncOptions":["CreateNamespace=true"]}}}}}'
applicationset.argoproj.io/demo-envs patched
$ argocd app sync demo-staging --timeout 120
TIMESTAMP GROUP KIND NAMESPACE NAME STATUS HEALTH HOOK MESSAGE
2026-11-18T00:56:15-05:00 apps Deployment team-a staging-demo Synced Healthy
2026-11-18T00:56:16-05:00 Service team-a staging-demo OutOfSync Healthy
2026-11-18T00:56:17-05:00 apps Deployment team-a staging-demo Synced Healthy deployment.apps/staging-demo unchanged
2026-11-18T00:56:17-05:00 Service team-a staging-demo OutOfSync Healthy service/staging-demo created
Name: argocd/demo-staging
Project: default
Server: https://kubernetes.default.svc
Namespace: staging
URL: https://argocd.example.com/applications/demo-staging
Source:
- Repo: http://gitea.lab:3000/lab/platform.git
Target: main
Path: demo-app/overlays/staging
SyncWindow: Sync Allowed
Sync Policy: Automated (Prune)
Sync Status: Synced to main (34dd8a1)
Health Status: Healthy
Operation: Sync
Sync Revision: 34dd8a1a893ac80025f048b52a8d0175018263eb
Phase: Succeeded
Start: 2026-11-18 00:56:15 -0500 EST
Finished: 2026-11-18 00:56:17 -0500 EST
Duration: 2s
Message: successfully synced (all tasks run)
GROUP KIND NAMESPACE NAME STATUS HEALTH HOOK MESSAGE
Service team-a staging-demo Synced Healthy service/staging-demo created
apps Deployment team-a staging-demo Synced Healthy deployment.apps/staging-demo unchanged
$ kubectl -n argocd get app demo-staging -o jsonpath='{.spec.syncPolicy.syncOptions}{"\n"}'
["CreateNamespace=true"]
$ rm -rf /tmp/platform-pruneargocd.argoproj.io/deletion-approved annotation. Make sure you patch the ApplicationSet template rather than the generated Application; otherwise the ApplicationSet controller reverts your edit on demo-staging within seconds and prunes unattended, making it look like the confirmation gate failed.A project role plus a token is how you let a tenant sync their own app and nothing else. Mint the token and actually exercise it: a denial prints the exact rule it expected, which is the fastest way to verify you granted what you meant to. Since argocd account can-i only works for a logged-in account and not a project token, testing with the token directly is the real check.
ARGO_PW=$(kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath='{.data.password}' | base64 -d)
# the LoadBalancer IP only exists when cloud-provider-kind runs; the NodePort is always there
ARGO=$(kubectl get node cnpe-control-plane -o jsonpath='{.status.addresses[?(@.type=="InternalIP")].address}'):$(kubectl -n argocd get svc argocd-server -o jsonpath='{.spec.ports[?(@.port==80)].nodePort}')
argocd login "$ARGO" --username admin --password "$ARGO_PW" --plaintext --grpc-web
argocd proj role create default deployer
# add-policy prepends the project, so the object here is the bare app name: 'default/demo-staging' would become default/default/demo-staging and match nothing
argocd proj role add-policy default deployer --action get --permission allow --object 'demo-staging'
kubectl -n argocd get appproject default -o jsonpath='{.spec.roles[0].policies}{"\n"}'
TOKEN=$(argocd proj role create-token default deployer -t)
argocd app get demo-staging --auth-token "$TOKEN" --server "$ARGO" --plaintext --grpc-web | head -3
argocd app sync demo-staging --auth-token "$TOKEN" --server "$ARGO" --plaintext --grpc-web --timeout 30 2>&1 | tail -1
argocd proj role add-policy default deployer --action sync --permission allow --object 'demo-staging'
TOKEN=$(argocd proj role create-token default deployer -t)
argocd app sync demo-staging --auth-token "$TOKEN" --server "$ARGO" --plaintext --grpc-web --timeout 60 2>&1 | tail -2
argocd proj role delete default deployeroutputcaptured 2026-09-13
$ ARGO_PW=$(kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath='{.data.password}' | base64 -d)
$ # the LoadBalancer IP only exists when cloud-provider-kind runs; the NodePort is always there
$ ARGO=$(kubectl get node cnpe-control-plane -o jsonpath='{.status.addresses[?(@.type=="InternalIP")].address}'):$(kubectl -n argocd get svc argocd-server -o jsonpath='{.spec.ports[?(@.port==80)].nodePort}')
$ argocd login "$ARGO" --username admin --password "$ARGO_PW" --plaintext --grpc-web
'admin:login' logged in successfully
Context '172.18.0.4:32015' updated
$ argocd proj role create default deployer
Role 'deployer' created
$ # add-policy prepends the project, so the object here is the bare app name: 'default/demo-staging' would become default/default/demo-staging and match nothing
$ argocd proj role add-policy default deployer --action get --permission allow --object 'demo-staging'
$ kubectl -n argocd get appproject default -o jsonpath='{.spec.roles[0].policies}{"\n"}'
["p, proj:default:deployer, applications, get, default/demo-staging, allow"]
$ TOKEN=$(argocd proj role create-token default deployer -t)
$ argocd app get demo-staging --auth-token "$TOKEN" --server "$ARGO" --plaintext --grpc-web | head -3
Name: argocd/demo-staging
Project: default
Server: https://kubernetes.default.svc
$ argocd app sync demo-staging --auth-token "$TOKEN" --server "$ARGO" --plaintext --grpc-web --timeout 30 2>&1 | tail -1
{"level":"fatal","msg":"rpc error: code = PermissionDenied desc = permission denied: applications, sync, default/demo-staging, sub: proj:default:deployer, iat: 2026-09-13T05:00:15Z","time":"2026-09-13T01:00:15-04:00"}
$ argocd proj role add-policy default deployer --action sync --permission allow --object 'demo-staging'
$ TOKEN=$(argocd proj role create-token default deployer -t)
$ argocd app sync demo-staging --auth-token "$TOKEN" --server "$ARGO" --plaintext --grpc-web --timeout 60 2>&1 | tail -2
Service team-a staging-demo Synced Healthy service/staging-demo unchanged
apps Deployment team-a staging-demo Synced Healthy deployment.apps/staging-demo unchanged
$ argocd proj role delete default deployer
Role 'deployer' deletedget policy, the token reads the app cleanly but sync fails with permission denied: applications, sync, default/demo-staging, sub: proj:default:deployer. Add the sync policy and the same command succeeds. Notice how the denial hands you the action, the object, and the subject: three of the four pieces you need to write the fix.Self-check
An app is Synced/Degraded. What are you allowed to conclude, and what is the fix?
Live matches git, so Argo CD did its job; the desired state itself is broken (bad image, impossible resource request, missing config key). Fix it with a git commit. Re-syncing won't change anything because there's no diff left to apply.
A sync fails with "field is immutable". Two ways forward?
Add Replace=true (app-wide or per resource) so Argo uses kubectl replace instead of apply, or delete the live resource and let Argo recreate it (Force=true automates delete-and-recreate). Pick carefully, though: replace isn't magic. A Service manifest omitting clusterIP will still be rejected as immutable, and neither flag can shrink a PVC.
What is an AppProject for, in one sentence, and name two things it constrains?
It's the policy guardrail around a group of Applications, constraining permitted source repos and destination cluster/namespace pairs, plus allowed/denied resource kinds, per-project RBAC roles, and sync windows. It's how you give a team self-serve deployments without letting them deploy anything anywhere.
You are handed an ApplicationSet with a git directory generator over apps/*/overlays/*. How many Applications will exist?
One per matching directory in the repo at the current revision. Count the directories, then inspect the template's name expression for collisions (two identical names silently overwrite each other). Reading a generator block and predicting the exact output is the exam skill; kubectl -n argocd get applications confirms it.
An app shows OutOfSync forever on a field no human edits. What is happening and what fixes it?
Something inside the cluster is mutating the object after apply: a mutating webhook, an HPA updating replicas, or a defaulting controller. Fix it with ignoreDifferences for that path (plus RespectIgnoreDifferences=true if needed), or stop managing that field in git. That's a configuration choice, not a controller bug.
You changed the repo but Argo insists nothing changed. Sequence of moves?
Start with argocd app get --refresh (recompare), then --hard-refresh (drop the manifest cache). Next, verify the app's targetRevision actually points at the branch you pushed to, and finally check repo-server logs for auth or render errors. Always try the cheapest check first.
A sync ends with operation phase Error rather than Failed. What is the difference and where do you look?
Failed means the apply reached the API server and was rejected (immutable field, admission denial), with the exact rejection in syncResult.resources[]. Error means Argo CD itself couldn't complete the operation (render failure, unreachable repo, hook creation failure). For Error, check repo-server and application-controller logs; for Failed, read the per-resource message.
You must stop managing an Application but keep its workloads running. Exact move?
Run argocd app delete X --cascade=false, or with kubectl patch metadata.finalizers to strip resources-finalizer.argocd.argoproj.io before deleting the Application. Leaving the finalizer in place triggers a foreground cascade delete that wipes every managed resource. For protecting a single resource rather than the whole app, annotate it with Delete=false.
An ApplicationSet with a matrix of a git directories generator and a clusters generator: how many Applications, and what breaks if you nest another matrix inside?
directories × clusters: one Application per pair, named by your template (watch out for collisions, which silently merge). A matrix takes exactly two child generators and combination generators only nest one level deep, so nesting a matrix inside a matrix inside a matrix gets rejected at generation time rather than by the API server's schema validation.
A user can see Applications and sync them but the Logs tab is empty. Which policy line is missing since 3.0?
p, role:<their-role>, logs, get, <project>/*, allow. Starting in Argo CD 3.0, logs RBAC is enforced by default and is no longer implied by applications, get. That same 3.0 release split child-resource permissions into update/* and delete/*.
Docs to know your way around
- argo-cd.readthedocs.io: Application spec reference, sync options, sync waves and hooks, AppProject, ApplicationSet generators.
- Offline:
argocd app --helpcovers most of what the docs would, andkubectl explain application.spec --recursiveworks because the Application is just a CRD. - argo-cd.readthedocs.io: Upgrading v2.14 to 3.0 (and 3.x to 3.y): annotation tracking, fine-grained RBAC, logs RBAC, default resource exclusions, ignored status; the per-minor pages list every behavioral change since.
- argo-cd.readthedocs.io: RBAC Configuration and Projects: the policy.csv grammar, resource and action lists, project roles and JWT tokens, sync windows.
- argo-cd.readthedocs.io: ApplicationSet Generators (per generator) and Controlling Resource Modification: parameters each generator emits, matrix/merge restrictions, applicationsSync policies, preserveResourcesOnDeletion.