# Increase storage size for Mongodb Operator

**URL:** <https://forums.percona.com/t/increase-storage-size-for-mongodb-operator/14560>\
**Category:** Percona Operator for MongoDB\
**Created:** [February 24, 2022, 11:30pm UTC](https://forums.percona.com/t/increase-storage-size-for-mongodb-operator/14560 "2022-02-24T23:30:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Darko](https://avatars.discourse-cdn.com/v4/letter/d/df788c/32.png) [@Darko](https://forums.percona.com/u/Darko)\
**Post date:** [February 24, 2022, 11:30pm UTC](https://forums.percona.com/t/increase-storage-size-for-mongodb-operator/14560/1 "2022-02-24T23:30:35Z")

</div>

Lets say I have 3 replicas, each with persistent disk of 10G.  
Then I need to increase the disks to 100G.  
Any recommendations what is the best way to increase the storage size ? Example for google cloud.

---

<div class="post-metadata">

**Author:** ![Darko](https://avatars.discourse-cdn.com/v4/letter/d/df788c/32.png) [@Darko](https://forums.percona.com/u/Darko)\
**Post date:** [February 26, 2022, 7:44pm UTC](https://forums.percona.com/t/increase-storage-size-for-mongodb-operator/14560/2 "2022-02-26T19:44:12Z")

</div>

It seems in GKE is pretty simple, just edit the cr.yaml - increase the volume size, and then for each of the pvc, edit them “kubectl edit pvc thenameofthepvc” and shortly they will be resized.

---

<div class="post-metadata">

**Author:** ![Sergey\_Pronin](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/sergey_pronin/32/14887_2.png) [@Sergey\_Pronin](https://forums.percona.com/u/Sergey_Pronin)\
**Post date:** [February 28, 2022, 8:17am UTC](https://forums.percona.com/t/increase-storage-size-for-mongodb-operator/14560/3 "2022-02-28T08:17:06Z")

</div>

Hello @Darko ,

yes, your way would work for Google Cloud.  
But as long as there are many Container Storage Interfaces (CSIs) with different capabilities, it is hard for us to come up with the solution that would work for all of them.

I wrote a [blog post](https://www.percona.com/blog/2021/04/20/change-storage-class-on-kubernetes-on-the-fly/) some time ago that should work for any CSI.  
It just scales up the cluster with new storage class (or size) and then you can rotate other nodes one by one.

---

<div class="post-metadata">

**Author:** ![qonalex](https://avatars.discourse-cdn.com/v4/letter/q/898d66/32.png) [@qonalex](https://forums.percona.com/u/qonalex)\
**Post date:** [June 11, 2024, 6:46pm UTC](https://forums.percona.com/t/increase-storage-size-for-mongodb-operator/14560/4 "2024-06-11T18:46:45Z")

</div>

Hello @Sergey_Pronin!

Would it work in a same way for mongodb cluster managed by mongodb-operator with a 3 replicas?

1. Change storage class in cr
2. Re-create STS keeping pods running
3. Scale up yo 5 replicas
4. Wait for sync of 2 new replicas
5. Rotate old 3 replicas by deletion/resync
6. Scale dwon back to 3 replicas
