Skip to content

Commit 80934a8

Browse files
committed
[SPARK-49395] Add 8081 port to Worker resource spec
### What changes were proposed in this pull request? This PR aims to add `8081` port to Worker resource spec. ### Why are the changes needed? Like `Master`'s `8080` port, we can expose it for users. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Manual review. ``` $ gradle build buildDockerImage spark-operator-api:relocateGeneratedCRD -x check $ helm install spark-kubernetes-operator -f build-tools/helm/spark-kubernetes-operator/values.yaml build-tools/helm/spark-kubernetes-operator/ $ kubectl apply -f examples/qa-cluster-with-one-worker.yaml $ kubectl get pod -l spark-role=worker -oyaml | yq '.items[0].spec.containers[0].ports' - containerPort: 8081 name: web protocol: TCP ``` ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#105 from dongjoon-hyun/SPARK-49395. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
1 parent 4364afd commit 80934a8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

spark-submission-worker/src/main/java/org/apache/spark/k8s/operator/SparkClusterResourceSpec.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,10 @@ private static StatefulSet buildWorkerStatefulSet(
261261
+ name
262262
+ "-master-svc:7077 && while /opt/spark/sbin/spark-daemon.sh status "
263263
+ "org.apache.spark.deploy.worker.Worker 1; do sleep 1; done")
264+
.addNewPort()
265+
.withName("web")
266+
.withContainerPort(8081)
267+
.endPort()
264268
.endContainer()
265269
.endSpec()
266270
.endTemplate()

0 commit comments

Comments
 (0)