Skip to content

Adding snapshot config results in illegal statefulset update #394

@dbackeus

Description

@dbackeus

I just attempted to add snapshot configuration after having already deployed a Dragonfly cluster.

Ie. I added the following to my Dragonfly manifest:

  snapshot:
    cron: "*/5 * * * *" # every five minutes
    persistentVolumeClaimSpec:
      accessModes:
        - ReadWriteOnce
      resources:
        requests:
          storage: 5Gi

After pushing the change, nothing happened, but I found the following error in the operator logs:

ERROR Reconciler error {"controller": "Dragonfly", "controllerGroup": "dragonflydb.io", "controllerKind": "Dragonfly", "Dragonfly": {"name":"dragonfly-dragonfly","namespace":"default"}, "namespace": "default", "name": "dragonfly-dragonfly", "reconcileID": "05775989-00dd-418f-9236-f53391386ab4", "error": "failed to reconcile dragonfly resources: failed to update resource: StatefulSet.apps \"dragonfly-dragonfly\" is invalid: spec: Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordinals', 'temp late', 'updateStrategy', 'persistentVolumeClaimRetentionPolicy' and 'minReadySeconds' are forbidden"}

A more sophisticated strategy for statefulset management would be necessary to allow this kind of change. Eg. have the operator create one statefulset per replica, which could then allow replacing existing statefulsets one by one.

If that sort of thing is out of scope for the operator maybe a validating webhook could be implemented to deny this illegal change instead?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions