-
Notifications
You must be signed in to change notification settings - Fork 47
[SPARK-52997] Fixes wrong worker assignment if multiple clusters are deployed to the same namespace #291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-52997] Fixes wrong worker assignment if multiple clusters are deployed to the same namespace #291
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,7 +21,7 @@ | |
|
|
||
| import static org.apache.spark.k8s.operator.Constants.*; | ||
|
|
||
| import java.util.Collections; | ||
| import java.util.Map; | ||
| import java.util.Optional; | ||
|
|
||
| import scala.Tuple2; | ||
|
|
@@ -117,8 +117,13 @@ private static Service buildMasterService( | |
| .endMetadata() | ||
| .withNewSpecLike(serviceSpec) | ||
| .withClusterIP("None") | ||
| .withClusterIP("None") | ||
| .withSelector( | ||
| Collections.singletonMap(LABEL_SPARK_ROLE_NAME, LABEL_SPARK_ROLE_MASTER_VALUE)) | ||
| Map.of( | ||
|
||
| LABEL_SPARK_CLUSTER_NAME, | ||
| name, | ||
| LABEL_SPARK_ROLE_NAME, | ||
| LABEL_SPARK_ROLE_MASTER_VALUE)) | ||
| .addNewPort() | ||
| .withName("web") | ||
| .withPort(8080) | ||
|
|
@@ -150,7 +155,11 @@ private static Service buildWorkerService( | |
| .withNewSpecLike(serviceSpec) | ||
| .withClusterIP("None") | ||
| .withSelector( | ||
| Collections.singletonMap(LABEL_SPARK_ROLE_NAME, LABEL_SPARK_ROLE_WORKER_VALUE)) | ||
| Map.of( | ||
| LABEL_SPARK_CLUSTER_NAME, | ||
| name, | ||
| LABEL_SPARK_ROLE_NAME, | ||
| LABEL_SPARK_ROLE_WORKER_VALUE)) | ||
| .addNewPort() | ||
| .withName("web") | ||
| .withPort(8081) | ||
|
|
@@ -186,6 +195,7 @@ private static StatefulSet buildMasterStatefulSet( | |
| .editOrNewTemplate() | ||
| .editOrNewMetadata() | ||
| .addToLabels(LABEL_SPARK_ROLE_NAME, LABEL_SPARK_ROLE_MASTER_VALUE) | ||
| .addToLabels(LABEL_SPARK_CLUSTER_NAME, name) | ||
| .addToLabels(LABEL_SPARK_VERSION_NAME, version) | ||
| .endMetadata() | ||
| .editOrNewSpec() | ||
|
|
@@ -253,6 +263,7 @@ private static StatefulSet buildWorkerStatefulSet( | |
| .editOrNewTemplate() | ||
| .editOrNewMetadata() | ||
| .addToLabels(LABEL_SPARK_ROLE_NAME, LABEL_SPARK_ROLE_WORKER_VALUE) | ||
| .addToLabels(LABEL_SPARK_CLUSTER_NAME, name) | ||
| .addToLabels(LABEL_SPARK_VERSION_NAME, version) | ||
| .endMetadata() | ||
| .editOrNewSpec() | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.