Delete helm with Chart name but not with Release name

10/1/2018

I deployed my apps using helm. Mistakenly I put the same helm release name. Now how can I delete the specific deployment for e.g. first one with chart my-chart-1.0.0.

$ helm ls

NAME                REVISION    UPDATED                     STATUS      CHART               NAMESPACE
appname         1           Mon Oct  1 10:36:17 2018    DEPLOYED    my-chart-1.0.0      default
appname         1           Mon Sep 10 17:18:49 2018    DEPLOYED    my-chart-2.0.0      default
appname         1           Mon Sep 10 18:18:49 2018    DEPLOYED    my-chart-3.0.0      default

Any help is appreciated.

Thanks

-- surazzarus
kubernetes
kubernetes-helm

1 Answer

10/1/2018

I think this should help:

helm delete $(helm ls | awk '$9 ~ /SEARCH/ { print $1 }')

Replace SEARCH with any chart pattern, in your case my-chart-1.0.0. I would also add a --dry-run and check if this is indeed the deployment you want to remove.

You can read the Helm documentation regarding helm delete.

-- Crou
Source: StackOverflow