Manual Sync
By default, applications require manual synchronization. When changes are detected in Git, you must explicitly trigger a sync operation.Automated Sync Policy
Argo CD can automatically sync applications when it detects differences between the desired manifests in Git and the live state in the cluster.Enabling Auto-Sync
Auto-Sync with Enabled Flag
You can explicitly control automated sync using theenabled field:
Setting
spec.syncPolicy.automated.enabled to null is treated as enabled. When set to false, the controller will skip automated sync even if prune, selfHeal, and allowEmpty are configured.Automatic Pruning
By default, automated sync will not delete resources when they are removed from Git. Enable automatic pruning to delete resources:Allow Empty Resources
Prevents errors when there are no target resources:Automatic Self-Healing
When enabled, Argo CD will automatically revert manual changes made to the live cluster:By default, changes made to the live cluster will not trigger automated sync. Self-heal ensures your cluster state always matches Git.
Disabling self-heal does not guarantee that live cluster changes will persist in multi-source applications. Changes in one source can trigger autosync even if another remains unchanged.
Sync Options
Fine-tune sync behavior with sync options:Managed Namespace Metadata
When usingCreateNamespace=true, you can set metadata on the namespace:
Sync Waves
Sync waves allow you to control the order in which resources are applied using theargocd.argoproj.io/sync-wave annotation.
How Waves Work
Wave Examples
Wave -1: Database Migration
Wave 0: ConfigMaps and Secrets (default)
Wave 1: Deployments
Wave 2: Services
Waves are assigned to wave 0 by default. Waves can be negative, allowing you to create resources that run before everything else.
Sync Phases (Hooks)
Hooks allow you to run resources at specific points in the sync lifecycle:| Hook Type | Description |
|---|---|
PreSync | Executes before the application of manifests |
Sync | Executes at the same time as manifest application |
PostSync | Executes after all resources are healthy |
SyncFail | Executes when the sync operation fails |
Skip | Skips the resource during sync |
PreDelete | Executes before Application deletion |
PostDelete | Executes after Application resources are deleted |
Hook Example
Hook Deletion Policies
| Policy | Description |
|---|---|
HookSucceeded | Delete after successful execution |
HookFailed | Delete after failed execution |
BeforeHookCreation | Delete existing hook before creating new one |
Combining Waves and Hooks
You can combine sync waves with hooks for fine-grained control:- Phase (PreSync, Sync, PostSync)
- Wave (lowest to highest)
- Kind (namespaces first, then other resources)
- Name (alphabetically)
Retry Policy
Configure automatic retry on sync failure:Refresh on Retry
Automatically refresh application on new revisions during retries:Automated Sync Semantics
When does automated sync trigger?
When does automated sync trigger?
- Only when the application is
OutOfSync - Applications in
Syncedor error states will not auto-sync - One sync per unique combination of commit SHA and parameters
- Will not retry if a previous sync failed for the same commit
Self-heal behavior
Self-heal behavior
- When
selfHeal: true, sync will retry after self-heal timeout (default: 5 seconds) - Timeout is controlled by
--self-heal-timeout-secondsflag
Sync frequency
Sync frequency
- Determined by
timeout.reconciliationinargocd-cmConfigMap - Default: 120 seconds with 60 seconds jitter (max 3 minutes)
Limitations
Limitations
- Rollback cannot be performed on applications with automated sync enabled