Helm uninstall: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 18: Line 18:


==--keep-history==
==--keep-history==
Remove all associated resources and mark the release as deleted, but retain the release history.
Remove all associated resources and mark the release as deleted, but retain the release history.


=Keep a Resource from Being Uninstalled=
=Keep a Resource from Being Uninstalled=
{{External|https://helm.sh/docs/howto/charts_tips_and_tricks/#tell-helm-not-to-uninstall-a-resource}}
{{Internal|Helm_Concepts#Preventing_Resource_Deletion_upon_Uninstallation|Preventing Resource Deletion upon Uninstallation}}
 
Helm uninstalls by defaults all resources created by the chart for the release being uninstalled. There are cases when we may want to keep resources around: one case is when we want to keep a PersistentVolumeClaim because deleting it would make the a PersistentVolume outside of our control unavailable for binding for the subsequent release.
 
To indicate to Helm that a resource should be kept on uninstall, use the "helm.sh/resource-policy" annotation in template:
 
<syntaxhighlight lang='yaml'>
kind: Something
  annotations:
    "helm.sh/resource-policy": keep
</syntaxhighlight>
 
The "helm.sh/resource-policy" instructs helm to skip deleting the resource on uninstall, upgrade or rollback operation.
 
Note that this resource becomes orphaned, it will be no longer be managed by Helm. This can lead to problems if using helm install --replace on a release that has already been uninstalled, but has kept resources.

Latest revision as of 03:38, 6 November 2020

External

Internal

Overview


Revised for Helm 3


helm uninstall was introduced in Helm 3, and it is the replacement of helm delete, which still works as an alias.

helm uninstall <release-name>

The command removes by default the release history. To keep the release history, use --keep-history.

Options

--keep-history

Remove all associated resources and mark the release as deleted, but retain the release history.

Keep a Resource from Being Uninstalled

Preventing Resource Deletion upon Uninstallation