What are the hook phases and when does each run?
Short answer
PreSync runs before the main sync (e.g., DB migration). Sync runs alongside the normal resources. PostSync runs after all resources are applied and Healthy (e.g., smoke tests, notifications). SyncFail runs if the sync fails (cleanup/alert). Skip means don't apply the resource.
Advertisement
AModel answer
PreSync runs before the main sync (e.g., DB migration). Sync runs alongside the normal resources. PostSync runs after all resources are applied and Healthy (e.g., smoke tests, notifications). SyncFail runs if the sync fails (cleanup/alert). Skip means don't apply the resource. Phases let you inject logic around the deployment.
metadata:
annotations:
argocd.argoproj.io/hook: PostSync # smoke tests after deployReal-world example
A PostSync hook runs integration smoke tests only after the app is deployed and healthy; a SyncFail hook alerts on failure.
Likely follow-ups
- When does PostSync run relative to health? | What is the SyncFail phase for?
Related topics