ScrapCodes commented on a change in pull request #27520: [SPARK-30771][K8S]
Avoid failed mount warning from kubernetes and support the optional mount.
URL: https://github.com/apache/spark/pull/27520#discussion_r378091309
##########
File path:
resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/submit/KubernetesClientApplication.scala
##########
@@ -127,15 +127,18 @@ private[spark] class Client(
.pods()
.withName(driverPodName)
.watch(watcher)) { _ =>
- val createdDriverPod = kubernetesClient.pods().create(resolvedDriverPod)
+ var createdDriverPod: Option[Pod] = None
try {
val otherKubernetesResources =
resolvedDriverSpec.driverKubernetesResources ++ Seq(configMap)
- addDriverOwnerReference(createdDriverPod, otherKubernetesResources)
kubernetesClient.resourceList(otherKubernetesResources:
_*).createOrReplace()
+ createdDriverPod =
Some(kubernetesClient.pods().create(resolvedDriverPod))
+ addDriverOwnerReference(createdDriverPod.get, otherKubernetesResources)
Review comment:
One way to avoid that risk is to have a
[job](https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/)
and let the job own all the resources including the pod. What do you think?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]