Helm uninstall: Difference between revisions
No edit summary |
|||
Line 35: | Line 35: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
The "helm.sh/resource-policy" instructs helm to skip deleting the resource on uninstall, upgrade or rollback operation. | The "helm.sh/resource-policy" instructs helm to skip deleting the resource on uninstall, [[Helm upgrade|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. | 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. |
Revision as of 20:57, 4 September 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
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:
kind: Something
annotations:
"helm.sh/resource-policy": keep
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.