Skip to content

Commit 6dc6032

Browse files
jonaseck2k8s-ci-robot
authored andcommitted
Switched to environment variable arguments (helm#3118)
* Switched to environment variable arguments Environment variables are evaluated before command-line arguments causing parsing of SPARK_MASTER_PORT to crash if left to the default value set by kubernetes. * Fixed lint errors: missing starting space in comment
1 parent a5852ff commit 6dc6032

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

stable/spark/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: spark
2-
version: 0.1.4
2+
version: 0.1.5
33
description: Fast and general-purpose cluster computing system.
44
home: http://spark.apache.org
55
icon: http://spark.apache.org/images/spark-logo-trademark.png

stable/spark/templates/spark-master-deployment.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ spec:
5959
- name: {{ template "master-fullname" . }}
6060
image: "{{ .Values.Master.Image }}:{{ .Values.Master.ImageTag }}"
6161
command: ["/bin/sh","-c"]
62-
args: ["echo $(hostname -i) {{ template "master-fullname" . }} >> /etc/hosts; /opt/spark/bin/spark-class org.apache.spark.deploy.master.Master --ip {{ template "master-fullname" . }} --port {{ .Values.Master.ServicePort }} --webui-port {{ .Values.WebUi.ContainerPort }}"]
62+
args: ["echo $(hostname -i) {{ template "master-fullname" . }} >> /etc/hosts; /opt/spark/bin/spark-class org.apache.spark.deploy.master.Master"]
6363
ports:
6464
- containerPort: {{ .Values.Master.ContainerPort }}
6565
- containerPort: {{ .Values.WebUi.ContainerPort }}
@@ -70,3 +70,9 @@ spec:
7070
env:
7171
- name: SPARK_DAEMON_MEMORY
7272
value: {{ default "1g" .Values.Master.DaemonMemory | quote }}
73+
- name: SPARK_MASTER_HOST
74+
value: {{ template "master-fullname" . }}
75+
- name: SPARK_MASTER_PORT
76+
value: {{ .Values.Master.ServicePort | quote }}
77+
- name: SPARK_MASTER_WEBUI_PORT
78+
value: {{ .Values.WebUi.ContainerPort | quote }}

stable/spark/templates/spark-worker-deployment.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ spec:
2525
containers:
2626
- name: {{ template "worker-fullname" . }}
2727
image: "{{ .Values.Worker.Image }}:{{ .Values.Worker.ImageTag }}"
28-
command: ["/opt/spark/bin/spark-class", "org.apache.spark.deploy.worker.Worker", "spark://{{ template "master-fullname" . }}:{{ .Values.Master.ServicePort }}", "--webui-port", "{{ .Values.Worker.ContainerPort }}"]
28+
command: ["/opt/spark/bin/spark-class", "org.apache.spark.deploy.worker.Worker", "spark://{{ template "master-fullname" . }}:{{ .Values.Master.ServicePort }}"]
2929
ports:
3030
- containerPort: {{ .Values.Worker.ContainerPort }}
3131
resources:
@@ -37,3 +37,5 @@ spec:
3737
value: {{ default "1g" .Values.Worker.DaemonMemory | quote }}
3838
- name: SPARK_WORKER_MEMORY
3939
value: {{ default "1g" .Values.Worker.ExecutorMemory | quote }}
40+
- name: SPARK_WORKER_WEBUI_PORT
41+
value: {{ .Values.WebUi.ContainerPort | quote }}

stable/spark/values.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Master:
1414
ServicePort: 7077
1515
ContainerPort: 7077
1616
# Set Master JVM memory. Default 1g
17-
#DaemonMemory: 1g
17+
# DaemonMemory: 1g
1818

1919
WebUi:
2020
Name: webui
@@ -31,9 +31,9 @@ Worker:
3131
Memory: "512Mi"
3232
ContainerPort: 8081
3333
# Set Worker JVM memory. Default 1g
34-
#DaemonMemory: 1g
34+
# DaemonMemory: 1g
3535
# Set how much total memory workers have to give executors
36-
#ExecutorMemory: 1g
36+
# ExecutorMemory: 1g
3737

3838
Zeppelin:
3939
Name: zeppelin

0 commit comments

Comments
 (0)