added abitlity to mount extra volumes in spark workers

This commit is contained in:
cccs-jc
2019-12-08 08:11:13 -05:00
parent 61f97669c4
commit 05dda9a312
3 changed files with 26 additions and 0 deletions
+12
View File
@@ -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 -}}
@@ -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 }}
+8
View File
@@ -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: