-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-27258][K8S]Deal with the k8s resource names that don't match their own regular expression #24219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-27258][K8S]Deal with the k8s resource names that don't match their own regular expression #24219
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,14 +39,16 @@ private[spark] class DriverServiceFeatureStep( | |
| "managed via a Kubernetes service.") | ||
|
|
||
| private val preferredServiceName = s"${kubernetesConf.resourceNamePrefix}$DRIVER_SVC_POSTFIX" | ||
| private val resolvedServiceName = if (preferredServiceName.length <= MAX_SERVICE_NAME_LENGTH) { | ||
| private val resolvedServiceName = if (preferredServiceName.length <= MAX_SERVICE_NAME_LENGTH | ||
| && Character.isLetter(preferredServiceName.charAt(0))) { | ||
| preferredServiceName | ||
| } else { | ||
| val randomServiceId = KubernetesUtils.uniqueID(clock = 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.") | ||
| s"too long (must be <= $MAX_SERVICE_NAME_LENGTH characters) " + | ||
| s"or the first character of $preferredServiceName is not letter which is not support." + | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. support -> supported.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK! But there are some conflicts at present.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @srowen Hi, i have a question that is how to deal with the prefix of user-defined pod. It handles the default prefix of podName in this PR . override val resourceNamePrefix: String = {
get(KUBERNETES_EXECUTOR_POD_NAME_PREFIX).getOrElse(
KubernetesConf.getResourceNamePrefix(appName))
}
private val driverPodName = conf
.get(KUBERNETES_DRIVER_POD_NAME)
.getOrElse(s"${conf.resourceNamePrefix}-driver")
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That I don't know ... @skonto? |
||
| s" Falling back to use $shorterServiceName as the driver service's name.") | ||
| shorterServiceName | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.