Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep images volume by default #81

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

edwargix
Copy link
Contributor

This commit sets the helm.sh/resource-policy annotation 0 of the PersistentVolumeClaim to "keep" if the persistence.keep value is true (the default).

This makes it so the persistent volume claim is not destroyed when the chart is uninstalled. This saves people from accidentally destroying their entire volume of images whenever they, for example, want to move the chart to a different namespace (which requires uninstalling and reinstalling the chart in the new namespace because the namespace field is immutable).

Several other big-name charts use a "keep" resource policy for similar reasons (see 1 and 2).

If the user still wants their PVC to be destroyed, then can either set persistence.keep to false or manually delete it after an uninstall. The helm CLI alerts the user when objects are left around after the chart is uninstalled.

This commit sets the helm.sh/resource-policy annotation [0] of the
PersistentVolumeClaim to "keep" if the persistence.keep value is true (the
default).

This makes it so the persistent volume claim is not destroyed when the chart is
uninstalled.  This saves people from accidentally destroying their entire volume
of images whenever they, for example, want to move the chart to a different
namespace (which requires uninstalling and reinstalling the chart in the new
namespace because the namespace field is immutable).

Several other big-name charts use a "keep" resource policy for similar
reasons (see [1] and [2]).

If the user still wants their PVC to be destroyed, then can either set
persistence.keep to false or manually delete it after an uninstall.  The helm
CLI alerts the user when objects are left around after the chart is uninstalled.

[0]: https://helm.sh/docs/howto/charts_tips_and_tricks/#tell-helm-not-to-uninstall-a-resource
[1]: https://github.com/traefik/traefik-helm-chart/blob/v10.24.0/traefik/templates/pvc.yaml#L10
[2]: https://github.com/argoproj/argo-helm/blob/argo-cd-5.3.6/charts/argo-cd/templates/crds/crd-application.yaml#L7
@edwargix
Copy link
Contributor Author

edwargix commented Sep 2, 2022

cc @canterberry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant