MongoDB.live, free & fully virtual. June 9th - 10th. Register Now MongoDB.live, free & fully virtual. June 9th - 10th. Register Now

Exposing replica set outside Kubernetes

I am using MongoDB Enterprise Operator for deploying MongoDB into Kubernetes. Till now I have successfully deployed the database but I am getting problems in exposing it outside kubernetes.

I am following this doc: https://docs.mongodb.com/kubernetes-operator/master/tutorial/connect-from-outside-k8s/
A/c to the doc, we have to expose each pod as NodePort and connect through replicaSetHorizons. But this requires that the k8s worker nodes have an external IP which is not available in my case.

Is there are other ways to expose the replicaset?

Thanks

Hello,

You can use a load-balancer service; one for each replicaset.