Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

🏠 Back to Blog

Argo CD sync hooks and waves lab

Configure an Argo CD Application to use this directory as its source and target a namespace that already exists. Sync the Application and inspect its resource tree and Job logs.

The expected order is:

  1. sync-lab-precheck runs in the PreSync phase at wave -1, before any ordinary Sync-phase resources.
  2. The ConfigMap is applied at Sync wave -2. It is still applied after PreSync because hook phase takes precedence over wave number.
  3. sync-lab-sync-check runs as a Sync hook at wave -1.
  4. The Deployment is applied at wave 0; the Service follows at wave 1.
  5. Once Sync resources are healthy, sync-lab-postcheck runs in the PostSync phase and checks that the web endpoint serves the ConfigMap page.

Hooks with BeforeHookCreation,HookSucceeded are removed after success and cleaned up before a later sync recreates them. Remove the hook-delete-policy annotation to inspect completed Jobs between syncs.