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

Merged
merged 1 commit into from Jan 29, 2019

Conversation

@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 in the eviction request

/sig apps

@liggitt

This comment has been minimized.

Copy link
Member Author

liggitt commented Jan 11, 2019

/retest

1 similar comment
@liggitt

This comment has been minimized.

Copy link
Member Author

liggitt commented Jan 12, 2019

/retest

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

@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

Author 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" :)

This comment has been minimized.

@liggitt

liggitt Jan 24, 2019

Author Member

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

This comment has been minimized.

@thockin

thockin Jan 24, 2019

Member

I agree.

@liggitt

This comment has been minimized.

Copy link
Member Author

liggitt commented Jan 15, 2019

@liggitt

This comment has been minimized.

Copy link
Member Author

liggitt commented Jan 15, 2019

/hold

@liggitt

This comment has been minimized.

Copy link
Member Author

liggitt commented Jan 24, 2019

/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

@liggitt

This comment has been minimized.

Copy link
Member Author

liggitt commented Jan 24, 2019

/hold cancel

@thockin

This comment has been minimized.

Copy link
Member

thockin commented Jan 26, 2019

Do we have no test coverage for this?

@liggitt

This comment has been minimized.

Copy link
Member Author

liggitt commented Jan 26, 2019

Do we have no test coverage for this?

only incidentally as part of the node authorizer integration test, apparently.

kubectl drain always passed delete options, so this change did not affect it either way.

added unit test coverage

@liggitt liggitt force-pushed the liggitt:eviction-graceful-deletion branch from ee67364 to cdfb5d3 Jan 26, 2019

@thockin
Copy link
Member

thockin left a comment

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm label Jan 28, 2019

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

k8s-ci-robot commented Jan 28, 2019

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

@liggitt

This comment has been minimized.

Copy link
Member Author

liggitt commented Jan 29, 2019

/retest

@k8s-ci-robot k8s-ci-robot merged commit 44d1859 into kubernetes:master Jan 29, 2019

17 of 18 checks passed

pull-kubernetes-e2e-kops-aws Job triggered.
Details
cla/linuxfoundation liggitt authorized
Details
pull-kubernetes-bazel-build Job succeeded.
Details
pull-kubernetes-bazel-test Job succeeded.
Details
pull-kubernetes-cross Skipped
pull-kubernetes-e2e-gce Job succeeded.
Details
pull-kubernetes-e2e-gce-100-performance Job succeeded.
Details
pull-kubernetes-e2e-gce-device-plugin-gpu Job succeeded.
Details
pull-kubernetes-e2e-kubeadm-gce Skipped
pull-kubernetes-godeps Skipped
pull-kubernetes-integration Job succeeded.
Details
pull-kubernetes-kubemark-e2e-gce-big Job succeeded.
Details
pull-kubernetes-local-e2e Skipped
pull-kubernetes-local-e2e-containerized Skipped
pull-kubernetes-node-e2e Job succeeded.
Details
pull-kubernetes-typecheck Job succeeded.
Details
pull-kubernetes-verify Job succeeded.
Details
tide In merge pool.
Details
@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

k8s-ci-robot commented Jan 29, 2019

@liggitt: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-kubernetes-e2e-kops-aws cdfb5d3 link /test pull-kubernetes-e2e-kops-aws

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.

@liggitt liggitt deleted the liggitt:eviction-graceful-deletion branch Jan 31, 2019

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