percona-server-mongodb-operator icon indicating copy to clipboard operation
percona-server-mongodb-operator copied to clipboard

Cannot scale up mongodb instances storage from the CR definition of the psmdb cluster

Open konoox opened this issue 11 months ago • 2 comments

Proposal

If we try to increase the size of the replset mongodb instances storage defined in the spec.replsets[*].volumeSpec.persistentVolumeClaim.resources.requests.storage or spec.sharding.configsvrReplSet.volumeSpec.persistentVolumeClaim.resources.requests.storage CR attributes, the operator is not able to update the related replset statefulsets and pvc as we can see from its logs :

"Forbidden: updates to statefulset spec for fields other than …"

As far as I know, the only way to scale up the storage size of these instances is to directly update the related pvc definition, assuming that these pvc are provided by storageclasses allowing the volume expansion of course. But this is not very convenient as the CR definition and related statefulsets are not updated behind.

It would be a great improvement to allow volume expansion from the CR definition by creating external pvc attached to the pod using Claims As Volumes method as implemented with the PostgreSQL operator instead of the dynamic pvc creation from statefulset definition with the Volume Claim Templates method.

Use-Case

Steps to reproduce this issue : 1 - Create a psmdb cluster with one replset configure with its storage size 2 - Wait for the cluster to be ready and see the newly created pvc with the desired storage size 3 - Try to scale up the instances by increasing spec.replsets[0].volumeSpec.persistentVolumeClaim.resources.requests.storage attribute in the CR definition 4 - See that the pvc storage size is not updated because the operator is unable to update the related statefulset definition as mentioned in its logs

Is this a feature you are interested in implementing yourself?

No

Anything else?

No response

konoox avatar Mar 15 '24 08:03 konoox

@konoox we have a plan to add this feature only in one of the next PSMDBO releases. Now only the PXC operator supports it.

hors avatar Mar 15 '24 16:03 hors

This is the corresponding JIRA ticket: https://perconadev.atlassian.net/browse/K8SPSMDB-733

@konoox meanwhile it is possible to scale the storage through a few manual steps: https://www.percona.com/blog/percona-operator-volume-expansion-without-downtime/

spron-in avatar Mar 25 '24 08:03 spron-in