Add MongoDB initialization script and update deployment configurations

This commit is contained in:
Elmar Kresse
2025-06-17 17:26:10 +02:00
parent ffbd5a0991
commit c53a087f1e
8 changed files with 36 additions and 8 deletions

View File

@@ -12,12 +12,18 @@ spec:
labels:
app: mongo
spec:
hostAliases:
- ip: "127.0.0.1"
hostnames:
- "mongo"
securityContext:
runAsUser: 1001
fsGroup: 0
containers:
- name: mongo
image: {{ .Values.mongo.image }}
command: ["mongod"]
args: ["--replSet", "{{ .Values.mongo.replSet }}"]
ports:
- containerPort: {{ .Values.mongo.port }}
env:
@@ -36,6 +42,9 @@ spec:
volumeMounts:
- name: mongo-data
mountPath: {{ .Values.mongo.volumeMounts.db }}
- name: mongo-init
mountPath: /docker-entrypoint-initdb.d/mongo-init.js
subPath: mongo-init.js
resources:
requests:
cpu: {{ .Values.resources.mongo.requests.cpu }}
@@ -46,4 +55,7 @@ spec:
volumes:
- name: mongo-data
persistentVolumeClaim:
claimName: {{ .Values.persistence.mongoData }}
claimName: {{ .Values.persistence.mongoData }}
- name: mongo-init
configMap:
name: mongo-init-script