Stack multiple replicasets on 3 nodes (GKE)

We have reserved 3 nodes to run the replicaset. It turns out that each pod is placed to a different node - which makes perfectly sense. The problem is though that 2 nodes are in most cases idle which is a waste of resources. Obviously that is the way it is with a single replicaset. But how about if I have multiple replicasets (basically multiple operators on different namespaces) ?

Question: How can I “stack” multiple replicasets on a 3-node node-pool (GKE) ?

Thanks & Regards

1 Like

Hi @jamoser,

Operator configures affinity rules for mongodb pods that suggests to kubernetes not to schedule the pods to the same node. You can disable these rules through cr.yaml if you want.

To have multiple replica sets:

As you mentioned you can deploy multiple operators on different namespaces or you can have a single operator deployment and deploy multiple custom resources (PerconaServerMongoDB) into the same namespace.

Operator also can deploy multiple replica sets for a single custom resource but that feature is tightly coupled with sharding.

1 Like

I am talking about this setup. So in order to avoid rs0-1,2,3 to be deployed on the same node, there must something configured - and I am asking what.

Because if you deploy 2 cluster in 2 diff namespaces but on 3 nodes, it’s going to fail. So it looks like each pod has to be on a seperate node.

1 Like

It’s working - make sure that replicaset name rs is different for each cluster. Then it’s possible to “layer” the clusters on 2 nodes.

Pls close the ticket.

1 Like