spotahome / redis-operator

Redis Operator creates/configures/manages high availability redis with sentinel automatic failover atop Kubernetes.
Apache License 2.0
1.5k stars 356 forks source link

When upgrading with the helm chart CRDs do not get upgraded #527

Closed onedr0p closed 1 year ago

onedr0p commented 1 year ago

Expected behaviour

CRDs to be upgraded on helm upgrade

Hi πŸ‘‹πŸΌ The way crds are handled in this repo Helm does not upgrade them when the user upgrades the chart.

https://helm.sh/docs/chart_best_practices/custom_resource_definitions/#some-caveats-and-explanations

There is no support at this time for upgrading or deleting CRDs using Helm. This was an explicit decision after much community discussion due to the danger for unintentional data loss. Furthermore, there is currently no community consensus around how to handle CRDs and their lifecycle. As this evolves, Helm will add support for those use cases.

What I've seen most chart developers do it have a installCRDs option in the helm values and template them out, take a look at cert-manager and rook-ceph charts for an example on how they handle CRDs.

I would suggest a option in the values.yaml and to move the crds folder into the templates folder and wrap it in an if statement.

installCRDs: true

Actual behaviour

CRDs are not upgraded

Steps to reproduce the behaviour

Install redis operator via helm and then update to a new version that has updated crds

ese commented 1 year ago

Thanks @onedr0p. Yes known behavior so IMHO not an issue. We have it in the README in the upgrade section. Anyways I'm happy to change chart if anyone wants to contribute that that