diff --git a/charts/osrm-backend/Chart.yaml b/charts/osrm-backend/Chart.yaml index de3319b..71cb3ea 100644 --- a/charts/osrm-backend/Chart.yaml +++ b/charts/osrm-backend/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: osrm-backend description: Helm chart for Open Source Routing Machine type: application -version: 0.0.2 +version: 0.0.3 appVersion: "v5.23.0" keywords: - maps diff --git a/charts/osrm-backend/templates/pv.yaml b/charts/osrm-backend/templates/pv.yaml new file mode 100644 index 0000000..cecfc31 --- /dev/null +++ b/charts/osrm-backend/templates/pv.yaml @@ -0,0 +1,25 @@ +{{- if .Values.persistence.existingVolume.id -}} +apiVersion: v1 +kind: PersistentVolume +metadata: + name: {{ template "osrm-backend.fullname" . }} + annotations: + pv.kubernetes.io/provisioned-by: {{ .Values.persistence.existingVolume.provisioner }} +spec: + accessModes: + {{- range .Values.persistence.accessModes }} + - {{ . | quote }} + {{- end }} + capacity: + storage: {{ .Values.persistence.size | quote}} + csi: + driver: {{ .Values.persistence.existingVolume.driver }} + fsType: {{ .Values.persistence.existingVolume.type }} + {{- with .Values.persistence.annotations }} + volumeAttributes: +{{ toYaml . | indent 6 }} + {{- end }} + volumeHandle: {{ .Values.persistence.existingVolume.id }} + persistentVolumeReclaimPolicy: Retain + storageClassName: {{ .Values.persistence.storageClassName }} +{{- end -}} \ No newline at end of file diff --git a/charts/osrm-backend/templates/pvc.yaml b/charts/osrm-backend/templates/pvc.yaml index 9f5d41d..85b9114 100755 --- a/charts/osrm-backend/templates/pvc.yaml +++ b/charts/osrm-backend/templates/pvc.yaml @@ -22,7 +22,11 @@ spec: resources: requests: storage: {{ .Values.persistence.size | quote }} - {{- if .Values.persistence.storageClassName }} + {{- if and .Values.persistence.storageClassName }} storageClassName: {{ .Values.persistence.storageClassName }} - {{- end -}} + {{- end }} + {{- if .Values.persistence.existingVolume.id }} + volumeName: {{ template "osrm-backend.fullname" . }} + {{- end }} + {{- end -}} diff --git a/charts/osrm-backend/values.yaml b/charts/osrm-backend/values.yaml index a3865a6..23467ed 100644 --- a/charts/osrm-backend/values.yaml +++ b/charts/osrm-backend/values.yaml @@ -83,6 +83,11 @@ affinity: {} persistence: enabled: false + existingVolume: + id: + driver: "nas.csi.everest.io" + type: "nfs" + provisioner: "everest-csi-provisioner" storageClassName: "" accessModes: - ReadWriteMany