GitOps & ArgoCD (50 Qs)•Part 1: GitOps Fundamentals & Core Principles (Junior / Entry-Level)
How do Sync Phases and Sync Waves work in ArgoCD?
junior LevelCode ExamplegitopsGitOps Fundamentals
In Simple Words: By default, Kubernetes creates resources in arbitrary order. In complex architectures, database schemas must migrate before backend pods boot up, and CRDs must be created before custom resources.
- Sync Waves (
argocd.argoproj.io/sync-wave: "1"): Orders resource creation. ArgoCD synchronizes wave 0, waits for all resources to becomeHealthy, and only then initiates wave 1. Waves can be negative (-1) or positive (5).
yaml
apiVersion: batch/v1
kind: Job
metadata:
name: db-migration
annotations:
argocd.argoproj.io/sync-wave: "-1" # Runs BEFORE app deployment