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
Make sure pod tested for eviction with PDB is not scheduled for deletion #92991
Conversation
/assign @smarterclayton |
/assign @liggitt |
/lgtm |
In kubernetes#91342 attempting to evict a Pod with a DeletionTimestamp caused checking of PDBs to be ignored due to the fact that a Pod scheduled for deletion should not be factored into a disruption budget. However, PDB eviction tests currently will sometimes select a Pod already scheduled for deletion, expecting that attempting to evict it will conflict with the PDB. This updates those tests to make sure a Pod with deletion timestamp is not selected for eviction when it is intended to violate a PDB. Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
/retest |
ah, the bot comment is stale, that was a different commit https://prow.k8s.io/pr-history/?org=kubernetes&repo=kubernetes&pr=92991 |
@BenTheElder yep :) accidentally had an extraneous |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: BenTheElder, hasheddan 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 |
/milestone v1.19 |
@@ -491,7 +491,7 @@ func waitForPodsOrDie(cs kubernetes.Interface, ns string, n int) { | |||
ready := 0 | |||
for i := range pods.Items { | |||
pod := pods.Items[i] | |||
if podutil.IsPodReady(&pod) { | |||
if podutil.IsPodReady(&pod) && pod.ObjectMeta.DeletionTimestamp.IsZero() { |
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.
DeletionTimestamp
is a pointer so this needs to be pod.ObjectMeta.DeletionTimestamp == nil
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.
sent a PR to fix it #93501
What type of PR is this?
/kind flake
What this PR does / why we need it:
In #91342 attempting to evict a Pod with a DeletionTimestamp caused
checking of PDBs to be ignored due to the fact that a Pod scheduled for
deletion should not be factored into a disruption budget. However, PDB
eviction tests currently will sometimes select a Pod already scheduled
for deletion, expecting that attempting to evict it will conflict with
the PDB. This updates those tests to make sure a Pod with deletion
timestamp is not selected for eviction when it is intended to violate a
PDB.
Signed-off-by: hasheddan georgedanielmangum@gmail.com
Which issue(s) this PR fixes:
Fixes #92977
Special notes for your reviewer:
This flaky test currently affects a number of jobs including:
https://testgrid.k8s.io/sig-release-master-blocking#gce-cos-master-default
https://testgrid.k8s.io/sig-release-master-blocking#gce-ubuntu-master-containerd
https://testgrid.k8s.io/sig-release-master-blocking#kind-master-parallel
https://testgrid.k8s.io/sig-release-master-blocking#kind-ipv6-master-parallel
https://testgrid.k8s.io/sig-release-master-informing#gce-master-scale-correctness
https://testgrid.k8s.io/sig-release-master-informing#gce-ubuntu-master-default
See increase in failures since #91342 here: https://storage.googleapis.com/k8s-gubernator/triage/index.html?test=DisruptionController%20should%20block%20an%20eviction%20until%20the%20PDB%20is%20updated%20to%20allow%20it
/cc @liggitt @BenTheElder @hakman
/sig apps
/cc @kubernetes/ci-signal
Does this PR introduce a user-facing change?:
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: