rancher / community-catalog

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

Expose MongoDB replica set from catalog outside of rancher #438

Open occasl opened 7 years ago

occasl commented 7 years ago

Has anyone had experience exposing the MongoDB replica set that you can build from the community catalog to clients outside of Rancher? I need a shared instance and this seems like an ideal way to quickly spin up instances, but I have no clue how I can expose the master from the replica set. You can't use an LB because it will roundrobin between each node in the replica set, which doesn't work well in Mongo since it's master/slave (unless you override that but that's not recommended).

Maybe there's some special sauce with HAProxy that can discover which one is master and have affinity toward it but I'm just not sure. This looked promising but I couldn't get that to work in the extra config section. Any ideas?

Also, how do I turn on authentication after I create the user account?

Rancher Versions: CATTLE_DB_CATTLE_DATABASE=mysql CATTLE_DB_CATTLE_MYSQL_HOST=localhost CATTLE_DB_CATTLE_MYSQL_NAME=cattle CATTLE_DB_CATTLE_MYSQL_PORT=3306 CATTLE_DB_CATTLE_USERNAME=cattle CATTLE_GRAPHITE_HOST= CATTLE_GRAPHITE_PORT= CATTLE_HOME=/var/lib/cattle CATTLE_HOST_API_PROXY_MODE=embedded CATTLE_LOGBACK_OUTPUT_GELF_HOST= CATTLE_LOGBACK_OUTPUT_GELF_PORT= CATTLE_RANCHER_CLI_VERSION=v0.4.1 CATTLE_RANCHER_COMPOSE_VERSION=v0.12.2 CATTLE_RANCHER_SERVER_IMAGE=rancher/server CATTLE_RANCHER_SERVER_VERSION=v1.4.0 CATTLE_USE_LOCAL_ARTIFACTS=true

Docker Version: 1.2.5

OS version: CentOS Linux release 7.3.1611 (Core) on VMWare

Setup Details: Single node rancher

Environment Type: Cattle

RafaMunoz commented 4 years ago

Hello, I have been trying to find a solution for several days but I have not been successful.

From inside it works smoothly and from outside only to individual nodes.

Did you find any solution to connect to full replica set?