rancher / community-catalog

Catalog entries contributed by the community
385 stars 641 forks source link

How to expose mongo-replica set outside rancher #825

Open sachingoel opened 5 years ago

sachingoel commented 5 years ago

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.

tawsif93 commented 4 years ago

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.