From 0c2c2c0b411dda6317ad87ca6fe8b67db0734783 Mon Sep 17 00:00:00 2001 From: Cheng Pan Date: Mon, 29 Apr 2024 17:17:33 +0800 Subject: [PATCH] generate ingress name independently --- .../spark/deploy/k8s/features/DriverIngressFeatureStep.scala | 3 ++- .../spark/deploy/k8s/features/DriverServiceFeatureStep.scala | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/DriverIngressFeatureStep.scala b/resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/DriverIngressFeatureStep.scala index 331e6e0ca4a6a..8842bfd92ebaf 100644 --- a/resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/DriverIngressFeatureStep.scala +++ b/resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/DriverIngressFeatureStep.scala @@ -30,6 +30,7 @@ import org.apache.spark.internal.config.UI._ class DriverIngressFeatureStep(kubernetesConf: KubernetesDriverConf) extends KubernetesFeatureConfigStep with Logging { + private val ingressName: String = s"${kubernetesConf.resourceNamePrefix}-ui-ingress" private lazy val driverServiceName: String = kubernetesConf.driverServiceName override def configurePod(pod: SparkPod): SparkPod = pod @@ -82,7 +83,7 @@ class DriverIngressFeatureStep(kubernetesConf: KubernetesDriverConf) val ingress = new IngressBuilder() .withNewMetadata() - .withName(s"$driverServiceName-ingress") + .withName(ingressName) .addToLabels(labels.asJava) .addToAnnotations(annotations.asJava) .endMetadata() diff --git a/resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/DriverServiceFeatureStep.scala b/resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/DriverServiceFeatureStep.scala index 7ff3c7d539bb9..9adfb2b8de491 100644 --- a/resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/DriverServiceFeatureStep.scala +++ b/resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/DriverServiceFeatureStep.scala @@ -98,5 +98,5 @@ private[spark] object DriverServiceFeatureStep { val DRIVER_BIND_ADDRESS_KEY = config.DRIVER_BIND_ADDRESS.key val DRIVER_HOST_KEY = config.DRIVER_HOST_ADDRESS.key val DRIVER_SVC_POSTFIX = "-driver-svc" - val MAX_SERVICE_NAME_LENGTH = KUBERNETES_DNS_LABEL_NAME_MAX_LENGTH - "-ingress".length + val MAX_SERVICE_NAME_LENGTH = KUBERNETES_DNS_LABEL_NAME_MAX_LENGTH }