SchwarzIT / node-red-chart

Node-red Helm Chart
Apache License 2.0
36 stars 24 forks source link

persistence: Keep pvc when uninstalling helm chart #227

Closed hinrichd closed 1 year ago

hinrichd commented 1 year ago

Is your feature request related to a problem? Please describe.

Thank you for maintaining the nodered chart.

I want to reuse an existing pvc in case I have to reinstall the chart and do not want to lose my existing flows and data. Actually a "helm uninstall nodered" will delete the pvc resource and can not be reused by the existing claim key/value.

Helm Values Sample
#STORAGE
persistence:
  # -- Use persistent volume to store data
  enabled: true
  ## node-red data Persistent Volume Storage Class
  ## If defined, storageClassName: <storageClass>
  ## If set to "-", storageClassName: "", which disables dynamic provisioning
  ## If undefined (the default) or set to null, no storageClassName spec is
  ##   set, choosing the default provik sioner.  (gp2 on AWS, standard on
  ##   GKE, AWS & OpenStack)
  ##
  # -- Type of persistent volume claim
  storageClass: "sp-test"
  ##
  ## If you want to reuse an existing claim, you can pass the name of the PVC using
  ## the existingClaim variable
  # -- Use an existing PVC to persist data
  existingClaim: pvc-3c33e0d7-d3d4-42ea-9dd1-9ec36b9faf45
  # -- Persistence access mode
  accessMode: ReadWriteOnce
  # -- Size of persistent volume claim
  size: 5Gi

Describe the solution you'd like

Do not delete PVC resources when performing helm uninstall when key "persistences.keep=enabled" is set.

Describe alternatives you've considered

Alternatives to this would be a general way to import flows as also install nodes from configmap. I case of an reinstall, pod crash etc. the flows and nodes would be reloaded. https://github.com/SchwarzIT/node-red-chart/issues/198

Search

Code of Conduct

Additional context

No response

hinrichd commented 1 year ago

There is an easy way to tell helm not to delete a resource when doing a helm uninstall by an annotations. "helm.sh/resource-policy": keep

hinrichd commented 1 year ago

Would be nice to see this in the helm charts: persistence.enabled=true

dirien commented 1 year ago

Hey @hinrichd,

We could add this, if you are okay that you will have resource that becomes orphaned.

hinrichd commented 1 year ago

Hey @dirien

Thank you, this would be okay and well known from other charts!

dirien commented 1 year ago

Hey @hinrichd,

the new release 0.23.1 has now the value persistence.keepPVC to keep the resource after deleting the helm release using the "helm.sh/resource-policy": keep annotation!

hinrichd commented 1 year ago

Hey @dirien,

this works very well for my current test deployment. With persistence.keepPVC: true I can reuse the existing Claim via persistence.existingClaim: node-red when have to perform an helm uninstall; helm install. Flows and Nodes installed in the Webinterface via Palette stay installed.

Thank you