bitnami / charts

Bitnami Helm Charts
https://bitnami.com
Other
9.05k stars 9.22k forks source link

[bitnami/zookeeper] Enable OnDelete as UpdateStrategy #30173

Open enixon opened 2 weeks ago

enixon commented 2 weeks ago

Name and Version

bitnami/zookeeper 13.5.1

What is the problem this feature will solve?

The update strategy for the ZooKeeper chart is theoretically modifiable via the updateStrategy.type setting but in practice it can only support the default value of "RollingUpdate". This is because the current logic to interpret the updateStrategy.rollingUpdate setting will always add an entry for that field. This produces a forbidden configuration on the produced StatefulSet when altering updateStrategy.type to "OnDelete"

  updateStrategy:
    rollingUpdate: {}
    type: OnDelete

that results in an error when applied

StatefulSet: StatefulSet.apps "test-zookeeper" is invalid: spec.updateStrategy.rollingUpdate: Invalid value: apps.RollingUpdateStatefulSetStrategy{Partition:0, MaxUnavailable:(*intstr.IntOrString)(nil)}: only allowed for updateStrategy 'RollingUpdate'

There is no current way to delete the inserted value (see https://github.com/helm/helm/issues/11888) and updating updateStrategy.rollingUpdate to null does not produce the desired effect.

What is the feature you are proposing to solve the problem?

The bitnami/redis chart had a similar problem that they resolved with https://github.com/bitnami/charts/pull/13822.

Ideally, one could gate the updateStrategy.rollingUpdate setting on the value of updateStrategy.type.

What alternatives have you considered?

We can sidestep this issue for some of our deployments by using kustomize to modify the charts produced by bitnami.

carrodher commented 2 weeks ago

Thank you for bringing this issue to our attention. We appreciate your involvement! If you're interested in contributing a solution, we welcome you to create a pull request. The Bitnami team is excited to review your submission and offer feedback. You can find the contributing guidelines here.

Your contribution will greatly benefit the community. Feel free to reach out if you have any questions or need assistance.