From 4e970640179e5cb223542d4f5b874d39d8c9fec4 Mon Sep 17 00:00:00 2001 From: Sascha Girrulat Date: Wed, 1 Jul 2020 17:00:55 +0200 Subject: [PATCH 1/2] Add the ability to use extraVolume[Mounts] It clould be useful to add another storage mounts to get a seperate data store. Signed-off-by: Sascha Girrulat --- chart/monocular/templates/_helpers.tpl | 8 ++++++++ chart/monocular/values.yaml | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/chart/monocular/templates/_helpers.tpl b/chart/monocular/templates/_helpers.tpl index 0ed1cec5..e40c63fc 100644 --- a/chart/monocular/templates/_helpers.tpl +++ b/chart/monocular/templates/_helpers.tpl @@ -76,6 +76,10 @@ spec: key: mongodb-root-password name: {{ template "mongodb.fullname" $global }} {{- end }} + {{- with $global.Values.sync.extraVolumeMounts }} + volumeMounts: +{{ toYaml . | indent 6 }} +{{- end }} resources: {{ toYaml $global.Values.sync.resources | indent 6 }} {{- with $global.Values.sync.nodeSelector }} @@ -90,4 +94,8 @@ spec: tolerations: {{ toYaml . | indent 4 }} {{- end }} +{{- with $global.Values.sync.extraVolumes }} + volumes: +{{ toYaml . | indent 4 }} +{{- end }} {{- end -}} diff --git a/chart/monocular/values.yaml b/chart/monocular/values.yaml index 963d853e..31db9faa 100644 --- a/chart/monocular/values.yaml +++ b/chart/monocular/values.yaml @@ -35,6 +35,13 @@ sync: nodeSelector: {} tolerations: [] affinity: {} + extraVolumes: [] + # - name: monocular-ca-certs + # configMap: + # name: monocular-ca-certs + extraVolumeMounts: [] + # - name: monocular-ca-certs + # mountPath: /etc/ssl/certs/ # Chartsvc is used to serve chart metadata over a REST API. chartsvc: From f287a3db6b873755952e4281578de9e1f96bc72d Mon Sep 17 00:00:00 2001 From: Sascha Girrulat Date: Wed, 1 Jul 2020 17:01:02 +0200 Subject: [PATCH 2/2] Use nindent instead of indent to improve the readability Signed-off-by: Sascha Girrulat --- chart/monocular/templates/_helpers.tpl | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/chart/monocular/templates/_helpers.tpl b/chart/monocular/templates/_helpers.tpl index e40c63fc..1e12365d 100644 --- a/chart/monocular/templates/_helpers.tpl +++ b/chart/monocular/templates/_helpers.tpl @@ -77,25 +77,19 @@ spec: name: {{ template "mongodb.fullname" $global }} {{- end }} {{- with $global.Values.sync.extraVolumeMounts }} - volumeMounts: -{{ toYaml . | indent 6 }} + volumeMounts: {{ toYaml . | nindent 6 }} {{- end }} - resources: -{{ toYaml $global.Values.sync.resources | indent 6 }} + resources: {{ toYaml $global.Values.sync.resources | nindent 6 }} {{- with $global.Values.sync.nodeSelector }} - nodeSelector: -{{ toYaml . | indent 4 }} + nodeSelector: {{ toYaml . | nindent 4 }} {{- end }} {{- with $global.Values.sync.affinity }} - affinity: -{{ toYaml . | indent 4 }} + affinity: {{ toYaml . | nindent 4 }} {{- end }} {{- with $global.Values.sync.tolerations }} - tolerations: -{{ toYaml . | indent 4 }} + tolerations: {{ toYaml . | nindent 4 }} {{- end }} {{- with $global.Values.sync.extraVolumes }} - volumes: -{{ toYaml . | indent 4 }} + volumes: {{ toYaml . | nindent 4 }} {{- end }} {{- end -}}