Manual Sync and Sync Strategies
What you'll learn: How to trigger manual syncs in ArgoCD and choose between apply and replace strategies for resource updates.
Why Manual Sync Matters
Even with automated sync policies enabled, you'll often want to trigger deployments manually—perhaps after reviewing changes, during maintenance windows, or when testing new configurations. ArgoCD gives you full control over when and how syncs happen.
Triggering a Manual Sync
You can initiate a sync through the UI (click the "Sync" button on your application), or via CLI:
argocd app sync my-application
This tells ArgoCD: "Apply the Git state to the cluster right now."
Sync Strategies: Apply vs Replace
When syncing, ArgoCD offers two strategies:
Apply Strategy (Default)
Uses kubectl apply, which performs a three-way merge between:
- Current cluster state
- Desired Git state
- Last applied configuration
Analogy: Like editing a document with track changes—only modified fields are updated, preserving manual edits to unrelated fields.
Use when: You want gentle, incremental updates that respect partial manual changes.
Replace Strategy
Uses kubectl replace, which deletes and recreates the resource entirely.
Analogy: Tearing down a house and rebuilding it from blueprints—guaranteed match to Git, but disruptive.
Use when: Resources are stuck in inconsistent states or you need guaranteed clean deployment.
argocd app sync my-application --strategy replace
Choosing Your Strategy
Most applications work fine with apply. Use replace sparingly—it can cause downtime for stateful resources and loses fields set by operators or controllers.
Key Takeaway: Manual sync gives you deployment control on-demand, while choosing between apply (gentle merge) and replace (full rebuild) strategies depends on whether you prioritize preserving existing state or enforcing exact Git match.