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

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
3 participants
@liggitt
Copy link
Member

liggitt commented Jan 9, 2019

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

Pod eviction now honors graceful deletion by default if no delete options are provided

/sig apps

@liggitt

This comment has been minimized.

Copy link
Member

liggitt commented Jan 11, 2019

/retest

1 similar comment
@liggitt

This comment has been minimized.

Copy link
Member

liggitt commented Jan 12, 2019

/retest

@liggitt liggitt force-pushed the liggitt:eviction-graceful-deletion branch from 7dfa408 to ee67364 Jan 13, 2019

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

k8s-ci-robot commented Jan 13, 2019

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: liggitt

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

@liggitt

This comment has been minimized.

deletionOptions := eviction.DeleteOptions
if deletionOptions == nil {
// default to non-nil to trigger graceful deletion
deletionOptions = &metav1.DeleteOptions{}

This comment has been minimized.

@k82cn

k82cn Jan 15, 2019

Member

if deletionOpt is nil, we're going to use default grace period?

This comment has been minimized.

@liggitt

liggitt Jan 15, 2019

Member

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)

This comment has been minimized.

@k82cn

k82cn Jan 17, 2019

Member

This is a behavior change.

Yes; but it seems a "correction" instead of "change" considering "delete without options" :)

@liggitt

This comment has been minimized.

Copy link
Member

liggitt commented Jan 15, 2019

@liggitt

This comment has been minimized.

Copy link
Member

liggitt commented Jan 15, 2019

/hold

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment