How to keep resources on the cluster when uninstalling a release?
Asked Answered
L

2

8

Is there's a way to NOT remove certain resources from the cluster when uninstalling releases, and to re-use them (without conflict) when re-installing?

I was thinking of resources such as secrets and persistent volumes

Lithology answered 26/5, 2020 at 22:16 Comment(0)
K
8

You can Tell Helm Not To Uninstall a Resource by adding the following annotation:

kind: Secret
metadata:
  annotations:
    "helm.sh/resource-policy": keep
Kantos answered 27/5, 2020 at 16:39 Comment(1)
For others coming across this and thinking this is a solution: This is not possible due to a bug in helm (open since 2022) github.com/helm/helm/issues/10890. Even with the annotation, the resources will be deleted when running helm uninstall.Actium
S
1

You can delete the secret associated with the release, for example:

kubectl -n argocd delete secrets -l name=<your helm release name>,owner=helm

and then the chart will no longer be seen as installed in your cluster (or that particular release you removed)

Saxton answered 12/8, 2024 at 12:2 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.