dongjoon-hyun commented on code in PR #46184:
URL: https://github.com/apache/spark/pull/46184#discussion_r1576861859
##########
resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/KubernetesConf.scala:
##########
@@ -94,6 +96,20 @@ private[spark] class KubernetesDriverConf(
custom.getOrElse(KubernetesConf.getResourceNamePrefix(appName))
}
+ val driverServiceName: String = {
+ val preferredServiceName = s"$resourceNamePrefix$DRIVER_SVC_POSTFIX"
+ if (preferredServiceName.length <= MAX_SERVICE_NAME_LENGTH) {
+ preferredServiceName
+ } else {
+ val randomServiceId = KubernetesUtils.uniqueID(clock)
+ val shorterServiceName = s"spark-$randomServiceId$DRIVER_SVC_POSTFIX"
+ logWarning(s"Driver's hostname would preferably be
$preferredServiceName, but this is " +
+ s"too long (must be <= $MAX_SERVICE_NAME_LENGTH characters). Falling
back to use " +
+ s"$shorterServiceName as the driver service's name.")
+ shorterServiceName
+ }
+ }
Review Comment:
Could you make a new PR for this moving `driverServiceName` from
`DriverServiceFeatureStep` to `KubernetesDriverConf`?
--
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]