pan3793 commented on code in PR #3852:
URL: https://github.com/apache/incubator-kyuubi/pull/3852#discussion_r1032930862
##########
kyuubi-server/src/main/scala/org/apache/kyuubi/engine/spark/SparkProcessBuilder.scala:
##########
@@ -53,8 +54,34 @@ class SparkProcessBuilder(
Paths.get(sparkHome, "bin", SPARK_SUBMIT_FILE).toFile.getCanonicalPath
}
+ completeMasterUrl()
+
override def mainClass: String =
"org.apache.kyuubi.engine.spark.SparkSQLEngine"
+ /**
+ * Add `spark.master` if KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT
+ * are defined. So we can deploy spark on kubernetes without setting
`spark.master`
+ * explicitly when kyuubi-servers are on kubernetes, which also helps in
case that
+ * api-server is not exposed to us.
+ */
+ protected def completeMasterUrl(): Unit = {
+ try {
+ val kubernetesServiceHost = sys.env.get(KUBERNETES_SERVICE_HOST)
+ val kubernetesServicePort = sys.env.get(KUBERNETES_SERVICE_PORT)
+ if (conf.getOption(MASTER_KEY).isEmpty
Review Comment:
I think `clusterManager()` should be called instead
--
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]