rancher / community-catalog

Catalog entries contributed by the community

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to expose mongo-replica set outside rancher

sachingoel opened this issue · comments

I was trying to deploy a mongo-replicaset from rancher catalogue and it didn't provide any options for port mapping while configuring it.
And after its provision if you try to update its port mapping it throws this error: Validation failed in API: StatefulSet.apps "mongodb-replicaset-ftlhb" is invalid: spec: Forbidden: updates to statefulset spec for fields other than 'replicas', 'template', and 'updateStrategy' are forbidden.

I have also tried to create a load balancer that resolves to mongo-replicaset service discovery that finally connects to mongo replica workloads but this method allows only "layer 7" load balancing and mongo db communicates on layer 4(TCP/IP). So this strategy also fails.

How to expose a replica so that external interface resolves to master of mongo-db replica set.

Make a new service that points to mongo replica set and set the nodeport to a port, using this you can access mongo replicaset externally.