You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/06/14 22:21:35 UTC

[GitHub] [spark] dongjoon-hyun commented on a change in pull request #32874: [SPARK-35699][K8S] Improve error message when creating k8s pod failed.

dongjoon-hyun commented on a change in pull request #32874:
URL: https://github.com/apache/spark/pull/32874#discussion_r651316233



##########
File path: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/submit/KubernetesClientApplication.scala
##########
@@ -136,7 +136,15 @@ private[spark] class Client(
     val driverPodName = resolvedDriverPod.getMetadata.getName
 
     var watch: Watch = null
-    val createdDriverPod = kubernetesClient.pods().create(resolvedDriverPod)
+    var createdDriverPod: Pod = null
+    try {
+      createdDriverPod = kubernetesClient.pods().create(resolvedDriverPod)
+    } catch {
+      case NonFatal(e) =>
+        logError("Fail to create driver pod, you may use wrong master URL or permission denied." +
+          "please check the network connection and permission.")

Review comment:
       Since we have enough information about the error itself, can we improve the directional information more? For example, we can ask the users to check `kubectl auth can-i create pod` first. It should be `yes`.
   ```
   Exception in thread "main" io.fabric8.kubernetes.client.KubernetesClientException: Operation: [create] for kind: [Pod] with name: [null] in namespace: [default] failed.
   ```




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org