Advertisement
Intermediate ArgoCD, Sync Waves & Hooks

What is a PreSync hook typically used for?

Short answer

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.

Save ArgoCD mock interview
Advertisement
AModel answer
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?
Related topics