Skip to content
Snippets Groups Projects
Commit 83f7955b authored by Andri Joos's avatar Andri Joos :blush:
Browse files

Merge branch 'multi_volume_support'

parents 130ba329 01f2689e
No related branches found
No related tags found
No related merge requests found
Pipeline #7236 passed with stages
in 32 seconds
......@@ -15,10 +15,10 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.0.0
version: 1.1.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.0.0"
appVersion: "1.1.0"
......@@ -60,14 +60,3 @@ Create the name of the service account to use
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
{{/*
PersistentVolume
*/}}
{{- define "nfs-static-provisioning.persistentvolume.name" -}}
{{- if .Values.pvName }}
{{- printf "pvc-static-%s" .Values.pvName }}
{{- else}}
{{- printf "pvc-static-%s" uuidv4 }}
{{- end }}
{{- end }}
{{- range .Values.volumes }}
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: {{ include "nfs-static-provisioning.persistentvolume.name" . }}
{{- with .Values.annotations }}
name: {{ .pvName }}
{{- with $.Values.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
{{- include "nfs-static-provisioning.labels" . | nindent 4 }}
{{- include "nfs-static-provisioning.labels" $ | nindent 4 }}
spec:
capacity:
storage: {{ .Values.size }}
{{- with .Values.accessModes }}
storage: {{ .size }}
{{- with .accessModes }}
accessModes:
{{- toYaml . | nindent 4 }}
{{- end }}
persistentVolumeReclaimPolicy: {{ .Values.reclaimPolicy }}
storageClassName: {{ .Values.storageClassName }}
persistentVolumeReclaimPolicy: {{ .reclaimPolicy }}
storageClassName: {{ .storageClassName }}
csi:
driver: nfs.csi.k8s.io
volumeHandle: {{ include "nfs-static-provisioning.persistentvolume.name" . }} # Unique identifier for the NFS volume
volumeHandle: {{ .pvName }} # Unique identifier for the NFS volume
volumeAttributes:
server: {{ .Values.server }}
share: {{ .Values.path }}
server: {{ .server }}
share: {{ .path }}
{{- end }}
{{- range .Values.volumes }}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ .Release.Name }}
{{- with .Values.annotations }}
name: {{ .name }}
{{- with $.Values.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
{{- include "nfs-static-provisioning.labels" . | nindent 4 }}
{{- include "nfs-static-provisioning.labels" $ | nindent 4 }}
spec:
{{- with .Values.accessModes }}
{{- with .accessModes }}
accessModes:
{{- toYaml . | nindent 4 }}
{{- end }}
storageClassName: {{ .Values.storageClassName }}
volumeName: {{ include "nfs-static-provisioning.persistentvolume.name" . }}
storageClassName: {{ .storageClassName }}
volumeName: {{ .pvName }}
resources:
requests:
storage: {{ .Values.size }}
storage: {{ .size }}
{{- end}}
accessModes:
- ReadWriteMany
storageClassName: nfs-csi
size: 1Mi
volumes: []
# - name: pvc
# pvName: pv
# size: 1Mi
# reclaimPolicy: Retain
# storageClassName: nfs-csi
# server: nfs-server.nfs-server.svc.cluster.local
# path: /
# accessModes:
# - ReadWriteMany
annotations: {}
reclaimPolicy: Retain
server: nfs-server.nfs-server.svc.cluster.local
path: /
# It is highly recommended to set pvName, otherwise it is generated using uuid4.
# Therefore, the pv changes everytime, which leads to errors while applying because the volumeName in the pvc is not allowed to change
pvName:
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment