Advertisement

Sync Waves & Hooks interview questions and answers

29 Sync Waves & Hooks interview questions for ArgoCD roles, each with a model answer, examples and likely follow-ups.

29 questions
Advertisement

29 questions

Q11 Advanced Save

How do you run post-deployment smoke tests and fail the sync if they fail?

Add a PostSync hook Job that runs the tests; if the Job fails, the sync is marked failed, signaling a bad deployment (and triggering SyncFail hooks/notifications). Combined with automated rollback strategies or alerting, this gates the deployment on test success within the GitOps flow.
kind: Job
metadata:
  annotations:
    argocd.argoproj.io/hook: PostSync
    argocd.argoproj.io/hook-delete-policy: HookSucceeded
Real-world example
A PostSync test Job failing marks the sync failed and pages on-call, flagging the release as broken.
Likely follow-ups
  • What signals a failed PostSync hook? | How do SyncFail hooks complement this?
Applications Sync & Health Sync Waves & Hooks
Q12 Intermediate Save

How are hook resources named and prevented from clashing across syncs?

Hooks are typically generated with unique names (e.g., using generateName) or cleaned up via BeforeHookCreation so a new sync doesn't collide with a leftover from a prior run. Because Jobs are immutable in key fields, reusing a fixed name without deletion causes apply errors, so deletion policies or unique names are important.
metadata:
  generateName: migrate-
  annotations:
    argocd.argoproj.io/hook: PreSync
    argocd.argoproj.io/hook-delete-policy: BeforeHookCreation
Real-world example
Each sync's migration Job gets a unique generated name, avoiding conflicts with the previous run's Job.
Likely follow-ups
  • Why do fixed-name Jobs cause conflicts? | What does BeforeHookCreation prevent?
Applications Sync & Health Sync Waves & Hooks
Q13 Beginner Save

Which resource types are commonly used as hooks?

Jobs are the most common (run to completion for migrations, tests, seeds), and Pods for simple one-off tasks. Any Kubernetes resource can technically carry hook annotations, but run-to-completion workloads (Jobs) fit hook semantics best because ArgoCD tracks their success/failure to gate the sync.
Real-world example
Migrations, backups, and smoke tests are all implemented as hook Jobs that ArgoCD monitors to completion.
Likely follow-ups
  • Why are Jobs ideal for hooks? | Can any resource be a hook?
Applications Sync & Health Sync Waves & Hooks
Q14 Advanced Save

How do you coordinate hooks across multiple Applications (e.g., App of Apps)?

Ordering across separate Applications isn't governed by a single sync's waves/hooks; you coordinate via the parent (App of Apps) sync waves on the child Application resources, or by splitting concerns so prerequisites are their own app synced first. Within one app, waves/hooks order resources; across apps, order the Application CRs themselves.
Example

# Parent app annotates child Applications with sync-wave to order them

Real-world example
The parent app syncs the 'infra' child Application (wave 0) before the 'workloads' child (wave 1) so shared CRDs exist first.
Likely follow-ups
  • Do waves span multiple Applications? | How do you order child apps?
App of Apps Applications Sync Waves & Hooks
Q15 Beginner Save

How do you annotate a resource with a sync wave?

Add the annotation argocd.argoproj.io/sync-wave with an integer string value on the resource metadata. Lower numbers apply first. Resources without the annotation default to wave 0.
metadata:
  annotations:
    argocd.argoproj.io/sync-wave: "2"
Real-world example
The frontend is annotated wave 2 so it deploys after the backend in wave 1.
Likely follow-ups
  • What is the default wave? | Do negative waves run first?
Applications Sync & Health Sync Waves & Hooks
Q16 Intermediate Save

How long does ArgoCD wait between sync waves?

After applying a wave, ArgoCD waits for those resources to become Healthy before starting the next wave, subject to timeouts. There's also a short delay (configurable) between waves. If a wave's resources never become Healthy, later waves won't proceed and the sync stalls.
Real-world example
The next wave doesn't start until the database in the current wave reports Healthy.
Likely follow-ups
  • What if a wave never becomes Healthy? | Is the inter-wave delay configurable?
Sync & Health Applications Sync Waves & Hooks
Q17 Intermediate Save

What is a PreSync hook typically used for?

PreSync hooks run before the main resources apply, ideal for preparation tasks that must succeed first: database schema migrations, provisioning, or backups. If a PreSync hook fails, the sync fails and the new version isn't rolled out.
metadata:
  annotations:
    argocd.argoproj.io/hook: PreSync
Real-world example
A backup Job runs as a PreSync hook so there's a restore point before the deployment proceeds.
Likely follow-ups
  • What happens if PreSync fails? | Why run migrations in PreSync?
Applications Sync & Health Sync Waves & Hooks
Q18 Intermediate Save

What is a PostSync hook typically used for?

PostSync hooks run after all resources are applied and Healthy—used for smoke tests, cache warming, notifications, or registering the deployment. A failing PostSync hook marks the sync failed, signaling the release didn't pass its post-checks.
metadata:
  annotations:
    argocd.argoproj.io/hook: PostSync
Real-world example
A PostSync integration-test Job verifies the new version works end-to-end after deployment.
Likely follow-ups
  • When does PostSync run relative to health? | What does a PostSync failure indicate?
Applications Sync & Health Sync Waves & Hooks
Q19 Advanced Save

What is a SyncFail hook and how is it used?

A SyncFail hook runs only when a sync operation fails, used for cleanup, rollback of partial changes, or alerting. It lets you react to failed deployments within the sync lifecycle rather than relying solely on external monitoring.
metadata:
  annotations:
    argocd.argoproj.io/hook: SyncFail
Real-world example
On a failed sync, a SyncFail hook cleans up temporary resources and posts an alert to the incident channel.
Likely follow-ups
  • When does SyncFail run? | What tasks suit SyncFail?
Applications Sync & Health Sync Waves & Hooks
Q20 Beginner Save

What are the hook deletion policy options?

The hook-delete-policy annotation accepts HookSucceeded (delete after success), HookFailed (delete after failure), and BeforeHookCreation (delete the prior hook before creating a new one). They keep completed hook resources from accumulating and manage reruns.
metadata:
  annotations:
    argocd.argoproj.io/hook-delete-policy: HookSucceeded
Real-world example
Successful migration Jobs are auto-deleted so old completed Jobs don't clutter the namespace.
Likely follow-ups
  • Why use BeforeHookCreation? | What happens with no delete policy?
Applications Sync & Health Sync Waves & Hooks

Showing 11–20 of 29