From dd3b299e2b0d365bbdd0613217ee65d649df961b Mon Sep 17 00:00:00 2001 From: Kjeld Schouten-Lebbing Date: Sat, 3 Jul 2021 11:16:55 +0200 Subject: [PATCH] create a way of not mounting volumes (#650) * create a way of not mounting volumes * fix mistake * also noMount for statefull sets --- charts/develop/nextcloud/Chart.yaml | 2 +- charts/develop/nextcloud/SCALE/questions.yaml | 12 ++++++++++++ charts/develop/nextcloud/values.yaml | 6 ++++++ charts/library/common/Chart.yaml | 2 +- .../templates/lib/controller/_volumeMounts.tpl | 5 +++++ 5 files changed, 25 insertions(+), 2 deletions(-) diff --git a/charts/develop/nextcloud/Chart.yaml b/charts/develop/nextcloud/Chart.yaml index 340da832be3..a9d25e9ba65 100644 --- a/charts/develop/nextcloud/Chart.yaml +++ b/charts/develop/nextcloud/Chart.yaml @@ -35,4 +35,4 @@ sources: - https://github.com/nextcloud/docker - https://github.com/nextcloud/helm type: application -version: 1.0.9 +version: 1.0.10 diff --git a/charts/develop/nextcloud/SCALE/questions.yaml b/charts/develop/nextcloud/SCALE/questions.yaml index e06f046a97c..36b9b479c66 100644 --- a/charts/develop/nextcloud/SCALE/questions.yaml +++ b/charts/develop/nextcloud/SCALE/questions.yaml @@ -382,6 +382,12 @@ questions: type: boolean default: true hidden: true + - variable: noMount + label: "Do not mount this storage inside the main pod" + schema: + type: boolean + default: true + hidden: true - variable: forceName label: "Override PVC Name (advanced)" description: "Forces a certain name for the PVC" @@ -460,6 +466,12 @@ questions: type: boolean default: true hidden: true + - variable: noMount + label: "Do not mount this storage inside the main pod" + schema: + type: boolean + default: true + hidden: true - variable: forceName label: "Override PVC Name (advanced)" description: "Forces a certain name for the PVC" diff --git a/charts/develop/nextcloud/values.yaml b/charts/develop/nextcloud/values.yaml index 1ddab62391e..7e8efb3bc65 100644 --- a/charts/develop/nextcloud/values.yaml +++ b/charts/develop/nextcloud/values.yaml @@ -51,11 +51,13 @@ persistence: type: emptyDir db: + noMount: true forceName: "db" enabled: true type: emptyDir redismaster: + noMount: true forceName: "redismaster" enabled: true type: emptyDir @@ -127,6 +129,8 @@ cronjob: # Enabled postgres # ... for more options see https://github.com/bitnami/charts/tree/master/bitnami/postgresql postgresql: + volumePermissions: + enabled: true enabled: true postgresqlUsername: nextcloud postgresqlDatabase: nextcloud @@ -138,6 +142,8 @@ postgresql: # Enabled redis # ... for more options see https://github.com/bitnami/charts/tree/master/bitnami/redis redis: + volumePermissions: + enabled: true architecture: standalone enabled: true auth: diff --git a/charts/library/common/Chart.yaml b/charts/library/common/Chart.yaml index 4b4ae9cc6cf..83398ac1e8a 100644 --- a/charts/library/common/Chart.yaml +++ b/charts/library/common/Chart.yaml @@ -18,4 +18,4 @@ maintainers: name: common sources: type: library -version: 6.4.6 +version: 6.5.0 diff --git a/charts/library/common/templates/lib/controller/_volumeMounts.tpl b/charts/library/common/templates/lib/controller/_volumeMounts.tpl index 5a6ad4c72a6..74b44efc249 100644 --- a/charts/library/common/templates/lib/controller/_volumeMounts.tpl +++ b/charts/library/common/templates/lib/controller/_volumeMounts.tpl @@ -1,6 +1,7 @@ {{/* Volumes included by the controller */}} {{- define "common.controller.volumeMounts" -}} {{- range $index, $item := .Values.persistence }} + {{- if not $item.noMount }} {{- $mountPath := (printf "/%v" $index) -}} {{- if eq "hostPath" (default "pvc" $item.type) -}} {{- $mountPath = $item.hostPath -}} @@ -19,15 +20,19 @@ {{- end }} {{- end }} {{- end }} + {{- end }} {{- if eq .Values.controller.type "statefulset" }} {{- range $index, $vct := .Values.volumeClaimTemplates }} + {{- if not $vct.noMount }} - mountPath: {{ $vct.mountPath }} name: {{ $vct.name }} {{- if $vct.subPath }} subPath: {{ $vct.subPath }} {{- end }} {{- end }} + {{- end }} {{- end }} + {{- end -}}