Skip to content

Commit

Permalink
add option to specify storage class per PVC
Browse files Browse the repository at this point in the history
  • Loading branch information
edevosc2c committed Feb 7, 2024
1 parent caca97b commit b97a479
Show file tree
Hide file tree
Showing 10 changed files with 96 additions and 68 deletions.
11 changes: 7 additions & 4 deletions templates/geonetwork/elasticsearch/es-data-pvc.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- $webapp := .Values.georchestra.webapps.geonetwork.elasticsearch -}}
{{- $webapp_storage := .Values.georchestra.storage.gn4_es -}}
{{- if $webapp.enabled -}}
apiVersion: v1
kind: PersistentVolumeClaim
Expand All @@ -11,13 +12,15 @@ metadata:
spec:
accessModes:
- ReadWriteOnce
{{- if .Values.georchestra.storage.storage_class_name }}
{{- if $webapp_storage.storage_class_name }}
storageClassName: {{ $webapp_storage.storage_class_name }}
{{- else if .Values.georchestra.storage.storage_class_name }}
storageClassName: {{ .Values.georchestra.storage.storage_class_name }}
{{- end }}
{{- if .Values.georchestra.storage.gn4_es.pv_name }}
volumeName: {{ .Values.georchestra.storage.gn4_es.pv_name }}
{{- if $webapp_storage.pv_name }}
volumeName: {{ $webapp_storage.pv_name }}
{{- end }}
resources:
requests:
storage: {{ .Values.georchestra.storage.gn4_es.size }}
storage: {{ $webapp_storage.size }}
{{- end }}
11 changes: 7 additions & 4 deletions templates/geonetwork/geonetwork-datadir-pvc.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- $webapp := .Values.georchestra.webapps.geonetwork -}}
{{- $webapp_storage := .Values.georchestra.storage.geonetwork_datadir -}}
{{- if $webapp.enabled -}}
apiVersion: v1
kind: PersistentVolumeClaim
Expand All @@ -11,13 +12,15 @@ metadata:
spec:
accessModes:
- ReadWriteOnce
{{- if .Values.georchestra.storage.storage_class_name }}
{{- if $webapp_storage.storage_class_name }}
storageClassName: {{ $webapp_storage.storage_class_name }}
{{- else if .Values.georchestra.storage.storage_class_name }}
storageClassName: {{ .Values.georchestra.storage.storage_class_name }}
{{- end }}
{{- if .Values.georchestra.storage.geonetwork_datadir.pv_name }}
volumeName: {{ .Values.georchestra.storage.geonetwork_datadir.pv_name }}
{{- if $webapp_storage.pv_name }}
volumeName: {{ $webapp_storage.pv_name }}
{{- end }}
resources:
requests:
storage: {{ .Values.georchestra.storage.geonetwork_datadir.size }}
storage: {{ $webapp_storage.size }}
{{- end }}
11 changes: 7 additions & 4 deletions templates/geoserver/geoserver-datadir-pvc.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- $webapp := .Values.georchestra.webapps.geoserver -}}
{{- $webapp_storage := .Values.georchestra.storage.geoserver_datadir -}}
{{- if $webapp.enabled -}}
apiVersion: v1
kind: PersistentVolumeClaim
Expand All @@ -11,13 +12,15 @@ metadata:
spec:
accessModes:
- ReadWriteOnce
{{- if .Values.georchestra.storage.storage_class_name }}
{{- if $webapp_storage.storage_class_name }}
storageClassName: {{ $webapp_storage.storage_class_name }}
{{- else if .Values.georchestra.storage.storage_class_name }}
storageClassName: {{ .Values.georchestra.storage.storage_class_name }}
{{- end }}
{{- if .Values.georchestra.storage.geoserver_datadir.pv_name }}
volumeName: {{ .Values.georchestra.storage.geoserver_datadir.pv_name }}
{{- if $webapp_storage.pv_name }}
volumeName: {{ $webapp_storage.pv_name }}
{{- end }}
resources:
requests:
storage: {{ .Values.georchestra.storage.geoserver_datadir.size }}
storage: {{ $webapp_storage.size }}
{{- end }}
11 changes: 7 additions & 4 deletions templates/geoserver/geoserver-geodata-pvc.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- $webapp := .Values.georchestra.webapps.geoserver -}}
{{- $webapp_storage := .Values.georchestra.storage.geoserver_geodata -}}
{{- if $webapp.enabled -}}
apiVersion: v1
kind: PersistentVolumeClaim
Expand All @@ -11,13 +12,15 @@ metadata:
spec:
accessModes:
- ReadWriteOnce
{{- if .Values.georchestra.storage.storage_class_name }}
{{- if $webapp_storage.storage_class_name }}
storageClassName: {{ $webapp_storage.storage_class_name }}
{{- else if .Values.georchestra.storage.storage_class_name }}
storageClassName: {{ .Values.georchestra.storage.storage_class_name }}
{{- end }}
{{- if .Values.georchestra.storage.geoserver_geodata.pv_name }}
volumeName: {{ .Values.georchestra.storage.geoserver_geodata.pv_name }}
{{- if $webapp_storage.pv_name }}
volumeName: {{ $webapp_storage.pv_name }}
{{- end }}
resources:
requests:
storage: {{ .Values.georchestra.storage.geoserver_geodata.size }}
storage: {{ $webapp_storage.size }}
{{- end }}
11 changes: 7 additions & 4 deletions templates/geoserver/geoserver-tiles-pvc.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- $webapp := .Values.georchestra.webapps.geoserver -}}
{{- $webapp_storage := .Values.georchestra.storage.geoserver_tiles -}}
{{- if and $webapp.enabled .Values.georchestra.storage.geoserver_tiles -}}
apiVersion: v1
kind: PersistentVolumeClaim
Expand All @@ -11,13 +12,15 @@ metadata:
spec:
accessModes:
- ReadWriteOnce
{{- if .Values.georchestra.storage.storage_class_name }}
{{- if $webapp_storage.storage_class_name }}
storageClassName: {{ $webapp_storage.storage_class_name }}
{{- else if .Values.georchestra.storage.storage_class_name }}
storageClassName: {{ .Values.georchestra.storage.storage_class_name }}
{{- end }}
{{- if .Values.georchestra.storage.geoserver_tiles.pv_name }}
volumeName: {{ .Values.georchestra.storage.geoserver_tiles.pv_name }}
{{- if $webapp_storage.pv_name }}
volumeName: {{ $webapp_storage.pv_name }}
{{- end }}
resources:
requests:
storage: {{ .Values.georchestra.storage.geoserver_tiles.size }}
storage: {{ $webapp_storage.size }}
{{- end }}
26 changes: 26 additions & 0 deletions templates/ldap/openldap-pvc-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{{- $webapp := .Values.georchestra.webapps.openldap -}}
{{- $webapp_storage := .Values.georchestra.storage.openldap_config -}}
{{- if $webapp.enabled -}}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ include "georchestra.fullname" . }}-openldap-config
labels:
{{- include "georchestra.labels" . | nindent 4 }}
app.kubernetes.io/component: {{ include "georchestra.fullname" . }}-ldap
helm.sh/resource-policy: "keep"
spec:
accessModes:
- ReadWriteOnce
{{- if .Values.georchestra.storage.openldap_config.storage_class_name }}
storageClassName: {{ .Values.georchestra.storage.openldap_config.storage_class_name }}
{{- else if .Values.georchestra.storage.storage_class_name }}
storageClassName: {{ .Values.georchestra.storage.storage_class_name }}
{{- end }}
{{- if .Values.georchestra.storage.openldap_config.pv_name }}
volumeName: {{ .Values.georchestra.storage.openldap_config.pv_name }}
{{- end }}
resources:
requests:
storage: {{ .Values.georchestra.storage.openldap_config.size }}
{{- end }}
26 changes: 26 additions & 0 deletions templates/ldap/openldap-pvc-data.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{{- $webapp := .Values.georchestra.webapps.openldap -}}
{{- $webapp_storage := .Values.georchestra.storage.openldap_data -}}
{{- if $webapp.enabled -}}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ include "georchestra.fullname" . }}-openldap-data
labels:
{{- include "georchestra.labels" . | nindent 4 }}
app.kubernetes.io/component: {{ include "georchestra.fullname" . }}-ldap
helm.sh/resource-policy: "keep"
spec:
accessModes:
- ReadWriteOnce
{{- if .Values.georchestra.storage.openldap_data.storage_class_name }}
storageClassName: {{ .Values.georchestra.storage.openldap_data.storage_class_name }}
{{- else if .Values.georchestra.storage.storage_class_name }}
storageClassName: {{ .Values.georchestra.storage.storage_class_name }}
{{- end }}
{{- if .Values.georchestra.storage.openldap_data.pv_name }}
volumeName: {{ .Values.georchestra.storage.openldap_data.pv_name }}
{{- end }}
resources:
requests:
storage: {{ .Values.georchestra.storage.openldap_data.size }}
{{- end }}
44 changes: 0 additions & 44 deletions templates/ldap/openldap-pvc.yaml

This file was deleted.

11 changes: 7 additions & 4 deletions templates/mapstore/mapstore-pvc.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- $webapp := .Values.georchestra.webapps.mapstore -}}
{{- $webapp_storage := .Values.georchestra.storage.mapstore_datadir -}}
{{- if $webapp.enabled -}}
apiVersion: v1
kind: PersistentVolumeClaim
Expand All @@ -11,13 +12,15 @@ metadata:
spec:
accessModes:
- ReadWriteOnce
{{- if .Values.georchestra.storage.storage_class_name }}
{{- if $webapp_storage.storage_class_name }}
storageClassName: {{ $webapp_storage.storage_class_name }}
{{- else if .Values.georchestra.storage.storage_class_name }}
storageClassName: {{ .Values.georchestra.storage.storage_class_name }}
{{- end }}
{{- if .Values.georchestra.storage.mapstore_datadir.pv_name }}
volumeName: {{ .Values.georchestra.storage.mapstore_datadir.pv_name }}
{{- if $webapp_storage.pv_name }}
volumeName: {{ $webapp_storage.pv_name }}
{{- end }}
resources:
requests:
storage: {{ .Values.georchestra.storage.mapstore_datadir.size }}
storage: {{ $webapp_storage.size }}
{{- end }}
2 changes: 2 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ georchestra:
size: 256Mi
geoserver_geodata:
# pv_name: geoserver_geodata
# works for other storage items
# storage_class_name: default
size: 2Gi
mapstore_datadir:
# pv_name: mapstore_datadir
Expand Down

0 comments on commit b97a479

Please sign in to comment.