How does ArgoCD track which resources belong to an Application?
Short answer
ArgoCD labels/annotates managed resources with a tracking id (by default the label app.kubernetes.io/instance, or an annotation for the newer tracking method). This lets it know which live resources an Application owns, compute diffs, and prune orphans.
Advertisement
AModel answer
ArgoCD labels/annotates managed resources with a tracking id (by default the label app.kubernetes.io/instance, or an annotation for the newer tracking method). This lets it know which live resources an Application owns, compute diffs, and prune orphans. The tracking method is configurable to avoid clashes with other tools using the same label.
# argocd-cm
data:
application.resourceTrackingMethod: annotationReal-world example
Switching to annotation-based tracking prevents conflicts with Helm/Kustomize that also set the instance label.
Likely follow-ups
- Why switch from label to annotation tracking? | How does tracking enable pruning?
Related topics