Walk through the key fields of an Argo CD `Application`.
BeginnerConceptThe Application CRD & Sync Policies
Answer
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: payments-prod
namespace: argocd
spec:
project: payments # AppProject that constrains it
source:
repoURL: https://github.com/org/cfg.git
targetRevision: main # branch, tag, SHA (or chart version)
path: apps/payments/overlays/prod
destination:
server: https://kubernetes.default.svc # or name: prod-eu
namespace: payments
syncPolicy:
automated: {prune: true, selfHeal: true}
source says what to render, destination says where, project says what is allowed, and syncPolicy says how changes are applied.
More on The Application CRD & Sync Policies
What values can `targetRevision` take?BeginnerWhat is the difference between `destination.server` and `destination.name`?BeginnerWhat does `syncPolicy.automated` do, and what are its sub-fields?BeginnerWhy is `prune` disabled by default?BeginnerExplain `selfHeal`. When might you not want it?IntermediateWhat is the `retry` block in a sync policy?Intermediate