[SPARK-38954][CORE][WIP] Cloud Credential Refresh and Distribution Without Kerberos#57285
Draft
parthchandra wants to merge 3 commits into
Draft
[SPARK-38954][CORE][WIP] Cloud Credential Refresh and Distribution Without Kerberos#57285parthchandra wants to merge 3 commits into
parthchandra wants to merge 3 commits into
Conversation
parthchandra
marked this pull request as draft
July 15, 2026 19:48
Member
|
Thank you, @parthchandra . |
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?
This PR enables Spark's existing credential distribution mechanism (driver obtains tokens, pushes them to executors, refreshes before expiry) to work without Kerberos. Today this mechanism is unconditionally gated
on Kerberos being enabled. This change adds a single configuration switch (
spark.security.credentials.directProviders.enabled) that lifts the Kerberos gate on token collection.Changes:
HadoopDelegationTokenManager.renewalEnablednow also returns true when the new config is enabled.obtainDelegationTokens(creds)andobtainTokensAndScheduleRenewal()branch on whether Kerberos credentials are present: if yes, call providers insidedoLogin()/doAs()as before; if not (but the switch ison), call providers directly. Providers that require Kerberos self-gate via
delegationTokensRequiredreturningfalse.SupportsDelegationTokengains an overridabletokenManagerRequired()hook so scheduler backends can activate the token manager based on the new config.spark.network.crypto.enabledis not true when the switch is active (prevents bearer tokens over plaintext RPC).Design document: SPIP: Cloud Credential Refresh and Distribution Without Kerberos
Why are the changes needed?
In non-Kerberos deployments (cloud, internal IdP, cross-account access on YARN), each executor independently authenticates against identity services, causing thundering-herd load amplification, inconsistent
credential state, and no centralized control over credential rotation. The existing distribution infrastructure is already provider-agnostic (Kafka proves this) — only the activation gates prevent it from running
without Kerberos.
Does this PR introduce any user-facing change?
Yes. New configuration:
spark.security.credentials.directProviders.enabledfalsedelegationTokensRequiredreturns true. Requiresspark.network.crypto.enabled=true.Existing deployments are unaffected (config defaults to false). When Kerberos IS present, all code paths are unchanged.
How was this patch tested?
New unit test suite
NonKerberosCredentialsSuite(7 tests):renewalEnabledreturns true/false based on configdelegationTokensRequired=falseare skippedspark.security.credentials.<service>.enabledspark.network.crypto.enabledis not trueExisting
HadoopDelegationTokenManagerSuite(4 tests) passes unmodified — verifies no regression in Kerberos deployments.Was this patch authored or co-authored using generative AI tooling?
Yes, Co-authored by Claude Code (opus 4.6)