Standard vs regional provisioned disks, for ex. GCP

Hello

Standard → disk in one zone
Regional → disk mirrored in 2 zones

What is your recommendation ? In case of Regional and I would want to specify Zone a and c, how would you configure this on your cr.yaml (in GCP, GKE) ?

Since the disks are created automatically I see some problems to define in what zones they should be created …

Hey @jamoser.

Seems what you are trying to do is to replicate the data across multiple zones on the storage layer. There are various designs on how you can approach it.

  1. Rely on MongoDB replication and affinity.

  1. Rely on regional storage replication, run just one MongoDB node

  1. Rely on regional storage replication, but also do MongoDB replication

As for recommendations: go with (1).
Option 2 is possible, but I don’t see any good reason for it. Storage level replication can be good, but only when you have full control over replication and disk flush. Without it, you may end up with inconsistent data. Also failover will be always longer.
Option 3 - not sure why would anyone want and if it is even possible.

As for your question - can you set specific zones for Regional disks with operator - it is set on the storage class level. From their docs:

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: regionalpd-storageclass
provisioner: pd.csi.storage.gke.io
parameters:
  type: pd-balanced
  replication-type: regional-pd
volumeBindingMode: WaitForFirstConsumer
allowedTopologies:
- matchLabelExpressions:
  - key: topology.gke.io/zone
    values:
    - europe-west1-b
    - europe-west1-c

But again, pls read above.