Skip to main content
Sync options allow you to customize how Argo CD syncs the desired state to the target cluster. They can be configured at the application level in 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:
Confirm pruning by:
  • 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:
Also works at the resource level:

Prune Propagation Policy

Control how pruned resources are deleted:
enum
  • foreground (default): Delete dependents before the owner
  • background: Delete owner immediately, dependents asynchronously
  • orphan: Leave dependents, only delete the owner
See Kubernetes Garbage Collection for details.

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 using RawExtension (e.g., ServiceCatalog):
Application-level:

Skip Dry Run on Missing Resources

Skip dry run when CRD doesn’t exist yet (e.g., Gatekeeper):
Application-level:

Apply Strategy Options

Replace Resource

Use kubectl replace instead of kubectl apply:
Resource-level:
Replace is destructive and may recreate resources, causing application downtime.

Force Sync

Delete and recreate resources during sync (useful for Jobs):
Force sync deletes resources before recreating them, which will cause downtime.

Server-Side Apply

Use Kubernetes server-side apply:
Resource-level:
Benefits:
  • No annotation size limit (avoids 262KB last-applied-configuration limit)
  • Better for patching resources not fully managed by Argo CD
  • More declarative field management
Usage with partial manifests:
With sync options:
Replace=true takes precedence over ServerSideApply=true.

Client-Side Apply Migration

Migrate from client-side to server-side apply:
Custom field manager:

Selective Sync

Sync only out-of-sync resources (improves performance for large applications):
Or via CLI:

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.
Making Argo CD own the namespace:
Manually adding tracking annotations to namespaces should only be done for owned namespaces. Incorrect ownership can lead to unintended deletion of shared namespaces.

Advanced Options

Fail on Shared Resource

Fail sync if a resource is already managed by another application:

Respect Ignore Differences

Apply ignoreDifferences 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