1

I have a MongoDB cluster in Kubernetes, it's pushed to Kube with a StatefulSet type of deployment.

That part work's good, I can even create 1 DB with variables starting with that...

My question is, how do I create more than 1 DB within Mongo at first run time?

Let's say I have 5 DB to create with their respective user/pass

  • db-foo
  • db-bar
  • db-test
  • db-lotr
  • db-thedb

How can I make sure these are initiated/created at first deploy time? Do I just create a SHELL script within mongodb/pre-init/ and rebuild my Mongo with my scripts in there?

Do I use another set of variables numbered?

I am confused. Please help me.

yield
  • 731
  • 1
  • 8
  • 24

0 Answers0