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

Add a client flag to delete "--now" for grace period 0 #23756

Merged
merged 1 commit into from
Apr 14, 2016

Conversation

smarterclayton
Copy link
Contributor

Is equivalent to --grace-period=0 but is more intuitive for end users.

Stuck pod?

kubectl delete pod foo --now

@k8s-github-robot k8s-github-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. release-note-label-needed labels Apr 1, 2016
@ncdc
Copy link
Member

ncdc commented Apr 1, 2016

Description should probably say kubectl instead of oc 😄

@smarterclayton
Copy link
Contributor Author

We should have called kubectl kc

@k8s-bot
Copy link

k8s-bot commented Apr 1, 2016

GCE e2e build/test passed for commit 686a132dbea7ed0095614dbdd5fc76786823a1f4.

@k8s-bot
Copy link

k8s-bot commented Apr 4, 2016

GCE e2e build/test passed for commit 0cac01345dc9a152c4ea41abb1fc6f977f3d3eb7.

@0xmichalis
Copy link
Contributor

Can you also add an example?

cc: @kubernetes/kubectl

@k8s-bot
Copy link

k8s-bot commented Apr 4, 2016

GCE e2e build/test passed for commit 5df2a394a443e38212c0c83202781216fcf980a1.

@ikehz ikehz added the team/ux label Apr 4, 2016
@ikehz ikehz assigned bgrant0607 and unassigned ikehz Apr 4, 2016
@k8s-github-robot
Copy link

@smarterclayton
You must link to the test flake issue which caused you to request this manual re-test.
Re-test requests should be in the form of: k8s-bot test this issue: #<number>
Here is the list of open test flakes.

@k8s-bot
Copy link

k8s-bot commented Apr 6, 2016

GCE e2e build/test passed for commit 5df2a394a443e38212c0c83202781216fcf980a1.

@deads2k
Copy link
Contributor

deads2k commented Apr 6, 2016

I don't think I want to use the --force flag for this. I really want the idea of "protected" resources. These would be resources that are hard to delete, but should still be deletable if someone really means it. When we try to delete that resource, we could require them to add a "force" option to DeleteOptions.

As an example of things you want to protect, I could imagine someone deciding to protect serviceaccount/foo because they're using that one to run some maintenance script. I'd say this is also the exact case that was "solved" with immortalNamespaces.

@smarterclayton
Copy link
Contributor Author

Force is saying "delete with grace period 0 without waiting for it to
gracefully shutdown". Nothing to do with immortal resources. Unless
you're saying you want to preserve --force for use with deletion protected
resources, which I can buy. In which case '--now' may be more appropriate.

The user expectation that needs to be managed is "I tried to delete this,
but it doesn't seem to be working. I want to override the normal behavior
and force deletion.". So force is probably aligned with the natural user
expectation.

On Wed, Apr 6, 2016 at 8:40 AM, David Eads notifications@github.com wrote:

I don't think I want to use the --force flag for this. I really want the
idea of "protected" resources. These would be resources that are hard to
delete, but should still be deletable if someone really means it. When we
try to delete that resource, we could require them to add a "force" option
to DeleteOptions.

As an example of things you want to protect, I could imagine someone
deciding to protect serviceaccount/foo because they're using that one to
run some maintenance script. I'd say this is also the exact case that was
"solved" with immortalNamespaces.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#23756 (comment)

@deads2k
Copy link
Contributor

deads2k commented Apr 6, 2016

Unless
you're saying you want to preserve --force for use with deletion protected
resources, which I can buy.

Correct. Since the concept doesn't exist yet, I felt like I had to describe it.

I would prefer to have the concept of protected resources, in which case --force is a more natural fit for that. I'm fine with --now.

@bgrant0607
Copy link
Member

--force is about ignoring or working around conflicts.

@bgrant0607
Copy link
Member

--now would be similar to shutdown now, so I'm in favor of that.

@bgrant0607 bgrant0607 assigned deads2k and unassigned bgrant0607 Apr 6, 2016
@bgrant0607
Copy link
Member

cc @caesarxuchao @janetkuo

@smarterclayton
Copy link
Contributor Author

Updated

On Wed, Apr 6, 2016 at 5:48 PM, Brian Grant notifications@github.com
wrote:

cc @caesarxuchao https://github.com/caesarxuchao @janetkuo
https://github.com/janetkuo


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#23756 (comment)

@caesarxuchao
Copy link
Member

@smarterclayton @bgrant0607 in the future, do you expect "--grace-period=0" and "--now" to mean different things?

#23656 is proposing adding finalizers to resources. In that context, I would imagine for the deletion of a pod, "--now" means ignore all the finalizers, remove the Pod from etcd at once so that its name is released immediately; and "--grace-period=0" means containers receive a SIGKILL immediately, but Pod won't be deleted from etcd until all finalizers have completed.

@smarterclayton
Copy link
Contributor Author

Would removing finalizers be a thing regular users can do?

On Wed, Apr 6, 2016 at 6:09 PM, Chao Xu notifications@github.com wrote:

@smarterclayton https://github.com/smarterclayton @bgrant0607
https://github.com/bgrant0607 in the future, do you expect
"--grace-period=0" and "--now" to mean different things?

#23656 #23656 is proposing
adding finalizers to resources. In that context, I would imagine for the
deletion of a pod, "--now" means ignore all the finalizers, remove the
Pod from etcd at once so that its name is released immediately; and
"--grace-period=0" means containers receive a SIGKILL immediately, but
Pod won't be deleted from etcd until all finalizers have completed.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#23756 (comment)

@k8s-bot
Copy link

k8s-bot commented Apr 6, 2016

GCE e2e build/test passed for commit 148157211f020fcb0ad1b3d104f4d3eab8a8495a.

@caesarxuchao
Copy link
Member

Would removing finalizers be a thing regular users can do?

Yes, I think it's necessary. If a deletion is stuck because a finalizer is not responsive, a user should be able to remove the finalizer manually.

@bgrant0607
Copy link
Member

@caesarxuchao Good point, but may need to work through some use cases to understand whether removing finalizers would be acceptable. I suggest we work that out in the cascading deletion proposal rather than here. For example, blanket finalizer removal could conflict with another flag to indicate whether children should be orphaned.

Finalizers might need to be handled on a case-by-case basis.

@smarterclayton
Copy link
Contributor Author

smarterclayton commented Apr 6, 2016 via email

Is equivalent to --grace-period=0 but is more intuitive for end users.
@k8s-bot
Copy link

k8s-bot commented Apr 8, 2016

GCE e2e build/test passed for commit ea3467f.

gracePeriod := cmdutil.GetFlagInt(cmd, "grace-period")
if cmdutil.GetFlagBool(cmd, "now") {
if gracePeriod != -1 {
return fmt.Errorf("--now and --grace-period cannot be specified together")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can allow --now and --grace-period=0 to be set together (although it's redundant)

@janetkuo
Copy link
Member

janetkuo commented Apr 8, 2016

Please update the PR title and description to --now

@smarterclayton
Copy link
Contributor Author

Do we want to encourage users to do that? Why would a user ever set them
together? We generally don't allow combinations that are equivalent to be
specified together (which is fairly consistent from a unix perspective)

On Fri, Apr 8, 2016 at 1:46 AM, Janet Kuo notifications@github.com wrote:

Please update the PR title and description to --now


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#23756 (comment)

@smarterclayton smarterclayton changed the title Add a client flag for --force delete Add a client flag to delete "--now" for grace period 0 Apr 8, 2016
@janetkuo
Copy link
Member

janetkuo commented Apr 8, 2016

@smarterclayton I agree.

@smarterclayton
Copy link
Contributor Author

Any other comments on this?

@deads2k
Copy link
Contributor

deads2k commented Apr 12, 2016

lgtm

@deads2k deads2k added lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-label-needed labels Apr 12, 2016
@deads2k
Copy link
Contributor

deads2k commented Apr 12, 2016

@smarterclayton how picky are we on release notes? I labelled it that way just in case we want to note every CLI change, but let me know if that's not the case.

@k8s-bot
Copy link

k8s-bot commented Apr 12, 2016

GCE e2e build/test passed for commit ea3467f.

@smarterclayton
Copy link
Contributor Author

It's a usability improvement so I think it's deserved.

@k8s-bot
Copy link

k8s-bot commented Apr 14, 2016

GCE e2e build/test passed for commit ea3467f.

@lavalamp lavalamp merged commit a42d7fa into kubernetes:master Apr 14, 2016
openshift-publish-robot pushed a commit to openshift/kubernetes that referenced this pull request Sep 10, 2019
…ed_again

Bug 1747377: UPSTREAM: 73863: Fix code to handle delayed binding volumes

Origin-commit: b05811ee34b081c7f3504d0701f02d25181f3e42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. 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.