github.com/argoproj/argo-cd/v2@v2.10.5/docs/user-guide/app_deletion.md (about)

     1  # App Deletion
     2  
     3  Apps can be deleted with or without a cascade option. A **cascade delete**, deletes both the app and its resources, rather than only the app.
     4  
     5  ## Deletion Using `argocd`
     6  
     7  To perform a non-cascade delete:
     8  
     9  ```bash
    10  argocd app delete APPNAME --cascade=false
    11  ```
    12  
    13  To perform a cascade delete:
    14  
    15  ```bash
    16  argocd app delete APPNAME --cascade
    17  ```
    18  
    19  or
    20  
    21  ```bash
    22  argocd app delete APPNAME
    23  ```
    24  
    25  ## Deletion Using `kubectl`
    26  
    27  To perform a non-cascade delete, make sure the finalizer is unset and then delete the app:
    28  
    29  ```bash
    30  kubectl patch app APPNAME  -p '{"metadata": {"finalizers": null}}' --type merge
    31  kubectl delete app APPNAME
    32  ```
    33  
    34  To perform a cascade delete set the finalizer, e.g. using `kubectl patch`:
    35  
    36  ```bash
    37  kubectl patch app APPNAME  -p '{"metadata": {"finalizers": ["resources-finalizer.argocd.argoproj.io"]}}' --type merge
    38  kubectl delete app APPNAME
    39  ```
    40  
    41  ## About The Deletion Finalizer
    42  
    43  ```yaml
    44  metadata:
    45    finalizers:
    46      # The default behaviour is foreground cascading deletion
    47      - resources-finalizer.argocd.argoproj.io
    48      # Alternatively, you can use background cascading deletion
    49      # - resources-finalizer.argocd.argoproj.io/background
    50  ```
    51  
    52  When deleting an Application with this finalizer, the Argo CD application controller will perform a cascading delete of the Application's resources.
    53  
    54  Adding the finalizer enables cascading deletes when implementing [the App of Apps pattern](../operator-manual/cluster-bootstrapping.md#cascading-deletion).
    55  
    56  The default propagation policy for cascading deletion is [foreground cascading deletion](https://kubernetes.io/docs/concepts/architecture/garbage-collection/#foreground-deletion).
    57  Argo CD performs [background cascading deletion](https://kubernetes.io/docs/concepts/architecture/garbage-collection/#background-deletion) when `resources-finalizer.argocd.argoproj.io/background` is set.
    58  
    59  When you invoke `argocd app delete` with `--cascade`, the finalizer is added automatically.
    60  You can set the propagation policy with `--propagation-policy <foreground|background>`.