OT-CONTAINER-KIT / redis-operator

A golang based redis operator that will make/oversee Redis standalone/cluster/replication/sentinel mode setup on top of the Kubernetes.
https://ot-redis-operator.netlify.app/
Apache License 2.0
793 stars 217 forks source link

Support updating StatefulSet for fields other than 'replicas', 'template', and 'updateStrategy' #546

Open cooltea713705 opened 1 year ago

cooltea713705 commented 1 year ago

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

When trying to update the StatefulSet managed by redis-operator, the following error occurs: StatefulSet.apps "..." is invalid: spec: Forbidden: updates to statefulset spec for fields other than 'replicas', 'template', and 'updateStrategy' are forbidden. This occurred while trying to update metadata.labels referring to a Helm chart which version changed.

Describe the solution you'd like

Support updating other fields than those.

Describe alternatives you've considered

N/A

What version of redis-operator are you using?

redis-operator version: v0.14.0

Additional context

jpuskar commented 1 year ago

Deleting and recreating makes sense with our use-case too. Maybe an annotation called something like updateStrategy: recreate? If the operator gets back the error message above, then it can call delete + create instead of patch.

We ran into this when trying to swap between TLS and non-TLS, for single-node redis cache instances.