-
Notifications
You must be signed in to change notification settings - Fork 41k
Make pod eviction trigger graceful deletion to match deletion via API #72730
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 pod eviction trigger graceful deletion to match deletion via API #72730
Conversation
/retest |
1 similar comment
/retest |
7dfa408
to
ee67364
Compare
@kubernetes/sig-apps-pr-reviews @kubernetes/sig-scheduling-pr-reviews |
deletionOptions := eviction.DeleteOptions | ||
if deletionOptions == nil { | ||
// default to non-nil to trigger graceful deletion | ||
deletionOptions = &metav1.DeleteOptions{} |
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.
if deletionOpt is nil, we're going to use default grace period?
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.
eviction without delete options would behave like delete without delete options
This is a behavior change. We need to decide if eviction (which is intended to allow safe deletion of pods according to pod disruption budget) essentially force deleting pods by default is a problem worth fixing.
Notably, kubectl drain never passes nil delete options, which is good. https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/drain/drain.go#L526)
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.
This is a behavior change.
Yes; but it seems a "correction" instead of "change" considering "delete without options" :)
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.
Yes; but it seems a "correction" instead of "change" considering "delete without options" :)
I don't disagree, but would like an ack from @kubernetes/api-approvers
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.
I agree.
cc @kubernetes/api-reviewers |
/hold |
/assign @thockin what's your take on changing pod eviction to behave like pod deletion w.r.t. honoring graceful deletion by default? currently if you submit a pod eviction without delete options, it force deletes the pod, which seems at odds with the intent of pod eviction as a safe way to remove pods |
/hold cancel |
Do we have no test coverage for this? |
only incidentally as part of the node authorizer integration test, apparently.
added unit test coverage |
ee67364
to
cdfb5d3
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.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: liggitt, thockin 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 |
/retest |
@liggitt: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
What type of PR is this?
/kind bug
What this PR does / why we need it:
Makes pod eviction with no DeleteOptions match direct pod deletion with no DeleteOptions w.r.t. graceful deletion behavior
Which issue(s) this PR fixes:
Fixes #72717
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
/sig apps