helm / helm/helm

Helm uninstall --cascade orphan command deletes existing K8s resources

Open
#13,279 17 comments 10 reactions 0 assignees View on GitHub
question/support
Dominant language
Go
Stars
30.2k
Forks
7.8k
Avg merge
20h 58m
Merged PRs (30d)
36

Description

We have a use case where we have an existing Helm chart already released. We want to uninstall the existing Helm release but without removing any of the resources already created by the same. So we run the following Helm command:

```
helm uninstall my-release --cascade orphan -n my-namespace
```

This works fine for the resources containing an `ownerReference` field to a CustomResource. However, there are others such as ConfigMaps and ServiceAccounts which don't have such `ownerReference` and these ones are wiped out with the above command.

We would expect the command to not delete any of the existing resource already existing.
As a workaround, we need to execute the following `kubectl` command:

```
kubectl delete secret -l owner=helm,name=my-release -n my-namespace
```

Output of `helm version`:
```
version.BuildInfo{Version:"v3.14.0", GitCommit:"3fc9f4b2638e76f26739cd77c7017139be81d0ea", GitTreeState:"clean", GoVersion:"go1.21.6"}
```

Output of `kubectl version`:
```
Client Version: v1.30.0
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.30.0
```

Cloud Provider/Platform (AKS, GKE, Minikube etc.): `Minikube`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.