[SPARK-51250][K8S] Add Support for K8s PriorityClass Configuration fo… #49998
+102
−2
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?
spark.kubernetes.priorityclass.name
.PriorityClassFeatureStep
that passes configured priority class name to driver and executor pods.PriorityClassFeatureStep.scala
Why are the changes needed?
Currently when running spark on k8s, with spark-submit approach, in order to specify priority class name, the only possible way is to specify in the pod template. In a cluster with numerous priority classes, it means multiple pod template files are to be used, each of which has variant priority class name only.
One could dynamically generate the pod templates based on priority classes, however this introduces additional overhead on user side (e.g. building a process to dynamically generate templates just for priority class name, making sure dynamically generated templates are still valid)
Furthermore, for SPARK on YARN there is a configuration
spark.yarn.priority
that is flexible and easy to use for users. It is good to achieve the similar level of simplicity for users moving from SPARK on YARN to SPARK on K8s.Does this PR introduce any user-facing change?
Yes. With this PR, users can use
spark.kubernetes.priorityclass.name
to specify the priority class name for driver and executor pods.How was this patch tested?
Tests were added in this pull request
Was this patch authored or co-authored using generative AI tooling?
No