49

Using helm is super cool, but what is the purpose of using helm delete --purge

I can see the doc says:remove the release from the store and make its name free for later use

So what is the purpose of saving the name and not releasing it with helm delete?

Dave Cooper
  • 10,494
  • 4
  • 30
  • 50
Chris G.
  • 23,930
  • 48
  • 177
  • 302
  • 4
    As an aside, you can purge all deleted releases with `helm delete --purge $(helm ls --deleted -q)` – spuder Jan 31 '19 at 00:17

3 Answers3

72

When you do helm delete $RELEASE_NAME it deletes all resources but keeps the record with $RELEASE_NAME in case you want to rollback. You can see removed releases via helm ls -a. Whereas helm delete --purge $RELEASE_NAME removes records and make that name free to be reused for another installation.

Jainish Shah
  • 1,217
  • 10
  • 15
  • 36
    note: helm3 removed this flag and this answer is no longer valid in helm3+ – Tommy Jan 16 '20 at 14:31
  • 1
    In Helm 3+, it looks like `helm uninstall` fully deletes and purges releases, unless you specify the `--keep-history` flag: https://helm.sh/docs/intro/using_helm/#helm-uninstall-uninstalling-a-release – Alex Pizarro May 16 '23 at 14:16
  • lol, I just realized another response already clarified this: https://stackoverflow.com/a/59210923/2585632 – Alex Pizarro May 16 '23 at 14:25
40

Just to note as of helm v3 --purge is default behaviour. You no longer need the flag

If you want to keep any history (aka the behaviour of helm 2.x's helm delete without the --purge flag) you now need to use --keep-history eg helm delete nginx-ingress --keep-history

Timothy c
  • 751
  • 7
  • 8
3

Recently they've finally managed necessity of --purge by replacing helm delete with helm uninstall. There appears it works fine now