diff --git a/helm/README.md b/helm/README.md index fe5c15e6fd52122d52c016bff62b8a33e2a22018..1a3428b5e601de0c6c33f9dab236321e95592c6c 100644 --- a/helm/README.md +++ b/helm/README.md @@ -9,8 +9,6 @@ helm dependencies update . helm install theodolite . ``` -Additionally, a PersistentVolumeClaim with the name `theodolite-pv-claim` needs to be created or the results volume can be disabled as done with the minimal configuration, described below. - ## Customize Installation As usual, the installation with Helm can be configured by passing a values YAML file: diff --git a/helm/preconfigs/oci.yaml b/helm/preconfigs/oci.yaml new file mode 100644 index 0000000000000000000000000000000000000000..dd070a1d7983404add85cf75ded0a057a76e854f --- /dev/null +++ b/helm/preconfigs/oci.yaml @@ -0,0 +1,4 @@ +operator: + resultsVolume: + storageClassName: "oci-bv" + size: 50Gi # minimal size in OCI \ No newline at end of file diff --git a/helm/templates/_helpers.tpl b/helm/templates/_helpers.tpl index f59f74d369b64ec89a44cbf2048fda9e844df92b..b530b553ea90671aba8154cc250a20924bae0183 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 (printf "%s-results" (include "theodolite.fullname" .)) .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..6dda16bc85d308c8bf0c9c41dd55cca3582f0793 --- /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 d50f12f8bff5856ece360582db527781f4dc9cab..52ddcd500ab8d050187028026def84e9d057c252 100644 --- a/helm/templates/theodolite/theodolite-operator.yaml +++ b/helm/templates/theodolite/theodolite-operator.yaml @@ -94,7 +94,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 53440d2f74bc423b1f5c0fd77d4add7a2af810ea..b0ce0faeaa7989872fdedc308d3d4c507894e0e7 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -264,8 +264,11 @@ operator: resultsVolume: enabled: true - persistentVolumeClaim: - name: theodolite-pv-claim + # existingClaim: + # storageClassName: + accessModes: + - ReadWriteOnce + size: 1Gi accessSidecar: enabled: true image: busybox