Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Clarify what the Force sync option does #20379

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions docs/user-guide/sync-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,24 @@ metadata:

## Force Sync

For certain resources you might want to delete and recreate. e.g. job resources that should run every time when syncing.
For certain resources, e.g. Jobs that should run on every sync operation, you might want to delete and recreate them.
This can be achieved by setting the `Force` sync option using an annotation on the target resources:

```yaml
metadata:
annotations:
argocd.argoproj.io/sync-options: Force=true
```

!!! warning
During the sync process, the resources will be synchronized using the 'kubectl delete/create' command.
This sync option has a destructive action, which could cause an outage for your application.
Using the `Force=true` sync option bypasses graceful deletion in the same way `kubectl apply --force` does.
This is a potentially destructive action and will immediately remove resources from the API and bypasses graceful deletion. Immediate deletion of some resources may result in inconsistency or data loss.
This may have unintended consequences for some resources ([for example Pods](https://kubernetes.io/docs/tasks/run-application/force-delete-stateful-set-pod/#force-deletion))!

## Force and Replace

And of course, `Force` can be composed together with `Replace` to achieve something similar to `kubectl replace --force`:

In such cases you might use `Force=true` sync option in target resources annotation:
```yaml
metadata:
annotations:
Expand Down