-
Notifications
You must be signed in to change notification settings - Fork 38.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
Enforce ReadWriteOncePod during scheduling #103082
Enforce ReadWriteOncePod during scheduling #103082
Conversation
eda138c
to
fddf26a
Compare
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
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
Show resolved
Hide resolved
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.
Can you open an issue for using the information you are adding to enforce the existing access modes?
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
@alculquicondor @ahg-g Thank you for the review! After some discussion offline, I think it's best we don't require this for alpha in v1.22. This will give more time to evaluate design + implementation details around handling preemption. |
The problem I see is that there is no way for users to avoid scheduled pods that don't start, is there? Maybe preemption support could be left as a possible beta requirement. |
@alculquicondor There isn't, but that behavior doesn't differ from how
This issue should be fixed, but I don't think fixing it is a requirement for |
For alpha then would we go with marking as |
Yes, you would return |
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.
Can't remember if I asked this before: can you open an issue to add support for ReadWriteOnce in PreFilter?
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
@alculquicondor See here for the scheduler issue: #103132 |
Ah, I'm asking for PreFilter support for |
Oops, I misread the question, here is a new issue for this: #103305 |
f54a0cd
to
7af3713
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.
/approve
pkg/scheduler/framework/plugins/volumerestrictions/volume_restrictions.go
Outdated
Show resolved
Hide resolved
7af3713
to
6c73475
Compare
@alculquicondor @ahg-g for lgtm |
pkg/scheduler/framework/plugins/volumerestrictions/volume_restrictions.go
Outdated
Show resolved
Hide resolved
pkg/scheduler/framework/plugins/volumerestrictions/volume_restrictions.go
Show resolved
Hide resolved
Check the PVC ref count on the node info cache to determine if a pod's PVCs are in use. If they are and it is using ReadWriteOncePod, fail the request.
6c73475
to
7ad44d0
Compare
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ahg-g, alculquicondor, 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 |
/hold cancel |
This PR may require API review. If so, when the changes are ready, complete the pre-review checklist and request an API review. Status of requested reviews is tracked in the API Review project. |
API review of the access mode (including scheduler changes) was completed as part of #102028 |
Please see the last two commits for scheduler related changes.
What type of PR is this?
/kind feature
What this PR does / why we need it:
This is a followup to #102028 that introduces the
ReadWriteOncePod
access mode for PVs and PVCs. This PR introduces changes to the scheduler to enforce this access mode.The
ReadWriteOncePod
access mode restricts volume access to a single pod on a single node. Since no other pods can use a PVC using this access mode (enforced during mount by kubelet, also will not attach to another node), we should enforce this during scheduling so we do not start pods that cannot proceed.Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
I cannot merge this branch into the other PR's branch so this PR includes additional commits. Once it gets merged I will rebase.
Please see this section of KEP-2485 for more details on scheduling changes and additional context.
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
/assign @alculquicondor
/assign @msau42
/sig storage
/hold