init commit
This commit is contained in:
16
helm/templates/init-script.yaml
Normal file
16
helm/templates/init-script.yaml
Normal file
@@ -0,0 +1,16 @@
|
||||
{{- if .Values.auth.enabled }}
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ include "mongo.name.initialize" . }}
|
||||
labels:
|
||||
{{- include "mongo.labels" . | nindent 4 }}
|
||||
data:
|
||||
init.js: |
|
||||
db = db.getSiblingDB(process.env.MONGO_INITDB_DATABASE);
|
||||
db.createUser({
|
||||
user: process.env.MONGO_INITDB_USERNAME,
|
||||
pwd: process.env.MONGO_INITDB_PASSWORD,
|
||||
roles: [{ role: "readWrite", db: process.env.MONGO_INITDB_DATABASE }]
|
||||
});
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user