xuefeimiaoao commented on code in PR #3852:
URL: https://github.com/apache/incubator-kyuubi/pull/3852#discussion_r1032741425
##########
kyuubi-server/src/main/scala/org/apache/kyuubi/engine/spark/SparkProcessBuilder.scala:
##########
@@ -53,8 +55,30 @@ class SparkProcessBuilder(
Paths.get(sparkHome, "bin", SPARK_SUBMIT_FILE).toFile.getCanonicalPath
}
+ initialize
+
override def mainClass: String =
"org.apache.kyuubi.engine.spark.SparkSQLEngine"
+ /**
+ * Add or override spark.master if KUBERNETES_SERVICE_HOST and
+ * KUBERNETES_SERVICE_PORT are defined
+ */
+ protected def initialize(): Unit = {
+ try {
+ if (conf.get(KUBERNETES_MASTER_OVERRIDE)) {
+ val kubernetesServiceHost = sys.env.get(KUBERNETES_SERVICE_HOST)
+ val kubernetesServicePort = sys.env.get(KUBERNETES_SERVICE_PORT)
+ if (kubernetesServiceHost.isDefined &&
kubernetesServicePort.isDefined) {
+ val masterURL =
s"k8s://https://${kubernetesServiceHost.get}:${kubernetesServicePort.get}"
Review Comment:
If user want to use http, he could set `spark.master` explicitly, which we
will respect and will not be overridden after changing of my code.
--
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]