Improve Enterprise Kubernetes Operator PVC expansion
The enterprise operator should be capable of performing all the steps necessary to increase the PVC after the end-user has adjusted the storage values within the MongoDB custom resource.
Why is the Operator incapable of doing the steps starting from step 3 by itself if I simply do step 5?
So what we think should be the case:
We update the database resource with a new storage value.
Then should perform the following steps:
- Patch each persistence volume which can be found in the sts / pod spec.
- Remove the sts with --orphan because the name should be known to the operator as it is the one controlling the sts.
- Recreate the sts with the new volume size which is known as it is in the MongoDB custom resource.
- And finally perform a rolling restart of the sts.
We consider this to be an anti-pattern of the principle behind the enterprise operator as it is clearly stated:
"You provide the MongoDB Enterprise Kubernetes Operator with the specifications for your MongoDB cluster. The MongoDB Enterprise Kubernetes Operator uses this information to specify to Kubernetes how to configure that cluster including provisioning storage, setting up the network connections, and configuring other resources."
Most other DB operators for K8s support something like this already.