{{ message }}
[SPARK-59518][K8S] Fall back to the driver service account when the executor one is empty - #58807
Open
anshulbaliga7 wants to merge 1 commit into
Open
anshulbaliga7 wants to merge 1 commit into
anshulbaliga7 wants to merge 1 commit into
Conversation
…xecutor one is empty
anshulbaliga7
force-pushed
the
SPARK-59518-empty-executor-service-account
branch
from
September 15, 2026 06:50
936a169 to
968333d
Compare
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What changes were proposed in this pull request?
ExecutorKubernetesCredentialsFeatureStepnow treats an explicitly emptyspark.kubernetes.authenticate.executor.serviceAccountNameas unset. The optional config is filtered with.filter(_.nonEmpty)before the fallback runs, so an empty executor account falls back to the driver account, as documented. With no driver account configured either, the executor pod spec is left untouched instead of receiving"".The config description in
docs/running-on-kubernetes.mdis updated to say "not set or is empty". The change is confined to the executor config read so it stays independent of #58343 (SPARK-58910), which reworks the pod-template check in the same step.Why are the changes needed?
The executor service account config is
createOptional, so setting it to an empty string yieldsSome("").executorServiceAccount.orElse(driverServiceAccount)then never falls back, andbuildPodWithServiceAccountwrites an emptyserviceAccount/serviceAccountNameinto the executor pod. That contradicts the documented behavior ("if this parameter is not setup, the fallback logic will use the driver's service account") and produces a pod that names no usable account. An empty value is easy to hit from templating or--conf key=in submission scripts.Does this PR introduce any user-facing change?
Yes, a bug fix. Before,
--conf spark.kubernetes.authenticate.executor.serviceAccountName=with a driver account configured wroteserviceAccountName: ""to executor pods. Now such executors use the driver's service account, matching the behavior when the config is absent. Non-emptyvalues behave exactly as before.
How was this patch tested?
Two new tests in
ExecutorKubernetesCredentialsFeatureStepSuite:serviceAccount/serviceAccountNamenull.
All 5 tests pass (3 existing, 2 new).
Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Fable 5.1)