sincecutoff.com
← all changes

Argo CD supports PreDelete hooks

Introduced 2026-02-02 · score 0.96

HOW TO USE IT

When an Argo CD Application is deleted, define a `PreDelete` hook to run cleanup before its resources are deleted. It does not run during normal sync, including pruning.

apiVersion: batch/v1 kind: Job metadata: name: <cleanup-job> annotations: argocd.argoproj.io/hook: PreDelete spec: template: spec: containers: - name: cleanup image: <image> command: ["<cleanup-command>"] restartPolicy: Never
# Helm chart template annotation: helm.sh/hook: pre-delete

WHY THIS HELPS

Run a cleanup hook before deleting an Application's resources.

REQUIREMENTS AND LIMITATIONS

  • Version: v3.3.0
  • argocd.argoproj.io/hook (required): Set to `PreDelete` to run the resource before Application resources are deleted.
  • helm.sh/hook: Set to `pre-delete` in a Helm chart; documented as equivalent to the Argo CD `PreDelete` hook annotation.
  • metadata.annotations (required): Place the hook annotation on the resource manifest.
  • Prerequisite: Use an Argo CD version that supports PreDelete hooks; this change is documented in v3.3.0.
  • Prerequisite: The hook must be defined in the Application's manifests. Argo CD waits for PreDelete hooks to reach Healthy before continuing deletion.
  • PreDelete runs only when the entire Application is deleted, not during normal sync operations, including pruning.

FIRST-PARTY EVIDENCE

Check the installed version and the source before using it. Entry JSON

Report a problem with this card