-
Notifications
You must be signed in to change notification settings - Fork 39.7k
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
kubelet was sending negative allocatable values #46516
kubelet was sending negative allocatable values #46516
Conversation
cc @sjenning - ptal |
@derekwaynecarr just to check my understanding. If the reserve > capacity and allocatable value would be negative, we return 0 instead, which effectively makes the node unschedulable right? |
@derekwaynecarr also, do we need a test? I don't see an existing test for exercising the node allocatable reservation stuff. |
62c9b0a
to
8aaaca0
Compare
@sjenning - i added a test. the node is not necessarily unschedulable. it depends on the resource. if you have 3 gpus, and reserve 4, the node will work just fine. if you have 4 cpus, and reserve 5, the node will run besteffort pods just fine. if you have 4Gi memory, and reserve 5Gi, we will evict all pods and always report memory pressure. for reference, node allocatable cgroup enforcement protects for this: |
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 good
/lgtm |
/lgtm Should we cherrypick this to 1.6? cc/ @dashpole |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dchen1107, derekwaynecarr, sjenning
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
Automatic merge from submit-queue (batch tested with PRs 45809, 46515, 46484, 46516, 45614) |
What this PR does / why we need it:
if you set reservations > node capacity, the node sent negative values for allocatable values on create. setting negative values on update is rejected.
Which issue this PR fixes
xref https://bugzilla.redhat.com/show_bug.cgi?id=1455420
Special notes for your reviewer:
at this time, the node is allowed to set status on create. without this change, a node was being registered with negative allocatable values. i think we need to revisit letting node set status on create, and i will send a separate pr to debate the merits of that point.