How can predefined PV and PVC assigned to

Hello

Currently at the cluster creation the PVs and PVCs are created. Is it possible to create the PVs and PVCs beforehand and assign them to the rs’s and cfg’s ?

This can be done if you create PVCs by adhering the naming rules. For example if you have a cluster named cluster1, you can create PVCs to be used by rs0 pods like:

pvc/mongod-data-cluster1-rs0-0
pvc/mongod-data-cluster1-rs0-1
pvc/mongod-data-cluster1-rs0-2

But I’m curious, what do you want to achieve by creating PVCs yourself?

Thanks - let me try that !

Well … sometimes ppl do funny stuff - like deleting the wrong GKE cluster. And in that case the PV and PVC and the disks are getting deleted.

If I can create them myself, I can make sure that the disks get not deleted and afterwards I can reassign them.