How do you handle CRDs and their custom resources syncing in the right order?
Short answer
CRDs must exist before their custom resources apply. Use sync waves to install CRDs first (lower wave), or the SkipDryRunOnMissingResource sync option so ArgoCD doesn't fail validation when the CRD isn't yet present.
Advertisement
AModel answer
CRDs must exist before their custom resources apply. Use sync waves to install CRDs first (lower wave), or the SkipDryRunOnMissingResource sync option so ArgoCD doesn't fail validation when the CRD isn't yet present. For operators, install the operator/CRDs in an earlier wave or a separate app before workloads that use them.
metadata:
annotations:
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
argocd.argoproj.io/sync-wave: "-1" # CRDs firstReal-world example
CRDs are placed in wave -1 so custom resources in wave 0 don't fail with 'no matches for kind' during sync.
Likely follow-ups
- Why can a CR fail to apply before its CRD? | What does SkipDryRunOnMissingResource do?
Related topics