Deploying Mongo Replicaset in multiple data centres

Hi Team / @spronin

We have a requirement to deploy pods of a replicaset across multiple k8s clusters (in different regions) & enable replication b/w pods and automate all the provisioning/operations using percona operator .

From the documentation we saw deploying replica set as DR in different region. But this requires complete set of new resouces just to act like DR.

Is there any options to deploy pods of a replicaset/shard across multiple k8s clusters (in different regions) & enable replication b/w pods of replicaset ?

Sample architecture we are looking for :

Thanks,
Adithya

1 Like

Hey @Adithya ,

there are 2 ways to get there:

  1. Your Kubernetes cluster runs across multiple regions and you have storage and network figured out.
    In this case you can have one Operator controlling all Pods and set correct anti-affinity rules to put the Pods in different regions.

  2. Your Kubernetes clusters are totally isolated (they have their own networking and storage).
    In this case you will need to have an Operator per region.
    One region will run managed MongoDB nodes.
    Other regions will be running unmanaged nodes.
    You will rely on external nodes functionality.
    See the doc here: Set up Percona Server for MongoDB cross-site replication
    See the blog here: Migrating MongoDB to Kubernetes - Percona Database Performance Blog

Please let me know your thoughts.

2 Likes