Skip to content

Argo CD: CAPA practice questions

Argo CD is a declarative GitOps delivery tool for Kubernetes: the desired state of an application lives in Git, and Argo CD keeps the cluster in line with it. Three components do the core work.

By Ibrahim Yesilay · Published · Updated

Independent community practice, not affiliated with or endorsed by CNCF or The Linux Foundation.

What Argo CD covers in CAPA

Argo CD is a declarative GitOps delivery tool for Kubernetes: the desired state of an application lives in Git, and Argo CD keeps the cluster in line with it. Three components do the core work. The API server is a gRPC and REST server used by the web UI, the CLI and CI systems; it manages applications and reports their status, triggers operations such as sync and rollback, holds repository and cluster credentials, authenticates users, enforces RBAC and receives Git webhook events. The repository server keeps a local cache of the Git repositories and, given a repository URL, a revision, a path and template settings, generates the Kubernetes manifests. The application controller continuously compares the live state of each application with the target state from the repository, detects when it is OutOfSync, optionally corrects it, and runs hooks for the sync lifecycle.

An Application resource names a project, a source and a destination. The source has a repoURL, a targetRevision and a path, or a chart for a Helm repository; the destination has either a server or a name for the cluster, not both, plus a namespace. Applications, AppProjects and the settings objects must be created in the Argo CD namespace, argocd by default. An AppProject groups applications and restricts which repositories, destination clusters and namespaces they may use. General settings are kept in the argocd-cm ConfigMap, RBAC in argocd-rbac-cm and secrets such as the signing key in argocd-secret. Repositories and clusters are registered declaratively as Secrets labelled argocd.argoproj.io/secret-type: repository or cluster. Deleting an Application only removes the resources it manages when it carries the resources-finalizer.argocd.argoproj.io finalizer.

Argo CD detects the tool for a source path itself: a Chart.yaml means Helm, a kustomization file means Kustomize, and anything else is treated as a plain directory of manifests, unless the Application sets the tool explicitly.

Automated sync is enabled with spec.syncPolicy.automated or argocd app set with --sync-policy automated. It only syncs when the application is OutOfSync, and it is conservative by default: prune is off, so resources removed from Git stay in the cluster, and selfHeal is off, so manual changes in the cluster do not trigger a sync. allowEmpty permits pruning down to no resources at all. Git is polled every 120 seconds with up to 60 seconds of jitter, and an application with automated sync cannot be rolled back.

Sync options refine how resources are applied, either for the whole application under syncPolicy.syncOptions or per resource with the argocd.argoproj.io/sync-options annotation. Examples are CreateNamespace=true, PruneLast=true, ApplyOutOfSyncOnly=true, ServerSideApply=true, Replace=true, which can be destructive, Prune=false or Prune=confirm, and FailOnSharedResource=true. When a field is changed by something other than Git, ignoreDifferences excludes it from the comparison using jsonPointers, jqPathExpressions or managedFieldsManagers, and RespectIgnoreDifferences=true extends that to the sync itself.

Ordering uses phases and waves. The argocd.argoproj.io/hook annotation places a resource in PreSync, Sync, PostSync, SyncFail or PostDelete, and argocd.argoproj.io/sync-wave orders resources from the lowest number up, with 0 as the default. For many clusters or repositories, the ApplicationSet controller, bundled since Argo CD 2.3, renders an Application per parameter set from generators such as List, Cluster, Git and Matrix.

Key points

  • The repository server renders manifests; the application controller compares live and desired state.
  • Automated sync does not prune or self-heal unless prune and selfHeal are set.
  • Without the resources finalizer, deleting an Application leaves its resources running.
  • Resources are applied by phase, then by sync wave from lowest to highest, with 0 as the default wave.

Three sample questions

14 CAPA questions on Argo CD, 14 with explanations. How practice works

Question 1

Which component in Argo CD is responsible for maintaining the Git repository cache?
  1. A.API Server
  2. B.Repository Server
  3. C.Application Controller
  4. D.Dex Server

Correct answer: B

The Repository Server component in Argo CD is responsible for maintaining the Git repository cache and generating Kubernetes manifests.

Question 2

What is the correct way to configure automated sync in an Argo CD Application?
spec:
  syncPolicy:
    automated:
      prune: true
      selfHeal: true
  1. A.The configuration is correct
  2. B.automated should be auto
  3. C.selfHeal should be autoHeal
  4. D.prune should be under spec

Correct answer: A

The YAML correctly configures automated sync with pruning and self-healing enabled.

Question 3

Which command shows the sync status of all applications?
  1. A.argocd app list
  2. B.argocd status
  3. C.argocd get applications
  4. D.argocd app status

Correct answer: A

The argocd app list command shows the sync status of all applications.

Practice this topic

Focus mode keeps every question on Argo CD until you leave it. 10 free guest answers, then a free account; no credit card.

Or open CAPA practice across all topics.

Sources

The explanation above was checked against these official documents.

Frequently asked questions

Why does Argo CD keep a resource that was deleted from Git?

Pruning is off by default, including for automated sync. Enable prune in the automated sync policy, or prune manually during a sync. A Prune=false sync option on the resource also prevents pruning.