Re: [kubernetes/kubernetes] [WIP] Implement opt-in graceful delete extension for custom resources (#63162)

0 views
Skip to first unread message

Dr. Stefan Schimanski

unread,
Apr 26, 2018, 7:16:01 AM4/26/18
to kubernetes/kubernetes, k8s-mirror-api-machinery-api-reviews, Team mention

/cc @kubernetes/sig-api-machinery-api-reviews

@deads2k @lavalamp @liggitt @caesarxuchao please take a look at this proposal. Has there been any discussion about finalizers vs. graceful deletion anywhere? The later predates the former by quite some time. Finalizers could simulate graceful deletion.


You are receiving this because you are on a team that was mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

Daniel Smith

unread,
Apr 26, 2018, 4:16:08 PM4/26/18
to kubernetes/kubernetes, k8s-mirror-api-machinery-api-reviews, Team mention

/assign @yliaog @caesarxuchao

Let's make sure that question gets answered before we merge this :)

Chao Xu

unread,
Apr 26, 2018, 6:28:51 PM4/26/18
to kubernetes/kubernetes, k8s-mirror-api-machinery-api-reviews, Team mention

I commented in the issue: #56567 (comment)

Davanum Srinivas

unread,
May 7, 2018, 8:54:31 AM5/7/18
to kubernetes/kubernetes, k8s-mirror-api-machinery-api-reviews, Team mention

/ok-to-test

k8s-ci-robot

unread,
May 7, 2018, 8:59:51 AM5/7/18
to kubernetes/kubernetes, k8s-mirror-api-machinery-api-reviews, Team mention

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

Test name Commit Details Rerun command
pull-kubernetes-typecheck 067899f link /test pull-kubernetes-typecheck

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.

k8s-ci-robot

unread,
May 7, 2018, 9:01:54 AM5/7/18
to kubernetes/kubernetes, k8s-mirror-api-machinery-api-reviews, Team mention

@rmohr: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-kubernetes-typecheck 067899f link /test pull-kubernetes-typecheck
pull-kubernetes-integration 067899f link /test pull-kubernetes-integration
pull-kubernetes-node-e2e 067899f link /test pull-kubernetes-node-e2e

k8s-ci-robot

unread,
May 7, 2018, 9:02:22 AM5/7/18
to kubernetes/kubernetes, k8s-mirror-api-machinery-api-reviews, Team mention

@rmohr: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-kubernetes-typecheck 067899f link /test pull-kubernetes-typecheck
pull-kubernetes-integration 067899f link /test pull-kubernetes-integration

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.

k8s-ci-robot

unread,
May 7, 2018, 9:09:41 AM5/7/18
to kubernetes/kubernetes, k8s-mirror-api-machinery-api-reviews, Team mention

@rmohr: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-kubernetes-typecheck 067899f link /test pull-kubernetes-typecheck
pull-kubernetes-integration 067899f link /test pull-kubernetes-integration
pull-kubernetes-node-e2e 067899f link /test pull-kubernetes-node-e2e
pull-kubernetes-bazel-test 067899f link /test pull-kubernetes-bazel-test

k8s-ci-robot

unread,
May 7, 2018, 9:18:14 AM5/7/18
to kubernetes/kubernetes, k8s-mirror-api-machinery-api-reviews, Team mention

@rmohr: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-kubernetes-typecheck 067899f link /test pull-kubernetes-typecheck
pull-kubernetes-integration 067899f link /test pull-kubernetes-integration
pull-kubernetes-node-e2e 067899f link /test pull-kubernetes-node-e2e
pull-kubernetes-bazel-test 067899f link /test pull-kubernetes-bazel-test
pull-kubernetes-verify 067899f link /test pull-kubernetes-verify

k8s-ci-robot

unread,
May 7, 2018, 9:53:19 AM5/7/18
to kubernetes/kubernetes, k8s-mirror-api-machinery-api-reviews, Team mention
pull-kubernetes-e2e-gce 067899f link /test pull-kubernetes-e2e-gce

Nikhita Raghunath

unread,
May 10, 2018, 4:18:08 AM5/10/18
to kubernetes/kubernetes, k8s-mirror-api-machinery-api-reviews, Team mention

/sig api-machinery
/area custom-resources
/kind feature

Daniel Smith

unread,
May 10, 2018, 12:30:41 PM5/10/18
to kubernetes/kubernetes, k8s-mirror-api-machinery-api-reviews, Team mention

/hold

We talked about this on the SIG. Let's have some more discussion (in the issue) before we commit ourselves to supporting this concept for every resource for all of eternity.

k8s-ci-robot

unread,
May 25, 2018, 10:24:06 PM5/25/18
to kubernetes/kubernetes, k8s-mirror-api-machinery-api-reviews, Team mention

@rmohr: PR needs rebase.

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.

fejta-bot

unread,
Aug 23, 2018, 10:28:30 PM8/23/18
to kubernetes/kubernetes, k8s-mirror-api-machinery-api-reviews, Team mention

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

Roman Mohr

unread,
Sep 10, 2018, 7:34:24 AM9/10/18
to kubernetes/kubernetes, k8s-mirror-api-machinery-api-reviews, Team mention

/remove-lifecycle stale

fejta-bot

unread,
Dec 9, 2018, 7:11:25 AM12/9/18
to kubernetes/kubernetes, k8s-mirror-api-machinery-api-reviews, Team mention

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.

/lifecycle stale

fejta-bot

unread,
Jan 8, 2019, 7:58:06 AM1/8/19
to kubernetes/kubernetes, k8s-mirror-api-machinery-api-reviews, Team mention

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.

/lifecycle rotten

Roman Mohr

unread,
Jan 30, 2019, 6:36:58 AM1/30/19
to kubernetes/kubernetes, k8s-mirror-api-machinery-api-reviews, Team mention

/remove lifecycle-rotten

Roman Mohr

unread,
Jan 30, 2019, 6:37:34 AM1/30/19
to kubernetes/kubernetes, k8s-mirror-api-machinery-api-reviews, Team mention

/remove-lifecycle rotten

Kubernetes Prow Robot

unread,
Jan 30, 2019, 6:37:35 AM1/30/19
to kubernetes/kubernetes, k8s-mirror-api-machinery-api-reviews, Team mention

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: rmohr
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: lavalamp

If they are not already assigned, you can assign the PR to them by writing /assign @lavalamp in a comment when ready.

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

Roman Mohr

unread,
Jan 30, 2019, 6:39:23 AM1/30/19
to kubernetes/kubernetes, k8s-mirror-api-machinery-api-reviews, Team mention

/cc @sttts

Updated everything. I would want to give this another try. @sttts I however have issues to understand under which circumstances the rest API should return a Status with success and when the object. I could not really make out the pattern when comparing the deletion of custom resources and pods.

Roman Mohr

unread,
Jan 30, 2019, 6:40:08 AM1/30/19
to kubernetes/kubernetes, k8s-mirror-api-machinery-api-reviews, Team mention

@rmohr commented on this pull request.


In staging/src/k8s.io/apiserver/pkg/registry/rest/resttest/resttest.go:

> @@ -835,7 +835,7 @@ func (t *Tester) testDeleteNoGraceful(obj runtime.Object, createFn CreateFunc, g
 	}
 	defer t.delete(ctx, foo)
 	objectMeta := t.getObjectMetaOrFail(foo)
-	opts := metav1.NewDeleteOptions(10)
+	opts := metav1.NewDeleteOptions(0)

It looked strange that the dryrun call should delete non-graceful although a grace period is set in the options ... What should be the correct behaviour for Pods and CRs?

Roman Mohr

unread,
Jan 30, 2019, 6:41:07 AM1/30/19
to kubernetes/kubernetes, k8s-mirror-api-machinery-api-reviews, Team mention
> @@ -1082,13 +1082,15 @@ func (t *Tester) testDeleteGracefulImmediate(obj runtime.Object, createFn Create
 	if !errors.IsNotFound(err) {
 		t.Errorf("unexpected error, object should be deleted immediately: %v", err)
 	}
-	objectMeta = t.getObjectMetaOrFail(out)
-	// the second delete shouldn't update the object, so the objectMeta.GetDeletionGracePeriodSeconds() should eqaul to the value set in the first delete.
-	if objectMeta.GetDeletionTimestamp() == nil || objectMeta.GetDeletionGracePeriodSeconds() == nil || *objectMeta.GetDeletionGracePeriodSeconds() != 0 {
-		t.Errorf("unexpected deleted meta: %#v", objectMeta)
-	}
-	if generation >= objectMeta.GetGeneration() {
-		t.Error("Generation wasn't bumped when deletion timestamp was set")
+	if _, ok := out.(*metav1.Status); !ok {

It is not clear to me why a successful real delete should return for Pods the pod and for CRs the status. Maybe I do something wrong somewhere or miss some connecting dots?

Kubernetes Prow Robot

unread,
Jan 30, 2019, 7:12:18 AM1/30/19
to kubernetes/kubernetes, k8s-mirror-api-machinery-api-reviews, Team mention

@rmohr: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-kubernetes-e2e-gce 067899f link /test pull-kubernetes-e2e-gce
pull-kubernetes-verify 5f5201f link /test pull-kubernetes-verify

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.

Kubernetes Prow Robot

unread,
Jan 30, 2019, 7:16:50 AM1/30/19
to kubernetes/kubernetes, k8s-mirror-api-machinery-api-reviews, Team mention

@rmohr: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-kubernetes-e2e-gce 067899f link /test pull-kubernetes-e2e-gce
pull-kubernetes-verify 5f5201f link /test pull-kubernetes-verify
pull-kubernetes-e2e-kops-aws 5f5201f link /test pull-kubernetes-e2e-kops-aws

fejta-bot

unread,
Apr 30, 2019, 9:06:24 AM4/30/19
to kubernetes/kubernetes, k8s-mirror-api-machinery-api-reviews, Team mention

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.

/lifecycle stale

fejta-bot

unread,
May 30, 2019, 9:49:33 AM5/30/19
to kubernetes/kubernetes, k8s-mirror-api-machinery-api-reviews, Team mention

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.

/lifecycle rotten

fejta-bot

unread,
Jun 29, 2019, 10:37:53 AM6/29/19
to kubernetes/kubernetes, k8s-mirror-api-machinery-api-reviews, Team mention

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.


Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

Kubernetes Prow Robot

unread,
Jun 29, 2019, 10:38:13 AM6/29/19
to kubernetes/kubernetes, k8s-mirror-api-machinery-api-reviews, Team mention

Closed #63162.

Kubernetes Prow Robot

unread,
Jun 29, 2019, 10:38:15 AM6/29/19
to kubernetes/kubernetes, k8s-mirror-api-machinery-api-reviews, Team mention

@fejta-bot: Closed this PR.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

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.

Reply all
Reply to author
Forward
0 new messages