In Argo CD, what does an Application resource declare, and what do its spec.source fields (repoURL, path, targetRevision) and spec.destination fields each specify?
answer
- one CRD, two coordinates
- what to deploy, where to deploy
- repo, folder, revision
- cluster URL or name, plus namespace
- project fences which of each are legal
basics
~20 sAn Argo CD Application is a Kubernetes custom resource that pairs one desired-state source with one cluster destination. spec.source gives the Git repoURL, the path inside it, and the targetRevision to read; spec.destination gives the cluster and namespace to deploy into.
solid answer
~40 s`Application` is Argo CD's own CRD (`argoproj.io/v1alpha1`), normally created in the `argocd` namespace. It answers three questions: what to deploy, where to deploy it, and under whose policy. `spec.source` holds `repoURL` (the Git or Helm repository), `path` (the directory of manifests, Kustomize overlay or Helm chart inside that repo), and `targetRevision` (branch, tag, commit SHA, or `HEAD` — for a Helm repo, a chart version). `spec.destination` holds either `server` (the cluster API URL, `https://kubernetes.default.svc` for the local cluster) or `name` (a registered cluster's name), plus `namespace` for namespaced resources. `spec.project` names the `AppProject` that constrains which sources and destinations are even allowed. Argo CD renders the manifests from the source, compares them with what is live in the destination, and reports the app `Synced` or `OutOfSync`.
go deeper
Be able to name the three source fields and the two destination fields from memory, and say plainly that an Application is a Kubernetes custom resource, not a config file Argo CD reads from disk.
Explain how Argo CD picks the rendering tool from the path's contents, what targetRevision accepts, and that sync status is computed from a diff rather than from a deploy job's exit code.
Discuss how you lay Applications out for a real estate of services and clusters, where repository credentials live, and how spec.project keeps an Application from pointing itself somewhere it should not.
Own the question of granularity: how much belongs in one Application versus many, what that does to blast radius, ownership boundaries and the number of objects your control plane must reconcile.
## What the object is Argo CD does not read a config file; it reads Kubernetes objects. The central one is `Application`, a custom resource in the `argoproj.io/v1alpha1` API group, usually created in the namespace Argo CD itself runs in (`argocd` by default). One `Application` is one unit of delivery: one bundle of manifests, going to one place, with one sync status. ```yaml apiVersion: argoproj.io/v1alpha1 kind: Application metadata: name: checkout namespace: argocd spec: project: payments source: repoURL: https://github.com/acme/manifests.git path: apps/checkout/overlays/prod targetRevision: main destination: server: https://kubernetes.default.svc namespace: checkout ``` ## spec.source — what to deploy `repoURL` is the repository Argo CD clones (HTTPS or SSH Git, or a Helm chart repository / OCI registry). Credentials for it are configured separately as repository secrets, not inline in the Application. `path` is the directory inside that repository whose contents Argo CD renders. Argo CD detects the tool automatically: plain YAML directory, a Kustomize overlay if `kustomization.yaml` is present, a Helm chart if `Chart.yaml` is present, or a config-management plugin. Tool-specific settings live under `source.helm` (for example `valueFiles`, `parameters`) or `source.kustomize`. For a Helm *repository* rather than a Git repo you set `chart:` instead of `path:`. `targetRevision` is the revision of that repository to read: a branch name, a tag, a full commit SHA, or `HEAD` meaning the repository's default branch. For a Helm chart repository it is a chart version and may be a semver range. Which of those you choose changes the guarantee you get — a branch moves under you, a SHA does not. Newer Argo CD versions also accept `spec.sources` (plural) so one Application can combine, for example, an upstream chart with a values file from your own repo. ## spec.destination — where to deploy The destination is a *cluster plus namespace*. Give it either `server`, the cluster's API server URL — `https://kubernetes.default.svc` is the cluster Argo CD itself runs in — or `name`, the friendly name of a cluster registered with `argocd cluster add`. Setting both is rejected. `namespace` is the default namespace for any manifest that does not carry its own `metadata.namespace`; cluster-scoped resources ignore it. If the namespace does not exist, the sync fails unless you enable the `CreateNamespace=true` sync option. This is the field that makes multi-cluster delivery possible without a second Argo CD: one control plane holds credentials for many clusters, and each Application points at one of them. ## spec.project — the policy fence Every Application belongs to an `AppProject`; `default` if you say nothing. The project restricts which `repoURL`s, which destinations, and which resource kinds that Application may use, so a compromised or careless Application manifest cannot point itself at production. ## What Argo CD does with it The application controller periodically refreshes the source (roughly every three minutes by default, and immediately on a repository webhook), renders the manifests, and diffs them against live cluster state. The result is the **sync status**: `Synced` when live matches the rendered desired state, `OutOfSync` when it does not. Whether Argo CD then *acts* on that difference is a separate decision made by `spec.syncPolicy`; with no sync policy, an out-of-sync Application simply sits there until someone runs `argocd app sync` or clicks Sync in the UI. ## Why interviewers start here Because the whole model follows from it: the source of truth is a repository coordinate, the target is a cluster coordinate, and nothing in between is imperative. There is no "deploy step" that pushes; there is an object saying what should be true, and a controller that keeps checking. Candidates who cannot name the three source fields usually also cannot explain why a rollback in this model is a Git revert rather than a pipeline re-run.
- Where do the credentials for a private repoURL live, since the Application manifest contains none?In Argo CD's own namespace, as repository credential secrets labelled `argocd.argoproj.io/secret-type: repository` (or `repo-creds` for a URL prefix), managed through `argocd repo add` or the UI. The Application references only the URL, so the manifest stays safe to commit; Argo CD matches the URL to a stored credential when it clones.
- What happens if spec.destination.namespace names a namespace that does not exist?The sync fails, because Argo CD applies manifests into a namespace it has not been told to create. Adding `CreateNamespace=true` to `spec.syncPolicy.syncOptions` makes Argo CD create the namespace as part of the sync. Many teams instead manage the namespace as a manifest in Git, which also lets them set labels and quotas on it.
- Can one Application deploy to two clusters?No. `spec.destination` is a single cluster and namespace, so one Application is one target. To deploy the same manifests to several clusters you create one Application per cluster, which is exactly the repetition ApplicationSet generators exist to remove.
saying these in an interview costs you the question
- Thinking the Application manifest itself stores repository credentials
- Saying targetRevision must be a branch
- Setting both destination.server and destination.name
- Assuming Argo CD creates the destination namespace by default
- Believing one Application can target several clusters