chart-unifi_network_application: add

This commit is contained in:
2024-08-25 21:52:08 +02:00
parent c90f214f54
commit 126a50b506
11 changed files with 662 additions and 0 deletions

View File

@ -0,0 +1,24 @@
---
kind: ConfigMap
apiVersion: v1
metadata:
name: {{ include "template.fullname" . }}-mongodb-init-sh
data:
init-mongo.sh: |
if which mongosh > /dev/null 2>&1; then
mongo_init_bin='mongosh'
else
mongo_init_bin='mongo'
fi
"${mongo_init_bin}" <<EOF
use ${MONGO_AUTHSOURCE}
db.auth("${MONGO_INITDB_ROOT_USERNAME}", "${MONGO_INITDB_ROOT_PASSWORD}")
db.createUser({
user: "${MONGO_USER}",
pwd: "${MONGO_PASS}",
roles: [
{ db: "${MONGO_DBNAME}", role: "dbOwner" },
{ db: "${MONGO_DBNAME}_stat", role: "dbOwner" }
]
})
EOF