tdcmeehan commented on code in PR #58464:
URL: https://github.com/apache/spark/pull/58464#discussion_r3960508636
##########
resource-managers/kubernetes/core/src/main/scala/org/apache/spark/scheduler/cluster/k8s/KubernetesClusterSchedulerBackend.scala:
##########
@@ -98,6 +100,35 @@ private[spark] class KubernetesClusterSchedulerBackend(
kubernetesClient.configMaps().inNamespace(namespace).resource(configMap).create()
}
+ /**
+ * Publishes the krb5 ConfigMap name into [[KRB_CONFIG_MAP_NAME]] so
executor pods can mount it.
+ * Cluster mode already has it set by the driver step; client mode creates
or reuses it here.
+ */
+ private[k8s] def setUpExecutorKrb5ConfigMap(driverPod: Option[Pod]): Unit = {
+ // Already set by the driver feature step (cluster mode), nothing to do.
+ if (conf.getOption(KRB_CONFIG_MAP_NAME).isEmpty) {
+ conf.get(KUBERNETES_KERBEROS_KRB5_CONFIG_MAP) match {
+ case Some(existingMap) =>
+ // User supplied an existing ConfigMap, just publish its name to
executors.
+ conf.set(KRB_CONFIG_MAP_NAME, existingMap)
+ case None =>
+ conf.get(KUBERNETES_KERBEROS_KRB5_FILE).foreach { localPath =>
+ val file = new File(localPath)
+ val configMapName = KubernetesClientUtils
+ .configMapName(s"spark-krb5-${KubernetesUtils.uniqueID()}")
+ val labels =
+ Map(SPARK_APP_ID_LABEL -> applicationId(),
+ SPARK_ROLE_LABEL -> SPARK_POD_EXECUTOR_ROLE)
+ val configMap = KubernetesClientUtils.buildConfigMap(
+ configMapName, Map(file.getName ->
Files.readString(file.toPath)), labels)
Review Comment:
Store this entry under `krb5.conf`, or project the source key to that path.
The executor mount always selects `subPath("krb5.conf")`, so a supported local
file with any other basename creates a ConfigMap volume without the requested
path and the executor pod cannot start. Please also assert the projected
key/path in the local-file test.
--
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]