From 1ecdf91b1da6ec6aff0435d2265db997dd7f4bcd Mon Sep 17 00:00:00 2001 From: Adrian Berger Date: Fri, 18 Aug 2023 05:49:59 +0000 Subject: [PATCH] [common] Add ability to add external pvcs to containers Signed-off-by: Adrian Berger --- charts/common/Chart.yaml | 2 +- charts/common/README.md | 2 +- charts/common/templates/_pod.yaml | 8 ++++++++ charts/common/values.yaml | 8 +++++++- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/charts/common/Chart.yaml b/charts/common/Chart.yaml index 23cd808d..918c373a 100644 --- a/charts/common/Chart.yaml +++ b/charts/common/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: common description: "Bedag's common Helm chart to use for creating other Helm charts" -version: 10.3.1 +version: 10.4.0 # A chart can be either an 'application' or a 'library' chart. # # Application charts are a collection of templates that can be packaged into versioned archives diff --git a/charts/common/README.md b/charts/common/README.md index 8805fd18..00e3d6f8 100644 --- a/charts/common/README.md +++ b/charts/common/README.md @@ -1,6 +1,6 @@ # common -![Version: 10.3.1](https://img.shields.io/badge/Version-10.3.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) +![Version: 10.4.0](https://img.shields.io/badge/Version-10.4.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) Bedag's common Helm chart to use for creating other Helm charts diff --git a/charts/common/templates/_pod.yaml b/charts/common/templates/_pod.yaml index 26fd7767..81b2fdc5 100644 --- a/charts/common/templates/_pod.yaml +++ b/charts/common/templates/_pod.yaml @@ -79,6 +79,14 @@ volumes: {{- else }} emptyDir: {} {{- end }} + {{- else if eq .type "external" }} + {{- if .pvcName }} + persistentVolumeClaim: + claimName: {{ .pvcName }} + {{- if .readOnly }} + readOnly: {{ .readOnly }} + {{- end }} + {{- end }} {{- end }} {{- end }} {{- end }} diff --git a/charts/common/values.yaml b/charts/common/values.yaml index 2406cc8e..46f0b033 100644 --- a/charts/common/values.yaml +++ b/charts/common/values.yaml @@ -424,7 +424,7 @@ components: volumes: [] # -- name of the volume # - name: generic-name - # -- type can either be "secret", "configMap", "persistentVolumeClaim" or "emptyDir" + # -- type can either be "secret", "configMap", "persistentVolumeClaim", "emptyDir" or "external" # type: "secret" # START ONLY FOR SECRET or CONFIGMAP # filePath is optional for specifying a filePath in the helm chart where the file is located. @@ -444,6 +444,12 @@ components: # sizeLimit is the total amount of local storage required for this EmptyDir volume. Default is nil which means that the limit is undefined. # sizeLimit: 100Mi # END ONLY FOR EMPTYDIR + # START ONLY FOR EXTERNAL + # pvcName represents what name the external existing PVC has. + # pvcName: "foo" + # readOnly will force the ReadOnly setting in VolumeMounts. Comment out for using default (false) + # readOnly: true + # END ONLY FOR EXTERNAL # end pod # start containers