ArgoCD › Sync Waves & Hooks

What is a PreSync hook typically used for?

Intermediate

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.

Common follow-ups: What happens if PreSync fails? | Why run migrations in PreSync?