Skip to content

Commit

Permalink
generate ingress name independently
Browse files Browse the repository at this point in the history
  • Loading branch information
pan3793 committed Apr 29, 2024
1 parent acc4965 commit 0c2c2c0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 0c2c2c0

Please sign in to comment.