mongodb allows you to add setup scripts to docker-entrypoint-initdb.d to create initial databases / tables. They also support the following environment variables for setting up users / databases:
Is it possible to specify this in the MongoDB operator?
Hello @jml5qh ,
we do not support it for now in the Operator. It is possible to perform the same operations with you CICD pipeline or side tools.
Our focus is to provision the infrastructure and MongoDB itself, without going into the database.
If there is a hard requirement or blocker please let us know.
I noticed there are references to MONGO_INITDB_ROOT_USERNAME, MONGO_INITDB_ROOT_PASSWORD, MONGO_INITDB_DATABASE, and docker-entrypoint-initdb.d in https://github.com/percona/percona-server-mongodb-operator/blob/main/build/ps-entry.sh#L218.
I was able to create a root user by adding MONGO_INITDB_ROOT_USERNAME and MONGO_INITDB_ROOT_PASSWORD to my user secrets file, but I’m still looking into picking up the docker-entrypoint-initdb.d directory. Am I going about this wrong? Is this not supported?
Hi, i am also looking for a way to setup the initdb script. Any solution yet?
No I ended up going with the Bitnami Helm chart