gke-mongodb-demo
gke-mongodb-demo copied to clipboard
Exposing this for external services to use?
I am trying to expose it for external services to connect the replicated cluster, how do I make it via LoadBalancer?
I have the same question. Any solutions?
Yes, I was able to expose one service but I didn't use shards or anything, just a plain mongodb instance. I am still going to make more experiments on the matter so I can test it
@pvsousalima that is cool. I am trying to expose it via LoadBalancer. I am not sure how to manage the secondary instances. Do I need to create services for all of them and manually choose the connection. Or something else.
I had the same problem today when a developer needed to debug a problem in it but didn't have access to the cluster. For the life of me I couldn't find a way to expose the statefulset externally as apparently it's by design that a headless service won't be reacheable from outside the cluster. For a ad-hoc one-off debug session maybe exposing a single mongodb-0 pod (the primary, if possible) does the trick, but for more complex debugging/issues having a way to reach the main service IP of the statefulset and all its replicas would be ideal, so we could use the whole dynamics of master and slaves & data replication from outside the cluster.