-
Notifications
You must be signed in to change notification settings - Fork 39.9k
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
[scheduler] Support preemption of pods using ReadWriteOncePod PVCs #114051
Conversation
Please note that we're already in Test Freeze for the Fast forwards are scheduled to happen every 6 hours, whereas the most recent run was: Mon Nov 21 15:27:42 UTC 2022. |
Thinking out loud -- building the We may be able to do better than this by repurposing the |
c431e7b
to
9d97867
Compare
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.
I didn't review tests yet.
pkg/scheduler/framework/plugins/volumerestrictions/volume_restrictions.go
Outdated
Show resolved
Hide resolved
pkg/scheduler/framework/plugins/volumerestrictions/volume_restrictions.go
Outdated
Show resolved
Hide resolved
pkg/scheduler/framework/plugins/volumerestrictions/volume_restrictions.go
Outdated
Show resolved
Hide resolved
pkg/scheduler/framework/plugins/volumerestrictions/volume_restrictions.go
Outdated
Show resolved
Hide resolved
pkg/scheduler/framework/plugins/volumerestrictions/volume_restrictions.go
Outdated
Show resolved
Hide resolved
pkg/scheduler/framework/plugins/volumerestrictions/volume_restrictions.go
Outdated
Show resolved
Hide resolved
pkg/scheduler/framework/plugins/volumerestrictions/volume_restrictions.go
Outdated
Show resolved
Hide resolved
pkg/scheduler/framework/plugins/volumerestrictions/volume_restrictions.go
Outdated
Show resolved
Hide resolved
pkg/scheduler/framework/plugins/volumerestrictions/volume_restrictions.go
Outdated
Show resolved
Hide resolved
9d97867
to
31a68ac
Compare
I restructured the PR to go with an approach like #114051 (comment). Please see the commit descriptions for each one for more context. At a high-level, I've changed the caches to store references to the specific pods using each PVC. In |
31a68ac
to
78ca250
Compare
/milestone v1.27 |
@chrishenzie: You must be a member of the kubernetes/milestone-maintainers GitHub team to set the milestone. If you believe you should be able to issue the /milestone command, please contact your Milestone Maintainers Team and have them propose you as an additional delegate for this responsibility. In response to this:
Instructions 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. |
pkg/scheduler/framework/plugins/volumerestrictions/volume_restrictions.go
Show resolved
Hide resolved
pkg/scheduler/framework/plugins/volumerestrictions/volume_restrictions.go
Outdated
Show resolved
Hide resolved
pkg/scheduler/framework/plugins/volumerestrictions/volume_restrictions.go
Outdated
Show resolved
Hide resolved
pkg/scheduler/framework/plugins/volumerestrictions/volume_restrictions.go
Outdated
Show resolved
Hide resolved
cf95111
to
bac3076
Compare
This doesn't appear to be working (preempting lower priority pods) in a multi-node environment, but does for single-node. Looking into this. |
4b58409
to
1c80d58
Compare
a4a0caa
to
5ff76a0
Compare
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.
Looks like this is ready to merge now, anything left? @alculquicondor
pkg/scheduler/framework/plugins/volumerestrictions/volume_restrictions.go
Outdated
Show resolved
Hide resolved
pkg/scheduler/framework/plugins/volumerestrictions/volume_restrictions_test.go
Outdated
Show resolved
Hide resolved
5ff76a0
to
167da36
Compare
PVCs using the ReadWriteOncePod access mode can only be referenced by a single pod. When a pod is scheduled that uses a ReadWriteOncePod PVC, return "Unschedulable" if the PVC is already in-use in the cluster. To support preemption, the "VolumeRestrictions" scheduler plugin computes cycle state during the PreFilter phase. This cycle state contains the number of references to the ReadWriteOncePod PVCs used by the pod-to-be-scheduled. During scheduler simulation (AddPod and RemovePod), we add and remove reference counts from the cycle state if they use any of these ReadWriteOncePod PVCs. In the Filter phase, the scheduler checks if there are any PVC reference conflicts, and returns "Unschedulable" if there is a conflict. This is a required feature for the ReadWriteOncePod beta. See for more context: https://github.com/kubernetes/enhancements/tree/master/keps/sig-storage/2485-read-write-once-pod-pv-access-mode#beta
167da36
to
dbc7d8d
Compare
t.Errorf("Unexpected PreFilter status (-want, +got): %s", diff) | ||
} | ||
// If PreFilter fails, then Filter will not run. | ||
if test.preFilterWantStatus.IsSuccess() { |
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.
FYI @kidddddddddddddddddddddd regarding #114898
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.
/approve
/hold cancel
/lgtm
LGTM label has been added. Git tree hash: f308a56055752323b5ae6ae2fe129430c4da8eaa
|
/assign @aojea |
PRR approved, this is ready for merge. See #114494 for e2e test changes and feature gate bump to beta. |
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alculquicondor, aojea, chrishenzie The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Adds support for preemption of pods using
ReadWriteOncePod
PVCs. This is a required feature for beta graduation.Which issue(s) this PR fixes:
Fixes #103132
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
Testing
This feature can be tested the following ways:
/sig storage
/sig scheduling
/cc @msau42
/cc @jsafrane
/cc @alculquicondor