Skip to content

Commit

Permalink
docs: Add documentation on background cascading deletion (argoproj#12229
Browse files Browse the repository at this point in the history
) (argoproj#14150)

Signed-off-by: toyamagu2021@gmail.com <toyamagu2021@gmail.com>
Co-authored-by: toyamagu <83329336+toyamagu-2021@users.noreply.github.com>
  • Loading branch information
gcp-cherry-pick-bot[bot] and toyamagu-2021 committed Jun 21, 2023
1 parent 697fd7c commit 86c831a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/operator-manual/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ metadata:
namespace: argocd
# Add this finalizer ONLY if you want these to cascade delete.
finalizers:
# The default behaviour is foreground cascading deletion
- resources-finalizer.argocd.argoproj.io
# Alternatively, you can use background cascading deletion
# - resources-finalizer.argocd.argoproj.io/background
# Add labels to your application object.
labels:
name: guestbook
Expand Down
7 changes: 7 additions & 0 deletions docs/user-guide/app_deletion.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,18 @@ kubectl delete app APPNAME
```yaml
metadata:
finalizers:
# The default behaviour is foreground cascading deletion
- resources-finalizer.argocd.argoproj.io
# Alternatively, you can use background cascading deletion
# - resources-finalizer.argocd.argoproj.io/background
```

When deleting an Application with this finalizer, the Argo CD application controller will perform a cascading delete of the Application's resources.

Adding the finalizer enables cascading deletes when implementing [the App of Apps pattern](../operator-manual/cluster-bootstrapping.md#cascading-deletion).

The default propagation policy for cascading deletion is [foreground cascading deletion](https://kubernetes.io/docs/concepts/architecture/garbage-collection/#foreground-deletion).
ArgoCD performs [background cascading deletion](https://kubernetes.io/docs/concepts/architecture/garbage-collection/#background-deletion) when `resources-finalizer.argocd.argoproj.io/background` is set.

When you invoke `argocd app delete` with `--cascade`, the finalizer is added automatically.
You can set the propagation policy with `--propagation-policy <foreground|background>`.

0 comments on commit 86c831a

Please sign in to comment.