dragonflydb / dragonflydb/dragonfly-operator

Adding snapshot config results in illegal statefulset update

Open
#394 0 comments 4 reactions 1 assignee Claimed by @Abhra303 View on GitHub
Dominant language
Go
Stars
357
Forks
111
PR merge metrics
No merged PRs in 30d

Description

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

Ie. I added the following to my `Dragonfly` manifest:
```yaml
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?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.