Skip to content

[SPARK-50758][K8S] Mounts the krb5 config map on the executor pod - #58464

Open
maomaodev wants to merge 1 commit into
apache:masterfrom
maomaodev:krb5-executor-mount
Open

[SPARK-50758][K8S] Mounts the krb5 config map on the executor pod#58464
maomaodev wants to merge 1 commit into
apache:masterfrom
maomaodev:krb5-executor-mount

Conversation

@maomaodev

@maomaodev maomaodev commented Sep 2, 2026

Copy link
Copy Markdown

What changes were proposed in this pull request?

In this pr, for spark on k8s, the krb5.conf config map will be mounted in executor side as well. Before, the krb5.conf config map is only mounted in driver side. But according to the parameter description (spark.kubernetes.kerberos.krb5.path and spark.kubernetes.kerberos.krb5.configMapName), the krb5.conf file should be mounted on both the driver and the executor.

This is the second attempt of #49467, which added the ability to mount the krb5.conf ConfigMap on executor pods. The first attempt only worked in cluster mode; this follow-up adds client mode compatibility. The two modes work as follows:

Mode Who creates the krb5 ConfigMap Naming
cluster KerberosConfDriverFeatureStep (driver pod) <resourceNamePrefix>-krb5-file
client KubernetesClusterSchedulerBackend.setUpExecutorKrb5ConfigMap spark-krb5-<uniqueID>-conf-map

Both paths write KRB_CONFIG_MAP_NAME into the executor SparkConf, and KerberosConfExecutorFeatureStep reads it to mount /etc/krb5.conf.

Why are the changes needed?

After SPARK-43504, the hadoop config map will be mounted on the executor pod.
Now the executor pod fails to start because the hadoop conf file contains Kerberos authentication configuration, but the executor does not mount krb5.conf correctly. See the #41181 discuss.

Does this PR introduce any user-facing change?

Yes, users do not need to take workarounds to make executors load the krb5.conf. Such as:

  • including krb5.conf in executor image
  • placing krb5.conf in executor working directory using --files

How was this patch tested?

Added UT:

  • KerberosConfExecutorFeatureStepSuite — mount / no-op / driver-step publishing.
  • KubernetesClusterSchedulerBackendSuitesetUpExecutorKrb5ConfigMap covers 4 branches (no krb5 config / cluster mode already set / user-provided ConfigMap / local file).
  • KerberosConfDriverFeatureStepSuite — updated assertions for the published system property.

Was this patch authored or co-authored using generative AI tooling?

Generated-by: DeepSeek-V4-Pro

@maomaodev

Copy link
Copy Markdown
Author

@pan3793 Could you please take a look when you have time? Thanks!

@uros-b uros-b changed the title [SPARK-50758][K8S]Mounts the krb5 config map on the executor pod [SPARK-50758][K8S] Mounts the krb5 config map on the executor pod Sep 2, 2026
@uros-b

uros-b commented Sep 2, 2026

Copy link
Copy Markdown
Member

I updated the PR title ever so slightly (space nit)

@uros-b

uros-b commented Sep 2, 2026

Copy link
Copy Markdown
Member

Change seems correct to me, but adding @pan3793 to review

@uros-b
uros-b requested a review from pan3793 September 2, 2026 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants