Skip to content
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

Merged
merged 1 commit into from Jul 11, 2020

Conversation

hasheddan
Copy link
Contributor

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?:

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added kind/flake Categorizes issue or PR as related to a flaky test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. sig/apps Categorizes an issue or PR as relevant to SIG Apps. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. area/test sig/testing Categorizes an issue or PR as relevant to SIG Testing. and removed needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels Jul 11, 2020
@hasheddan
Copy link
Contributor Author

/assign @smarterclayton

@dims
Copy link
Member

dims commented Jul 11, 2020

/assign @liggitt

@hakman
Copy link
Member

hakman commented Jul 11, 2020

/lgtm
/retest

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 11, 2020
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 11, 2020
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>
@hasheddan
Copy link
Contributor Author

/retest

@BenTheElder
Copy link
Member

ah, the bot comment is stale, that was a different commit https://prow.k8s.io/pr-history/?org=kubernetes&repo=kubernetes&pr=92991

@hasheddan
Copy link
Contributor Author

@BenTheElder yep :) accidentally had an extraneous ! in first push 👍

@BenTheElder
Copy link
Member

/lgtm
/approve
Thanks!

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 11, 2020
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 11, 2020
@BenTheElder
Copy link
Member

/milestone v1.19
/priority critical-urgent

@k8s-ci-robot k8s-ci-robot added the priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. label Jul 11, 2020
@k8s-ci-robot k8s-ci-robot added this to the v1.19 milestone Jul 11, 2020
@k8s-ci-robot k8s-ci-robot removed the needs-priority Indicates a PR lacks a `priority/foo` label and requires one. label Jul 11, 2020
@k8s-ci-robot k8s-ci-robot merged commit 60b8693 into kubernetes:master Jul 11, 2020
@@ -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() {
Copy link
Contributor

@tnozicka tnozicka Jul 28, 2020

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

Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/flake Categorizes issue or PR as related to a flaky test. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. release-note-none Denotes a PR that doesn't merit a release note. sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Flaky Test] [sig-apps] DisruptionController should block an eviction until the PDB is updated to allow it
8 participants