Repository navigation
feat: support physical CPU request and limit in SparkConnect CRD - #3096
google-oss-prow[bot] merged 44 commits into
Conversation
|
🎉 Welcome to the Kubeflow Spark Operator! 🎉 Thanks for opening your first PR! We're happy to have you as part of our community 🚀 Here's what happens next:
Join the community:
Feel free to ask questions in the comments if you need any help or clarification! |
048a2d8 to
d333ed0
Compare
|
Hi @tariq-hasan, I’ve implemented the upstream SparkConnect CRD support for #2957 and opened this PR. The changes add Since you pointed me to the upstream issue, I’d appreciate your review when you have a chance. Thanks! |
tariq-hasan
left a comment
There was a problem hiding this comment.
Hi @DUKartik! Thank you for raising the PR. I have added some review comments.
|
/ok-to-test |
a993c30 to
598aa4a
Compare
|
Thanks @tariq-hassan for pointing this out. I updated the implementation based on your feedback:
The focused SparkConnect/webhook tests, |
9cf5780 to
560847e
Compare
Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>
Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>
Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>
Apply server.coreRequest and server.coreLimit directly to the Kubernetes CPU resources of the operator-created SparkConnect server pod.
Remove the incorrect driver Spark configuration mappings while keeping executor CPU configuration through spark.kubernetes.executor.{request,limit}.cores.
Add reconciler tests covering CPU resources and template behavior.
Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>
Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>
560847e to
d3f4fdc
Compare
Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>
245fc2e to
7d19343
Compare
Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>
tariq-hasan
left a comment
There was a problem hiding this comment.
Hi @DUKartik! I have added a few comments.
|
@DUKartik are you able to address the review comments on this one |
- Use resource.Quantity directly for SparkConnect CPU resources. - Update CPU validation and controller logic for resource.Quantity. - Update documentation for CPU resource specifications and pod lifecycle behavior. - Update unit and e2e tests for the new CPU resource handling. - Regenerate API artifacts and CRDs. Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>
Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>
|
/retest |
|
Hi @tariq-hasan, Sorry for the extra notification, and thanks again for your guidance! |
|
/ok-to-test |
1 similar comment
|
/ok-to-test |
|
If you rebase the PR on master I think it should help trigger the CI. One of the tests is failing currently. |
|
Thanks @tariq-hasan! I looked into the CI failure a bit further. Thanks again for your guidance!
|
|
@DUKartik this is a known issue best is to execute a |
|
/retest |
|
@DUKartik seems like |
|
/retest |
|
Thanks a lot, @vikas-saxena02, for your help! |
|
Thanks @tariq-hasan! The latest merge commit retriggered CI, and all checks have now passed. |
|
Thanks for the contribution! |
|
Hi @nabuskey , |
Signed-off-by: Kartik Nath Khatri <masterbro770@gmail.com>
|
Hi @nabuskey , |
nabuskey
left a comment
There was a problem hiding this comment.
/approve
Thank you very much!
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: nabuskey The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |

Purpose of this PR
This PR adds support for configuring physical Kubernetes CPU requests and limits for SparkConnect through the
SparkConnectCRD.Currently, SparkConnect exposes the
coresfield, which configures Spark driver/executor cores. However,coresdoes not provide independent control over the physical Kubernetes CPU request and limit for the corresponding pods.Proposed changes:
coreRequestandcoreLimitfields toSparkPodSpecfor SparkConnect server and executor pods.coreRequestandcoreLimitto the corresponding Spark Kubernetes CPU request/limit configuration for the driver and executors.Example
The new fields are independent of
cores:cores→spark.driver.cores/spark.executor.corescoreRequest→ physical Kubernetes CPU requestcoreLimit→ physical Kubernetes CPU limitChange Category
Rationale
SparkConnect currently does not expose physical Kubernetes CPU request/limit configuration through its CRD.
This change provides independent control over Spark's core configuration and the Kubernetes CPU resources assigned to SparkConnect driver and executor pods, while preserving the existing behavior of the
coresfield.The new fields are optional, so existing SparkConnect resources remain backward compatible.
Checklist
Additional Notes
The implementation maps the new fields as follows:
server.coreRequest→spark.kubernetes.driver.request.coresserver.coreLimit→spark.kubernetes.driver.limit.coresexecutor.coreRequest→spark.kubernetes.executor.request.coresexecutor.coreLimit→spark.kubernetes.executor.limit.coresCPU quantity validation follows the repository's existing Kubernetes quantity validation conventions.
Generated API artifacts were regenerated and verified, including the CRD, OpenAPI/Swagger specification, and Python API models.
The SparkConnect example was updated to document usage of
coreRequestandcoreLimit.Relevant SparkConnect controller and webhook tests pass locally,
go vetpasses, CRD drift checks pass, generated artifacts are up to date, andgit diff --checkpasses.Closes #2957