File tree Expand file tree Collapse file tree 3 files changed +20
-1
lines changed
resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/kubernetes Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -194,6 +194,14 @@ from the other deployment modes. See the [configuration page](configuration.html
194194 Time to wait for the driver pod to start running before aborting its execution.
195195 </td >
196196</tr >
197+ <tr >
198+ <td ><code >spark.kubernetes.driver.service.exposeUiPort</code ></td >
199+ <td ><code >false</code ></td >
200+ <td >
201+ Whether to expose the driver Web UI port as a service NodePort. Turned off by default because NodePort is a limited
202+ resource. Use alternatives such as Ingress if possible.
203+ </td >
204+ </tr >
197205</table >
198206
199207## Current Limitations
Original file line number Diff line number Diff line change @@ -226,13 +226,15 @@ private[spark] class Client(
226226 logInfo(" Successfully submitted local resources and driver configuration to" +
227227 " driver pod." )
228228 // After submitting, adjust the service to only expose the Spark UI
229+ val uiServiceType = if (sparkConf.get(EXPOSE_KUBERNETES_DRIVER_SERVICE_UI_PORT )) " NodePort"
230+ else " ClusterIP"
229231 val uiServicePort = new ServicePortBuilder ()
230232 .withName(UI_PORT_NAME )
231233 .withPort(uiPort)
232234 .withNewTargetPort(uiPort)
233235 .build()
234236 kubernetesClient.services().withName(kubernetesAppId).edit().editSpec()
235- .withType(" ClusterIP " )
237+ .withType(uiServiceType )
236238 .withPorts(uiServicePort)
237239 .endSpec()
238240 .done()
Original file line number Diff line number Diff line change @@ -156,6 +156,15 @@ package object config {
156156 .stringConf
157157 .createOptional
158158
159+ private [spark] val EXPOSE_KUBERNETES_DRIVER_SERVICE_UI_PORT =
160+ ConfigBuilder (" spark.kubernetes.driver.service.exposeUiPort" )
161+ .doc("""
162+ | Whether to expose the driver Web UI port as a service NodePort. Turned off by default
163+ | because NodePort is a limited resource. Use alternatives such as Ingress if possible.
164+ """ .stripMargin)
165+ .booleanConf
166+ .createWithDefault(false )
167+
159168 private [spark] val KUBERNETES_DRIVER_POD_NAME =
160169 ConfigBuilder (" spark.kubernetes.driver.pod.name" )
161170 .doc("""
You can’t perform that action at this time.
0 commit comments