From 0b558d361422999b6230ff72f341effd5d019d27 Mon Sep 17 00:00:00 2001 From: Emilien Devos <121870973+edevosc2c@users.noreply.github.com> Date: Tue, 7 May 2024 15:27:22 +0200 Subject: [PATCH] add support for other options with PVC (#86) --- .../geonetwork/elasticsearch/es-data-pvc.yaml | 16 ++++++++++++++-- .../geonetwork/geonetwork-datadir-pvc.yaml | 16 ++++++++++++++-- .../geoserver/geoserver-datadir-pvc.yaml | 16 ++++++++++++++-- .../geoserver/geoserver-geodata-pvc.yaml | 16 ++++++++++++++-- templates/geoserver/geoserver-tiles-pvc.yaml | 16 ++++++++++++++-- templates/ldap/openldap-pvc-config.yaml | 16 ++++++++++++++-- templates/ldap/openldap-pvc-data.yaml | 16 ++++++++++++++-- templates/mapstore/mapstore-pvc.yaml | 16 ++++++++++++++-- templates/rabbitmq/rabbitmq-pvc.yaml | 19 +++++++++++++------ values.yaml | 8 ++++++-- 10 files changed, 131 insertions(+), 24 deletions(-) diff --git a/templates/geonetwork/elasticsearch/es-data-pvc.yaml b/templates/geonetwork/elasticsearch/es-data-pvc.yaml index 9da6187..ed86420 100644 --- a/templates/geonetwork/elasticsearch/es-data-pvc.yaml +++ b/templates/geonetwork/elasticsearch/es-data-pvc.yaml @@ -11,9 +11,21 @@ metadata: helm.sh/resource-policy: "keep" spec: accessModes: - - ReadWriteOnce - {{- if $webapp_storage.storage_class_name }} + {{- if $webapp_storage.accessModes }} + {{- range $webapp_storage.accessModes }} + - {{ . | quote }} + {{- end }} + {{- else }} + {{- range .Values.georchestra.storage.accessModes }} + - {{ . | quote }} + {{- end }} + {{- end }} + {{- if (eq "-" $webapp_storage.storage_class_name) }} + storageClassName: "" + {{- else if $webapp_storage.storage_class_name }} storageClassName: {{ $webapp_storage.storage_class_name }} + {{- else if (eq "-" .Values.georchestra.storage.storage_class_name) }} + storageClassName: "" {{- else if .Values.georchestra.storage.storage_class_name }} storageClassName: {{ .Values.georchestra.storage.storage_class_name }} {{- end }} diff --git a/templates/geonetwork/geonetwork-datadir-pvc.yaml b/templates/geonetwork/geonetwork-datadir-pvc.yaml index 72c03b6..15a5011 100644 --- a/templates/geonetwork/geonetwork-datadir-pvc.yaml +++ b/templates/geonetwork/geonetwork-datadir-pvc.yaml @@ -11,9 +11,21 @@ metadata: helm.sh/resource-policy: "keep" spec: accessModes: - - ReadWriteOnce - {{- if $webapp_storage.storage_class_name }} + {{- if $webapp_storage.accessModes }} + {{- range $webapp_storage.accessModes }} + - {{ . | quote }} + {{- end }} + {{- else }} + {{- range .Values.georchestra.storage.accessModes }} + - {{ . | quote }} + {{- end }} + {{- end }} + {{- if (eq "-" $webapp_storage.storage_class_name) }} + storageClassName: "" + {{- else if $webapp_storage.storage_class_name }} storageClassName: {{ $webapp_storage.storage_class_name }} + {{- else if (eq "-" .Values.georchestra.storage.storage_class_name) }} + storageClassName: "" {{- else if .Values.georchestra.storage.storage_class_name }} storageClassName: {{ .Values.georchestra.storage.storage_class_name }} {{- end }} diff --git a/templates/geoserver/geoserver-datadir-pvc.yaml b/templates/geoserver/geoserver-datadir-pvc.yaml index 420f6dd..2d43d86 100644 --- a/templates/geoserver/geoserver-datadir-pvc.yaml +++ b/templates/geoserver/geoserver-datadir-pvc.yaml @@ -11,9 +11,21 @@ metadata: helm.sh/resource-policy: "keep" spec: accessModes: - - ReadWriteOnce - {{- if $webapp_storage.storage_class_name }} + {{- if $webapp_storage.accessModes }} + {{- range $webapp_storage.accessModes }} + - {{ . | quote }} + {{- end }} + {{- else }} + {{- range .Values.georchestra.storage.accessModes }} + - {{ . | quote }} + {{- end }} + {{- end }} + {{- if (eq "-" $webapp_storage.storage_class_name) }} + storageClassName: "" + {{- else if $webapp_storage.storage_class_name }} storageClassName: {{ $webapp_storage.storage_class_name }} + {{- else if (eq "-" .Values.georchestra.storage.storage_class_name) }} + storageClassName: "" {{- else if .Values.georchestra.storage.storage_class_name }} storageClassName: {{ .Values.georchestra.storage.storage_class_name }} {{- end }} diff --git a/templates/geoserver/geoserver-geodata-pvc.yaml b/templates/geoserver/geoserver-geodata-pvc.yaml index 4208b85..6905e0a 100644 --- a/templates/geoserver/geoserver-geodata-pvc.yaml +++ b/templates/geoserver/geoserver-geodata-pvc.yaml @@ -11,9 +11,21 @@ metadata: helm.sh/resource-policy: "keep" spec: accessModes: - - ReadWriteOnce - {{- if $webapp_storage.storage_class_name }} + {{- if $webapp_storage.accessModes }} + {{- range $webapp_storage.accessModes }} + - {{ . | quote }} + {{- end }} + {{- else }} + {{- range .Values.georchestra.storage.accessModes }} + - {{ . | quote }} + {{- end }} + {{- end }} + {{- if (eq "-" $webapp_storage.storage_class_name) }} + storageClassName: "" + {{- else if $webapp_storage.storage_class_name }} storageClassName: {{ $webapp_storage.storage_class_name }} + {{- else if (eq "-" .Values.georchestra.storage.storage_class_name) }} + storageClassName: "" {{- else if .Values.georchestra.storage.storage_class_name }} storageClassName: {{ .Values.georchestra.storage.storage_class_name }} {{- end }} diff --git a/templates/geoserver/geoserver-tiles-pvc.yaml b/templates/geoserver/geoserver-tiles-pvc.yaml index 5a63061..d97d47a 100644 --- a/templates/geoserver/geoserver-tiles-pvc.yaml +++ b/templates/geoserver/geoserver-tiles-pvc.yaml @@ -11,9 +11,21 @@ metadata: helm.sh/resource-policy: "keep" spec: accessModes: - - ReadWriteOnce - {{- if $webapp_storage.storage_class_name }} + {{- if $webapp_storage.accessModes }} + {{- range $webapp_storage.accessModes }} + - {{ . | quote }} + {{- end }} + {{- else }} + {{- range .Values.georchestra.storage.accessModes }} + - {{ . | quote }} + {{- end }} + {{- end }} + {{- if (eq "-" $webapp_storage.storage_class_name) }} + storageClassName: "" + {{- else if $webapp_storage.storage_class_name }} storageClassName: {{ $webapp_storage.storage_class_name }} + {{- else if (eq "-" .Values.georchestra.storage.storage_class_name) }} + storageClassName: "" {{- else if .Values.georchestra.storage.storage_class_name }} storageClassName: {{ .Values.georchestra.storage.storage_class_name }} {{- end }} diff --git a/templates/ldap/openldap-pvc-config.yaml b/templates/ldap/openldap-pvc-config.yaml index a19eccf..881831c 100644 --- a/templates/ldap/openldap-pvc-config.yaml +++ b/templates/ldap/openldap-pvc-config.yaml @@ -11,9 +11,21 @@ metadata: helm.sh/resource-policy: "keep" spec: accessModes: - - ReadWriteOnce - {{- if $webapp_storage.storage_class_name }} + {{- if $webapp_storage.accessModes }} + {{- range $webapp_storage.accessModes }} + - {{ . | quote }} + {{- end }} + {{- else }} + {{- range .Values.georchestra.storage.accessModes }} + - {{ . | quote }} + {{- end }} + {{- end }} + {{- if (eq "-" $webapp_storage.storage_class_name) }} + storageClassName: "" + {{- else if $webapp_storage.storage_class_name }} storageClassName: {{ $webapp_storage.storage_class_name }} + {{- else if (eq "-" .Values.georchestra.storage.storage_class_name) }} + storageClassName: "" {{- else if .Values.georchestra.storage.storage_class_name }} storageClassName: {{ .Values.georchestra.storage.storage_class_name }} {{- end }} diff --git a/templates/ldap/openldap-pvc-data.yaml b/templates/ldap/openldap-pvc-data.yaml index da3dc1f..39b23fd 100644 --- a/templates/ldap/openldap-pvc-data.yaml +++ b/templates/ldap/openldap-pvc-data.yaml @@ -11,9 +11,21 @@ metadata: helm.sh/resource-policy: "keep" spec: accessModes: - - ReadWriteOnce - {{- if $webapp_storage.storage_class_name }} + {{- if $webapp_storage.accessModes }} + {{- range $webapp_storage.accessModes }} + - {{ . | quote }} + {{- end }} + {{- else }} + {{- range .Values.georchestra.storage.accessModes }} + - {{ . | quote }} + {{- end }} + {{- end }} + {{- if (eq "-" $webapp_storage.storage_class_name) }} + storageClassName: "" + {{- else if $webapp_storage.storage_class_name }} storageClassName: {{ $webapp_storage.storage_class_name }} + {{- else if (eq "-" .Values.georchestra.storage.storage_class_name) }} + storageClassName: "" {{- else if .Values.georchestra.storage.storage_class_name }} storageClassName: {{ .Values.georchestra.storage.storage_class_name }} {{- end }} diff --git a/templates/mapstore/mapstore-pvc.yaml b/templates/mapstore/mapstore-pvc.yaml index 855f477..02d4a55 100644 --- a/templates/mapstore/mapstore-pvc.yaml +++ b/templates/mapstore/mapstore-pvc.yaml @@ -11,9 +11,21 @@ metadata: helm.sh/resource-policy: "keep" spec: accessModes: - - ReadWriteOnce - {{- if $webapp_storage.storage_class_name }} + {{- if $webapp_storage.accessModes }} + {{- range $webapp_storage.accessModes }} + - {{ . | quote }} + {{- end }} + {{- else }} + {{- range .Values.georchestra.storage.accessModes }} + - {{ . | quote }} + {{- end }} + {{- end }} + {{- if (eq "-" $webapp_storage.storage_class_name) }} + storageClassName: "" + {{- else if $webapp_storage.storage_class_name }} storageClassName: {{ $webapp_storage.storage_class_name }} + {{- else if (eq "-" .Values.georchestra.storage.storage_class_name) }} + storageClassName: "" {{- else if .Values.georchestra.storage.storage_class_name }} storageClassName: {{ .Values.georchestra.storage.storage_class_name }} {{- end }} diff --git a/templates/rabbitmq/rabbitmq-pvc.yaml b/templates/rabbitmq/rabbitmq-pvc.yaml index 4c37aa3..dea3575 100644 --- a/templates/rabbitmq/rabbitmq-pvc.yaml +++ b/templates/rabbitmq/rabbitmq-pvc.yaml @@ -1,4 +1,5 @@ {{- $rabbitmq := .Values.rabbitmq -}} +{{- $rabbitmq_storage := .Values.georchestra.storage.mapstore_datadir -}} {{- if and $rabbitmq.enabled $rabbitmq.storage -}} apiVersion: v1 kind: PersistentVolumeClaim @@ -9,14 +10,20 @@ metadata: app.kubernetes.io/component: {{ include "georchestra.fullname" . }}-rabbitmq spec: accessModes: - - ReadWriteOnce - {{- if $rabbitmq.storage.storage_class_name }} - storageClassName: {{ $rabbitmq.storage.storage_class_name }} + {{- if $rabbitmq_storage.accessModes }} + {{- range $rabbitmq_storage.accessModes }} + - {{ . | quote }} {{- end }} - {{- if $rabbitmq.storage.pv_name }} - volumeName: {{ $rabbitmq.storage.pv_name }} + {{- end }} + {{- if (eq "-" $rabbitmq_storage.storage_class_name) }} + storageClassName: "" + {{- else if $rabbitmq_storage.storage_class_name }} + storageClassName: {{ $rabbitmq_storage.storage_class_name }} + {{- end }} + {{- if $rabbitmq_storage.pv_name }} + volumeName: {{ $rabbitmq_storage.pv_name }} {{- end }} resources: requests: - storage: {{ $rabbitmq.storage.size }} + storage: {{ $rabbitmq_storage.size }} {{- end }} diff --git a/values.yaml b/values.yaml index 24b3e39..54a4d0a 100644 --- a/values.yaml +++ b/values.yaml @@ -186,7 +186,9 @@ georchestra: geoserver_geodata: # pv_name: geoserver_geodata # works for other storage items - # storage_class_name: default + # storage_class_name: default or "-" for empty storageClassName + # accessModes: + # - ReadWriteOnce size: 2Gi mapstore_datadir: # pv_name: mapstore_datadir @@ -202,7 +204,9 @@ georchestra: size: 2Gi # We also might need to specify a custom storageClass # Leave it commented if not needed - # storage_class_name: default + # storage_class_name: default or "-" for empty storageClassName + accessModes: + - ReadWriteOnce smtp_smarthost: enabled: true # mailname: georchestra-127-0-1-1.traefik.me