spec.syncPolicy.syncOptions or at the resource level using the argocd.argoproj.io/sync-options annotation.
Application-Level Configuration
Define sync options in the Application manifest:Resource-Level Configuration
Apply sync options to individual resources using annotations:Multiple sync options in annotations should be comma-separated. Whitespace is automatically trimmed.
Pruning Options
No Prune Resources
Prevent Argo CD from deleting a resource when it’s removed from Git:When a resource has
Prune=false, the application will show as OutOfSync if Argo CD expects the resource to be pruned. Consider combining this with compare options.Prune with Confirmation
Require manual confirmation before pruning critical resources:- Using the UI “Confirm Pruning” button
- Using the CLI
- Adding the annotation:
argocd.argoproj.io/deletion-approved: <ISO timestamp>
Prune Last
Defer pruning until after all other resources are deployed and healthy:Prune Propagation Policy
Control how pruned resources are deleted:enum
foreground(default): Delete dependents before the ownerbackground: Delete owner immediately, dependents asynchronouslyorphan: Leave dependents, only delete the owner
Deletion Options
No Resource Deletion
Retain resources even when the application is deleted (useful for PVCs):Delete with Confirmation
Require confirmation before deleting critical resources:Validation Options
Disable Kubectl Validation
Skip validation for resources usingRawExtension (e.g., ServiceCatalog):
Skip Dry Run on Missing Resources
Skip dry run when CRD doesn’t exist yet (e.g., Gatekeeper):Apply Strategy Options
Replace Resource
Usekubectl replace instead of kubectl apply:
Force Sync
Delete and recreate resources during sync (useful for Jobs):Server-Side Apply
Use Kubernetes server-side apply:- No annotation size limit (avoids 262KB
last-applied-configurationlimit) - Better for patching resources not fully managed by Argo CD
- More declarative field management
Replace=true takes precedence over ServerSideApply=true.Client-Side Apply Migration
Migrate from client-side to server-side apply:Selective Sync
Sync only out-of-sync resources (improves performance for large applications):Namespace Management
Create Namespace
Automatically create the destination namespace if it doesn’t exist:Managed Namespace Metadata
Set labels and annotations on the created namespace:managedNamespaceMetadata only works when CreateNamespace=true is set.Advanced Options
Fail on Shared Resource
Fail sync if a resource is already managed by another application:Respect Ignore Differences
ApplyignoreDifferences configuration during sync (not just diff):
RespectIgnoreDifferences only works for resources that already exist in the cluster. New resources are applied as-is.Complete Example
Application with multiple sync options:Combining Options
Some sync options work well together:Next Steps
Sync Waves
Control resource ordering with sync waves
Resource Hooks
Run jobs at specific sync phases
Health Checks
Configure custom health assessments
Tracking Strategies
Choose how Argo CD tracks resources