Feature: Support resource reservation - #4323
Conversation
|
/assign @Monokaix |
…group to the scheduling API group.
Signed-off-by: leggasai <jyc132780208@sina.com>
|
@LegGasai: PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Signed-off-by: leggasai <jyc132780208@sina.com>
|
Adding label DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Signed-off-by: leggasai <jyc132780208@sina.com>
There was a problem hiding this comment.
Pull request overview
This PR implements resource reservation functionality in the Volcano scheduler, enabling users to pre-reserve cluster resources for later use by specific workloads.
Key Changes:
- Adds reservation plugin and action to handle resource reservation lifecycle
- Implements reservation cache for tracking and managing reservations
- Introduces
reserveaction betweenenqueueandallocatein the scheduling pipeline - Adds new Reservation CRD and RBAC permissions
Reviewed changes
Copilot reviewed 46 out of 51 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pkg/scheduler/plugins/reservation/reservation.go | New reservation plugin implementing validation, node selection, and bind lifecycle hooks |
| pkg/scheduler/actions/reserve/reserve.go | New reserve action to swap reservation tasks with actual workload tasks |
| pkg/scheduler/cache/reservation_cache.go | Cache management for reservations including TTL expiration and status synchronization |
| pkg/scheduler/framework/statement.go | Added UnAllocateForReservationTask to support reservation resource handover |
| pkg/scheduler/framework/session.go | Helper functions for matching and validating reservations against jobs |
| pkg/scheduler/cache/interface.go | Extended cache interface with PostBinder and reservation methods |
| installer/volcano-development.yaml | CRD definitions and RBAC for the Reservation resource |
| config files | Configuration updates to enable the reservation plugin and action |
Comments suppressed due to low confidence (5)
pkg/scheduler/plugins/reservation/reservation.go:1
- Corrected spelling of 'aruguments' to 'arguments'.
pkg/scheduler/framework/session.go:1 - Empty line 1235 should be removed to improve code readability. The empty line between the condition check and return statement is unnecessary.
pkg/scheduler/cache/util.go:1 - The function name 'tolerationKey' is inconsistent with its internal usage where it's referenced as 'generateTolerationKey' in the comment on line 156. Consider renaming to 'generateTolerationKey' to match the documentation.
pkg/scheduler/cache/event_handlers.go:1 - The variable name changed from 'podgroup' (line 849) to 'podgroup' (line 854 in original) but the pattern is inconsistent with line 928 where it uses 'PodGroup' in the struct literal. Consider using consistent naming throughout.
pkg/scheduler/cache/reservation_cache.go:1 - Grammatical error in message text. 'have be allocated' should be 'have been allocated'.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| //volcano.sh/apis v1.12.3-0.20250922071132-1aeba4dd588f | ||
| volcano.sh/apis v0.0.0 |
There was a problem hiding this comment.
Using version v0.0.0 is not a standard practice for Go module dependencies. This appears to be a placeholder that should be replaced with an actual version before merging.
| //volcano.sh/apis v1.12.3-0.20250922071132-1aeba4dd588f | |
| volcano.sh/apis v0.0.0 | |
| volcano.sh/apis v1.12.3-0.20250922071132-1aeba4dd588f |
Signed-off-by: leggasai <jyc132780208@sina.com>
Signed-off-by: leggasai <jyc132780208@sina.com>
|
/cc |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Support resource reservation.
Phase 1: Resource Reservation
The reservation task goes through the complete scheduling logic but does not perform an actual pod bind. Instead, it reserves resources on the target node, updates the
reservation cache, and modifies theReservation custom resource (CR)status.Phase 2: Reservation Scheduling
Tasks that use the reserved resources require special handling during allocate action — they are directly bound to the reserved node. Additionally, the
reservation cacheand theReservation CR statusare updated accordingly.Design docs: #4148
Test/User docs:https://c05j6bovqhh.feishu.cn/docx/EDHLdozMTohoBoxIqWtcwwaqnMf
Related PR:
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
There are some issues to optimize:
Due to the addition of new CRDs, keeping the descriptions would cause the YAML file to exceed the size limit. Therefore, the following is used:
$(CONTROLLER_GEN) $(CRD_OPTIONS_EXCLUDE_DESCRIPTION)Does this PR introduce a user-facing change?