[SPARK-56845] [K8S] Truncate ConfigMap names that exceed DNS subdomain limit#55862
Open
shivadarshan-devadiga wants to merge 2 commits into
Open
[SPARK-56845] [K8S] Truncate ConfigMap names that exceed DNS subdomain limit#55862shivadarshan-devadiga wants to merge 2 commits into
shivadarshan-devadiga wants to merge 2 commits into
Conversation
Author
|
@LuciferYang Can you please check |
Contributor
|
also cc @dongjoon-hyun |
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 fixes SPARK-56845 by adding a new configMapName(prefix, suffix) overload to KubernetesClientUtils that automatically handles ConfigMap names exceeding Kubernetes' 253-character DNS subdomain limit.
Why are the changes needed?
When spark.app.name is very long (>222 characters), the derived resourceNamePrefix combined with fixed suffixes (-hadoop-config, -krb5-file, -driver-podspec-conf-map) exceeds Kubernetes' DNS subdomain name limit of 253 characters. This causes driver submission to fail with the error: "must be no more than 253 characters".
The existing KubernetesClientUtils.configMapName(prefix) helper had truncation logic but was hardcoded to the -conf-map suffix and unused by these three call sites. This PR generalizes the solution to work with any suffix and migrates all three problematic call sites to use it.
Why fallback instead of truncation:
Does this PR introduce any user-facing change?
Yes, but only for edge cases with very long application names:
Previous behavior:
New behavior:
How was this patch tested?
Unit tests added in KubernetesClientUtilsSuite.scala:
Test execution:
Ran the full Kubernetes test suite:
Result: 348 tests passed, 0 failed (including the 4 new SPARK-56845 tests)
Test coverage:
Was this patch authored or co-authored using generative AI tooling?
Test cases and documentation authored by: Claude
cc @TongWei1105 @LuciferYang @dongjoon-hyun