Skip to content

Commit 0b2f67c

Browse files
Romain JACQUETrjacquet31
authored andcommitted
wip: move the mongo operator
- clean no longer used value in chart for backup - replace backup template by more generic keys for volume and volumeMount
1 parent 661f6b8 commit 0b2f67c

File tree

2 files changed

+14
-23
lines changed

2 files changed

+14
-23
lines changed

charts/mongodb-operated/templates/mongdb-community.yaml

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -33,25 +33,16 @@ spec:
3333
resources:
3434
{{- toYaml . | nindent 16 }}
3535
{{- end }}
36+
{{- with .Values.extraVolumeMounts }}
3637
volumeMounts:
37-
- name: backup-volume-{{ .Release.Name }}
38-
mountPath: /backups
39-
{{- if .Values.initdbScripts }}
40-
- name: init-scripts
41-
mountPath: /docker-entrypoint-initdb.d
42-
{{- end }}
38+
{{- toYaml . | nindent 16 }}
39+
{{- end }}
4340
- name: mongodb-agent
4441
imagePullPolicy: {{ .Values.image.pullPolicy }}
4542
{{- with .Values.agent.resources }}
4643
resources:
4744
{{- toYaml . | nindent 16 }}
4845
{{- end }}
49-
volumes:
50-
{{- if .Values.initdbScripts }}
51-
- name: init-scripts
52-
configMap:
53-
name: {{ .Release.Name }}-init-scripts
54-
{{- end }}
5546
volumeClaimTemplates:
5647
- metadata:
5748
name: data-volume-{{ .Release.Name }}
@@ -61,11 +52,6 @@ spec:
6152
resources:
6253
requests:
6354
storage: {{ .Values.pvc.data.size }}
64-
- metadata:
65-
name: backup-volume-{{ .Release.Name }}
66-
spec:
67-
accessModes: ["ReadWriteOnce"]
68-
storageClassName: {{ .Values.pvc.backup.storageClass }}
69-
resources:
70-
requests:
71-
storage: {{ .Values.pvc.backup.size }}
55+
{{- with .Values.extraVolumeClaimTemplates }}
56+
{{- toYaml . | nindent 8 }}
57+
{{ end -}}

charts/mongodb-operated/values.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,6 @@ pvc:
8282
data:
8383
storageClass: ""
8484
size: 10Gi
85-
backup:
86-
storageClass: ""
87-
size: 10Gi
8885

8986
# user configuration
9087
# this fied is used to fill the `spec.users` field from the MongoDBCommunity
@@ -103,3 +100,11 @@ users:
103100
# - name: clusterMonitor
104101
# db: admin
105102
# scramCredentialsSecretName: scram-user
103+
104+
# volume configuration for the mongo pod
105+
# official references:
106+
# https://kubernetes.io/docs/concepts/storage/persistent-volumes/
107+
# https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#volume-claim-templates
108+
109+
extraVolumeMounts: []
110+
extraVolumeClaimTemplates: []

0 commit comments

Comments
 (0)