-
Notifications
You must be signed in to change notification settings - Fork 756
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adaptive schedule strategy for UnitedDeployment #1720
base: master
Are you sure you want to change the base?
Conversation
[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.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
ea7f490
to
e9fd8d4
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1720 +/- ##
==========================================
+ Coverage 47.91% 49.10% +1.19%
==========================================
Files 162 192 +30
Lines 23491 19704 -3787
==========================================
- Hits 11256 9676 -1580
+ Misses 11014 8766 -2248
- Partials 1221 1262 +41
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
e58f279
to
1cc7c87
Compare
75b4117
to
c462401
Compare
c462401
to
68e8262
Compare
48f50fd
to
9cb391b
Compare
dab6f1e
to
cba277a
Compare
1. adapter.go: GetReplicaDetails returns pods in the subset 2. xxx_adapter.go: return pods implementation ⬆️ 3. allocator.go: about safeReplica 4. pod_condition_utils.go: extract PodUnscheduledTimeout function from workloadwpread 5. reschedule.go: PodUnscheduledTimeout function extracted 6. subset.go: add some field to Subset object to carry related information 7. subset_control.go: store subset pods to Subset object 8. uniteddeployment_controller.go 1. add requeue feature to check failed pods 2. subset unschedulable status management 9. uniteddeployment_types.go: API change 10. uniteddeployment_update.go: sync unschedulable to CR Signed-off-by: AiRanthem <[email protected]>
cba277a
to
a50e39e
Compare
@@ -252,6 +322,10 @@ type UnitedDeploymentStatus struct { | |||
// +optional | |||
SubsetReplicas map[string]int32 `json:"subsetReplicas,omitempty"` | |||
|
|||
// Record whether each subset is unschedulable. | |||
// +optional | |||
SubsetUnschedulable *SubsetUnschedulable `json:"subsetUnschedulable,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider change the field subsetUnschedulable to a slice of SubsetStatus
return false | ||
} | ||
|
||
type UnschedulableStatus struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change Unschedulable to slice of SubsetCondition, so that we can record possible other condition besides Schedulable condition
// +optional | ||
UnschedulableTimestamp *metav1.Time `json:"unschedulableTimestamp,omitempty"` | ||
// +optional | ||
PendingPods int32 `json:"-"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to record pending pods here ?
Signed-off-by: AiRanthem <[email protected]>
Signed-off-by: AiRanthem <[email protected]>
Signed-off-by: AiRanthem <[email protected]>
Signed-off-by: AiRanthem <[email protected]>
Ⅰ. Describe what this PR does
Added an adaptive scheduling strategy to UnitedDeployment. During scaling up, if a subset causes some Pods to be unschedulable for certain reasons, the unschedulable Pods will be rescheduled to other partitions. During scaling down, if elastic allocation is used (i.e., the subset is configured with min/max), each partition will retain the ready Pods as much as possible without exceeding the maximum capacity, rather than strictly scaling down in reverse order of the Subset list.
Ⅱ. Does this pull request fix one issue?
fixes #1673
Ⅲ. Describe how to verify it
Use the yaml below to create a UD with subset-b unschedulable.
subset-c -> subset-b -> subset-a
Ⅳ. Special notes for reviews