Repository navigation
[SPARK-40458][K8S] Bump Kubernetes Client Version to 6.1.1 - #37990
attilapiros wants to merge 8 commits into
Conversation
|
The |
| logDebug("Kubernetes client config: " + | ||
| new ObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(config)) | ||
| new DefaultKubernetesClient(factoryWithCustomDispatcher.createHttpClient(config), config) | ||
| new KubernetesClientBuilder() |
There was a problem hiding this comment.
Because of apiimpl-split:
When you rely solely on a compile dependency to the respective -api dependencies you will not be able to use DefaultKubernetesClient nor DefaultOpenShiftClient directly to create your client instances. You should instead use KubernetesClientBuilder.
| kubernetesClient | ||
| .pods | ||
| } | ||
| ops.withLabel(SPARK_ROLE_LABEL, SPARK_POD_DRIVER_ROLE) |
There was a problem hiding this comment.
Do the label based filtering as early as possible.
| .inNamespace(namespace) | ||
| .withName(updatedPod.getMetadata.getName) | ||
| .patch(inactivatedPod) | ||
| .edit(executorInactivationFn) |
There was a problem hiding this comment.
As I see the edit is preferred over the patch, see kubernetes-client-dsl-usage
| val killApp = new KillApplication | ||
| val conf = new SparkConf().set(KUBERNETES_SUBMIT_GRACE_PERIOD, 1L) | ||
| when(driverPodOperations1.withGracePeriod(1L)).thenReturn(driverPodOperations1) | ||
| doReturn(deletable).when(driverPodOperations1).withGracePeriod(1L) |
There was a problem hiding this comment.
This is a bit tricky. Because of some generic args the when()..doReturn() is not working but this doReturn()..when() does:
| <scope>test</scope> | ||
| </dependency> | ||
|
|
||
| <dependency> |
There was a problem hiding this comment.
https://github.com/fabric8io/kubernetes-client/blob/master/doc/MIGRATION-v6.md#okhttp-httpclient:
The -client dependencies still default to the OkHttp client If you are doing any customization to OkHttp clients directly, you'll need to include the kubernetes-httpclient-okhttp dependency in the compile scope - instead of the default runtime scope
commented
Sep 26, 2022
|
Although 6.1.1 is intrusive, this patch looks solid. Is there any other reason why this is still WIP, @attilapiros ? |
@dongjoon-hyun I just executed some manual tests regarding the spark-submit/application management (actually I have found a bug and corrected it). The test steps are in the description. |
commented
Sep 27, 2022
|
I would like to go through one more time to find all the places where we can specify the namespace. |
|
Thanks. Please ping me when it's ready, @attilapiros . |
| conf.get(KUBERNETES_EXECUTOR_DECOMMISSION_LABEL_VALUE).getOrElse("")) | ||
| .endMetadata() | ||
| .build()}) | ||
| .resources() |
There was a problem hiding this comment.
Adding the KUBERNETES_EXECUTOR_DECOMMISSION_LABEL_VALUE label was earlier done in two phases:
- Using
list().getItems().asScalawhich resulted into a Scala List ofPod. - Iterating over the list and getting the Pods again one by one using the name (using
withName) and namespace (usinginNamespace)
Now with the resources() and forEach the above two is merged into a single DSL expression.
commented
Sep 29, 2022
|
@dongjoon-hyun it is ready! |
left a comment
There was a problem hiding this comment.
+1, LGTM. Thank you, @attilapiros .
Merged to master for Apache Spark 3.4.0.
commented
Oct 1, 2022
|
Late LGTM. I also test it with |
What changes were proposed in this pull request?
Bump kubernetes-client version from 5.12.3 to 6.1.1 and clean up all the deprecations.
Why are the changes needed?
To keep up with kubernetes-client changes.
As this is an upgrade where the main version changed I have cleaned up all the deprecations.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Unit tests
Manual tests for submit and application management
Started an application in a non-default namespace (
bla):Check that we cannot find it in the default namespace even with glob without the namespace definition:
Then check we can find it by specifying the namespace:
Changing the namespace to
blawithkubectl:Checking we can find it without specifying the namespace (and glob):
Killing the app: