Sync Waves, Hooks & Drift Detection in Argo CD
Order syncs with waves/hooks and detect configuration drift automatically.
In plain words
Sync waves are numbered boarding groups, and hooks are timed gate checks that run before, during, or after passengers enter. The simple Kubernetes rule is: Argo CD sorts resources by sync-wave, runs PreSync, Sync, or PostSync hooks, and reports OutOfSync drift before optional automated sync and prune restore the Git state.
Think of it like…
Sync waves are numbered boarding groups, and hooks are timed gate checks that run before, during, or after passengers enter.
Where you’ve seen it
A platform team reviews a promoted source revision and runs argocd app wait checkout --health; argocd app sync checkout --prune --async. Expected evidence: Argo CD sorts resources by sync-wave, runs PreSync, Sync, or PostSync hooks, and reports OutOfSync drift before optional automated sync and prune restore the Git state. If the run instead shows this symptom, stop and restore the last known state: Wave ordering is lexical within a phase and does not guarantee an application's runtime readiness; pruning or a PostSync hook can fail after workloads have changed.
Words you’ll hear
- Sync Waves
- For this lesson, Sync Waves is the controlling idea: Argo CD sorts resources by sync-wave, runs PreSync, Sync, or PostSync hooks, and reports OutOfSync drift before optional automated sync and prune restore the Git state.
- Hooks
- Hooks is the checkpoint; run
argocd app wait checkout --health; argocd app sync checkout --prune --asyncand inspect the owner chain. Wave ordering is lexical within a phase and does not guarantee an application's runtime readiness; pruning or a PostSync hook can fail after workloads have changed. - Drift
- Drift is the outcome to preserve; the cost is explicit: Waves and hooks model dependencies, but a database migration or external system still needs its own atomicity and rollback rather than more sync annotations.
- Verification evidence
- The evidence command is
argocd app wait checkout --health; argocd app sync checkout --prune --async. It connects the declaration to this behavior: Order syncs with waves/hooks and detect configuration drift automatically.
Visual diagram
Theory & deep dive
How Sync Waves reaches the intended state
Order syncs with waves/hooks and detect configuration drift automatically. Argo CD sorts resources by sync-wave, runs PreSync, Sync, or PostSync hooks, and reports OutOfSync drift before optional automated sync and prune restore the Git state.
The concrete checkpoint is argocd app wait checkout --health; argocd app sync checkout --prune --async; compare the Sync Waves owner, Hooks state, and Drift outcome instead of treating YAML acceptance as proof.
Run argocd app wait checkout --health; argocd app sync checkout --prune --async after the change and correlate the result with Events and the owning object. Argo CD sorts resources by sync-wave, runs PreSync, Sync, or PostSync hooks, and reports OutOfSync drift before optional automated sync and prune restore the Git state.
Hooks: failure boundary and production cost
Wave ordering is lexical within a phase and does not guarantee an application's runtime readiness; pruning or a PostSync hook can fail after workloads have changed. The prerequisite contract is concrete: Argo CD sorts resources by sync-wave, runs PreSync, Sync, or PostSync hooks, and reports OutOfSync drift before optional automated sync and prune restore the Git state.
Waves and hooks model dependencies, but a database migration or external system still needs its own atomicity and rollback rather than more sync annotations. A safe design limits blast radius, records the last good configuration, and uses argocd app wait checkout --health; argocd app sync checkout --prune --async as a deterministic rollback checkpoint.
Capture the current state with argocd app wait checkout --health; argocd app sync checkout --prune --async, then correct the controlling manifest rather than patching a child object; the relevant divergence signal is specific: Wave ordering is lexical within a phase and does not guarantee an application's runtime readiness; pruning or a PostSync hook can fail after workloads have changed.
How it works, step by step
Step 1 of 41. Choose the source of truth
Version the source and describe the review, render, and reconciliation boundary: Argo CD sorts resources by sync-wave, runs PreSync, Sync, or PostSync hooks, and reports OutOfSync drift before optional automated sync and prune restore the Git state.
- Goal
- Order syncs with waves/hooks and detect configuration drift automatically.
- Owner
- Sync Waves
When to use it & trade-offs
What it is
Order syncs with waves/hooks and detect configuration drift automatically. Argo CD sorts resources by sync-wave, runs PreSync, Sync, or PostSync hooks, and reports OutOfSync drift before optional automated sync and prune restore the Git state.
Why it matters: Wave ordering is lexical within a phase and does not guarantee an application's runtime readiness; pruning or a PostSync hook can fail after workloads have changed. The invariant at risk is specific: Argo CD sorts resources by sync-wave, runs PreSync, Sync, or PostSync hooks, and reports OutOfSync drift before optional automated sync and prune restore the Git state. The quickest fact check before changing the design is argocd app wait checkout --health; argocd app sync checkout --prune --async.
When to reach for it
- Use Sync Waves to enforce this invariant: Argo CD sorts resources by sync-wave, runs PreSync, Sync, or PostSync hooks, and reports OutOfSync drift before optional automated sync and prune restore the Git state.
- Use Hooks evidence from
argocd app wait checkout --health; argocd app sync checkout --prune --asyncin reviews and incident timelines. Order syncs with waves/hooks and detect configuration drift automatically. - Choose the platform operator workflow route only when this cost is justified by governance or scale: Waves and hooks model dependencies, but a database migration or external system still needs its own atomicity and rollback rather than more sync annotations.
When to avoid or be careful
- Avoid assuming Sync Waves is complete after YAML submission; the required behavior is concrete: Argo CD sorts resources by sync-wave, runs PreSync, Sync, or PostSync hooks, and reports OutOfSync drift before optional automated sync and prune restore the Git state.
- Avoid treating the next symptom as random; check the owner and state with
argocd app wait checkout --health; argocd app sync checkout --prune --asyncfirst: Wave ordering is lexical within a phase and does not guarantee an application's runtime readiness; pruning or a PostSync hook can fail after workloads have changed. - Avoid adopting a heavier platform wrapper before measuring its cost: Waves and hooks model dependencies, but a database migration or external system still needs its own atomicity and rollback rather than more sync annotations.
Native, manual, and managed paths for Sync Waves
argocd app wait checkout --health; argocd app sync checkout --prune --async.Strengths: Argo CD sorts resources by sync-wave, runs PreSync, Sync, or PostSync hooks, and reports OutOfSync drift before optional automated sync and prune restore the Git state.
Watch out: Waves and hooks model dependencies, but a database migration or external system still needs its own atomicity and rollback rather than more sync annotations. Recovery must also recognize this signal: Wave ordering is lexical within a phase and does not guarantee an application's runtime readiness; pruning or a PostSync hook can fail after workloads have changed.
argocd app wait checkout --health; argocd app sync checkout --prune --async; the expected invariant is: Argo CD sorts resources by sync-wave, runs PreSync, Sync, or PostSync hooks, and reports OutOfSync drift before optional automated sync and prune restore the Git state.Strengths: argocd app wait checkout --health; argocd app sync checkout --prune --async gives immediate feedback without first building a platform layer.
Watch out: A manual change can hide drift, and unlike Sync Waves, it does not make this symptom self-documenting: Wave ordering is lexical within a phase and does not guarantee an application's runtime readiness; pruning or a PostSync hook can fail after workloads have changed.
argocd app wait checkout --health; argocd app sync checkout --prune --async.Strengths: Platform controls can wrap this exact behavior in policy or dashboards: Argo CD sorts resources by sync-wave, runs PreSync, Sync, or PostSync hooks, and reports OutOfSync drift before optional automated sync and prune restore the Git state.
Watch out: The added platform ownership buys value at this cost: Waves and hooks model dependencies, but a database migration or external system still needs its own atomicity and rollback rather than more sync annotations.
Interview signals & numbers to know
When this topic comes up
- Interview anchor: Argo CD sorts resources by sync-wave, runs PreSync, Sync, or PostSync hooks, and reports OutOfSync drift before optional automated sync and prune restore the Git state.
- Trace Sync Waves to Drift through Hooks; the invariant is: Argo CD sorts resources by sync-wave, runs PreSync, Sync, or PostSync hooks, and reports OutOfSync drift before optional automated sync and prune restore the Git state.
- Recognize the symptom: Wave ordering is lexical within a phase and does not guarantee an application's runtime readiness; pruning or a PostSync hook can fail after workloads have changed.
- Justify the cost: Waves and hooks model dependencies, but a database migration or external system still needs its own atomicity and rollback rather than more sync annotations.
- Verify with argocd app wait checkout --health; argocd app sync checkout --prune --async instead of only inspecting YAML.
Benchmarks & rules of thumb
- 3
- hook phases: PreSync, Sync, and PostSync
- 0
- default wave values can be omitted
- 2
- states compared on every review: Git target and live cluster drift
Common mistakes & follow-ups
Common interview mistakes
- Debugging only the child object misses the Sync Waves owner contract: Argo CD sorts resources by sync-wave, runs PreSync, Sync, or PostSync hooks, and reports OutOfSync drift before optional automated sync and prune restore the Git state.
- Ignoring this telltale condition leads to unrelated changes: Wave ordering is lexical within a phase and does not guarantee an application's runtime readiness; pruning or a PostSync hook can fail after workloads have changed.
- Repeating
argocd app wait checkout --health; argocd app sync checkout --prune --asyncwithout an owner for remediation wastes retry cost. Waves and hooks model dependencies, but a database migration or external system still needs its own atomicity and rollback rather than more sync annotations.
Likely interviewer follow-ups
- How would API output and runtime evidence prove this behavior: Argo CD sorts resources by sync-wave, runs PreSync, Sync, or PostSync hooks, and reports OutOfSync drift before optional automated sync and prune restore the Git state?
- Which owner object, logs, and Events would you inspect for this symptom-Wave ordering is lexical within a phase and does not guarantee an application's runtime readiness; pruning or a PostSync hook can fail after workloads have changed-?
- At what threshold would this cost become unacceptable: Waves and hooks model dependencies, but a database migration or external system still needs its own atomicity and rollback rather than more sync annotations?
argocd app wait checkout --health; argocd app sync checkout --prune --async, name the failure, then justify the cost. Invariant: Argo CD sorts resources by sync-wave, runs PreSync, Sync, or PostSync hooks, and reports OutOfSync drift before optional automated sync and prune restore the Git state. Failure: Wave ordering is lexical within a phase and does not guarantee an application's runtime readiness; pruning or a PostSync hook can fail after workloads have changed. Cost: Waves and hooks model dependencies, but a database migration or external system still needs its own atomicity and rollback rather than more sync annotations.Knowledge check
Put it into practice
Practice related interview Q&A
Apply Sync Waves, Hooks & Drift Detection in Argo CD with generative AI interview Q&A and hands-on practice.