MongoDB cross-replication DNS entries

Good morning,

I am testing the version of MongoDB in Kubenetes through the operator to distribute a cluster between two regions. Region A will contain part of the replica set and the other region the other part.

As it appears in the documentation, I expose the services as loadbalancers that generate some IPS that I then associate to the main clutser so that the replication begins.

My question is whether it is possible to assign the DNS entries to the IPs of these balancers through the operator to fully automate the process.

I don’t see a field where an annotation can be assigned to create them in Helm values. And if I want to create the services with another YAML, the operator tells me that if I use external nodes I have to enable the services, which doubles the number of services.

Thank you

1 Like

Hey @dompablo ,

for now we do not automate the creation of DNS entries as we focus more on database piece.
I think you can easily automate it by integrating with external-dns. It does the job :slight_smile:

As for exposing each node and doubling the number of services - it is how it is now, as replica sets must form a full mesh and talk to each other.

As a workaround I suggest you look at Multi-Cluster Services (MCS). Also see GKE implementation here.

We have support for MCS starting Operator 1.12. You can avoid using load balancers and doubling down the services.
Read more here: Set up Percona Server for MongoDB cross-site replication

Please let me know your thoughts.

1 Like