diff --git a/bitnami/spark/templates/_helpers.tpl b/bitnami/spark/templates/_helpers.tpl index 54ed426c0..c04c9aae5 100644 --- a/bitnami/spark/templates/_helpers.tpl +++ b/bitnami/spark/templates/_helpers.tpl @@ -99,11 +99,23 @@ imagePullSecrets: {{- end -}} {{- end -}} + +{{/* Validate values of Spark - Incorrect extra volume settings */}} +{{- define "spark.validateValues.extraVolumes" -}} +{{- if and (.Values.worker.extraVolumes) (not .Values.worker.extraVolumeMounts) -}} +spark: missing-worker-extra-volume-mounts + You specified worker extra volumes but not mount points for them. Please set + the extraVolumeMounts value +{{- end -}} +{{- end -}} + + {{/* Compile all warnings into a single message, and call fail. */}} {{- define "spark.validateValues" -}} {{- $messages := list -}} +{{- $messages := append $messages (include "spark.validateValues.extraVolumes" .) -}} {{- $messages := append $messages (include "spark.validateValues.workerCount" .) -}} {{- $messages := without $messages "" -}} {{- $message := join "\n" $messages -}} diff --git a/bitnami/spark/templates/statefulset-worker.yaml b/bitnami/spark/templates/statefulset-worker.yaml index 2215f0528..f6a2bc62a 100644 --- a/bitnami/spark/templates/statefulset-worker.yaml +++ b/bitnami/spark/templates/statefulset-worker.yaml @@ -52,6 +52,9 @@ spec: mountPath: '/opt/bitnami/spark/conf/certs' readOnly: true {{- end }} + {{- if .Values.worker.extraVolumeMounts }} + {{- tpl (toYaml .Values.worker.extraVolumeMounts) $ | nindent 12 }} + {{- end }} env: - name: SPARK_MODE value: "worker" @@ -173,3 +176,6 @@ spec: secret: secretName: {{ .Values.security.certificatesSecretName }} {{- end }} + {{- if .Values.worker.extraVolumes }} + {{- tpl (toYaml .Values.worker.extraVolumes) $ | nindent 8 }} + {{- end }} diff --git a/bitnami/spark/values.yaml b/bitnami/spark/values.yaml index 9c5edbc12..e5a3c578c 100644 --- a/bitnami/spark/values.yaml +++ b/bitnami/spark/values.yaml @@ -233,6 +233,14 @@ worker: ## Max number of workers when using autoscaling replicasMax: 5 + ## Array to add extra volumes + ## + ## extraVolumes: + + ## Array to add extra mounts (normally used with extraVolumes) + ## + ## extraVolumeMounts: {} + ## Security configuration ## security: