Interview CI/CD & GitOps

What are ArgoCD sync waves and sync hooks?

CI/CD & GitOps · Intermediate level

Answer

Sync waves and hooks control ordering during Argo CD sync. Hooks run resources at phases such as PreSync, Sync, PostSync, or SyncFail. Waves let resources apply in numeric order, which is useful for CRDs, namespaces, operators, migrations, and dependent workloads.

Technical explanation

Hooks are useful for one-off operations such as migrations, but they must be idempotent and have cleanup policies.

Waves order resources, but health and readiness still matter for safe dependent rollout.

GitOps separates build from deploy: CI produces immutable artifacts, while the GitOps controller reconciles declarative desired state into the cluster.

Argo CD status has two dimensions: sync status indicates desired versus live state; health status indicates whether live resources appear operationally healthy.

Use projects, RBAC, repository allowlists, destination restrictions, sync windows, and admission policies to constrain what an Application may deploy.

Prefer reviewed Git changes over direct kubectl changes; direct changes create drift and bypass audit, policy, and promotion workflow.

Hands-on example

1. Model the desired state for: What are ArgoCD sync waves and sync hooks in a GitOps repository, for example environments/staging/apps/payments and environments/prod/apps/payments.

2. Annotate dependent resources, for example argocd.argoproj.io/sync-wave: '-1' on CRDs and PreSync on a migration Job; verify the sync order in Argo CD operation details.

3. Open a pull request that changes only the desired version or values, require review and policy checks, then merge to let Argo CD detect OutOfSync state.

4. Run argocd app get payments and argocd app diff payments, then sync manually or let automated sync reconcile; verify sync status, health status, events, and Kubernetes rollout status.

5. Test rollback by reverting the Git commit or promoting the previous artifact digest, then watch Argo CD reconcile the cluster back to the known-good desired state.

Preparing for an interview?

Check how well your resume matches the role with our free resume checker— match score, ATS check, and the skills you're missing.

More CI/CD & GitOps interview questions

← All CI/CD & GitOps questions