stackstorm-k8s icon indicating copy to clipboard operation
stackstorm-k8s copied to clipboard

MongoDB standalone architecture handling - missing in template

Open gauravjain1582 opened this issue 4 years ago • 2 comments

folks, I figured MongoDB standalone architecture handling is also required in configmaps_st2-conf.yaml template. At the moment Standalone or Replicate set both populate list of mondo-pb pod endpoints to config.

https://github.com/StackStorm/stackstorm-ha/blob/master/templates/configmaps_st2-conf.yaml

  {{- if index .Values "mongodb" "auth" "enabled" }}
   host = mongodb://{{ template "mongodb-nodes" $ }}/{{ required "mongodb.auth.database is required!" (index .Values "mongodb" "auth" "database") }}?authSource={{ required "mongodb.auth.database is required!" (index .Values "mongodb" "auth" "database") }}&replicaSet={{ index .Values "mongodb" "replicaSetName" }}
   username = {{ required "mongodb.auth.username is required!" (index .Values "mongodb" "auth" "username") }}
   password = {{ required "mongodb.auth.password is required!" (index .Values "mongodb" "auth" "password") }}
   db_name = {{ required "mongodb.auth.database is required!" (index .Values "mongodb" "auth" "database") }}
   {{- else }}
   host = mongodb://{{ template "mongodb-nodes" $ }}/?replicaSet={{ index .Values "mongodb" "replicaSetName" }}

I can reproduce everything in my env. I fix would be needed.

Thx G

gauravjain1582 avatar Sep 18 '21 01:09 gauravjain1582

Hi @gauravjain1582 this is by design. MongoDB standalone is not a recommended option for StackStorm-HA deployment. All pods (as appropriate) and external dependencies are expected to be HA. Ideally, standalone should only be used in development/testing environment. For Production replicaset is the way to go. Hope that helps.

arms11 avatar Sep 18 '21 01:09 arms11

Why would you install a standalone MongoDB in kubernetes? If you have a standalone MongoDB instance outside of kubernetes, then you should be disabling the mongodb chart, and provide your own database host/auth config in .Values.st2.config.

If, however, you are using the mongo subchart to somehow install a standalone mongo, then I'm happy to review a pull request that fixes support for that setup. What changes would be required to support that? Is it minimal?

cognifloyd avatar Nov 11 '21 21:11 cognifloyd