-
Notifications
You must be signed in to change notification settings - Fork 38.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: perform the admission checks that preemption will not help first to avoid meaningless pod eviction #116892
Conversation
…irst to avoid meaningless pod eviction
My concern is that this would rarely happen the pod would be rejected for OSSelector or OSField.
From a logical standpoint, this PR looks good to me. However, it would be helpful if you could provide a specific use case for it. For instance, imagine that a Windows Pod with high resource requirements is requested and labeled as such but without any corresponding Windows node selector or affinity. In this scenario, the pod may end up being scheduled on a Linux node and potentially cause an eviction of other pods on that node - particularly if the evicted pods have lower priority than the new Windows Pod. If a large resource is requested, the pod should not be scheduled here. Therefore, I am unable to create a complete test case to reproduce this bug. |
@pacoxu To be honest, It is not a usual problem. But how about these scenarios where the scheduler is not involved? |
/lgtm |
LGTM label has been added. Git tree hash: 3e03565994eadcdfb121a980239e2c1b68b0ac54
|
/assign @klueska |
/triage accepted |
lgtm ping @klueska could you take a look |
Hi @klueska |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mrunalp, SataQiu 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 bug
/kind cleanup
What this PR does / why we need it:
When
generalFilter
fails,HandleAdmissionFailure
will attempt to release resources for the critical Pod by triggering Pod eviction. This is a high cost operation and maybe unhelpful. We should perform the resource unrelated checks first and quick return to avoid meaningless pod eviction.kubernetes/pkg/kubelet/preemption/preemption.go
Lines 62 to 87 in d2be69a
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: