HwangDongJun commented on code in PR #58187:
URL: https://github.com/apache/spark/pull/58187#discussion_r4345266864


##########
resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/submit/KubernetesClientApplication.scala:
##########
@@ -135,6 +136,21 @@ private[spark] class Client(
       .build()
     val driverPodName = resolvedDriverPod.getMetadata.getName
 
+    // The API server rejects a pod that has both spec.nodeName and scheduling 
gates, and a pod
+    // with spec.nodeName skips the scheduler anyway, so only pods the 
scheduler places are gated.
+    val gateDriverPod = conf.get(USE_DRIVER_SCHEDULING_GATE) &&

Review Comment:
   Thank you for the example. I added this case to the docs next to the 
YuniKorn note in `docs/running-on-kubernetes.md`: a cluster whose admission 
webhooks set `spec.nodeName` on every new pod rejects the gated driver pod, 
`patch` does not help, and the way out is to leave 
`spark.kubernetes.submission.useDriverSchedulingGate` at `false` or to set 
`spec.nodeName` in the driver pod template. A comment above `gateDriverPod` in 
`Client.run()` now says the check cannot see a `nodeName` that a webhook sets 
later. With the default discussed at `Config.scala` below, this case no longer 
hits a default submission.
   
   I checked the API behavior on a Kubernetes v1.32 server with a server-side 
dry run: a pod with both `spec.nodeName` and `spec.schedulingGates` is rejected 
with `spec.nodeName: Forbidden: cannot be set until all schedulingGates have 
been cleared`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to