diff --git a/helm/templates/_helpers.tpl b/helm/templates/_helpers.tpl index f59f74d369b64ec89a44cbf2048fda9e844df92b..4aebdca5d2b0370cf93208a82d3c737e39bdd93c 100644 --- a/helm/templates/_helpers.tpl +++ b/helm/templates/_helpers.tpl @@ -60,3 +60,10 @@ Create the name of the service account to use {{- default "default" .Values.serviceAccount.name }} {{- end }} {{- end }} + +{{/* +Create the name of the results volume to use +*/}} +{{- define "theodolite.resultsClaimName" -}} +{{- default (include "theodolite.fullname" .)-results .Values.operator.resultsVolume.existingClaim }} +{{- end }} diff --git a/helm/templates/theodolite/results-volume/pvc.yaml b/helm/templates/theodolite/results-volume/pvc.yaml new file mode 100644 index 0000000000000000000000000000000000000000..3f234080377b420c10d695e7e60edafbae609393 --- /dev/null +++ b/helm/templates/theodolite/results-volume/pvc.yaml @@ -0,0 +1,18 @@ +{{- if and .Values.operator.resultsVolume.enabled (not .Values.operator.resultsVolume.existingClaim)) -}} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "theodolite.resultsClaimName" . }} +spec: + {{- if .Values.operator.resultsVolume.storageClassName }} + storageClassName: {{ .Values.operator.resultsVolume.storageClassName }} + {{- end }} + accessModes: + - ReadWriteOnce + {{- range .Values.operator.resultsVolume.accessModes }} + - {{ . | quote }} + {{- end }} + resources: + requests: + storage: {{ .Values.operator.resultsVolume.size | quote }} +{{- end }} \ No newline at end of file diff --git a/helm/templates/theodolite/theodolite-operator.yaml b/helm/templates/theodolite/theodolite-operator.yaml index 3487b9a4fabb16897b302d8be65f065a647ffb16..6e30eb57f4471407263e58a56342a43c83fe32e2 100644 --- a/helm/templates/theodolite/theodolite-operator.yaml +++ b/helm/templates/theodolite/theodolite-operator.yaml @@ -81,7 +81,7 @@ spec: {{- if .Values.operator.resultsVolume.enabled }} - name: theodolite-pv-storage persistentVolumeClaim: - claimName: {{ .Values.operator.resultsVolume.persistentVolumeClaim.name | quote }} + claimName: {{ include "theodolite.resultsClaimName" . | quote }} {{- end }} - name: benchmark-resources-uc1-kstreams configMap: diff --git a/helm/values.yaml b/helm/values.yaml index 571cdd629c382a88ca8d4b22234d2d0907fa5fae..95ec9babd057c954cc326bcf78bad171498dd31c 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -259,8 +259,11 @@ operator: resultsVolume: enabled: true - persistentVolumeClaim: - name: theodolite-pv-claim + # existingClaim: + # storageClassName: + accessModes: + - ReadWriteOnce + size: 1Gi accessSidecar: enabled: true image: busybox