-
Notifications
You must be signed in to change notification settings - Fork 925
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add --rm
flag to kubectl debug
to remove debug pod on exit
#1681
Comments
This issue is currently awaiting triage. SIG CLI takes a lead on issue triage for this repo, but any Kubernetes member can accept issues by applying the The 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-sigs/prow repository. |
Although at first sight it looks reasonable, each new flag puts kubectl debug under a risk of unusability that kubectl run already experiences due to plenty of flags. As already stated in the description, this new flag won't work on ephemeral containers anyway. In my opinion, hurting the usability for a new flag far outweighs the benefits we get and we should be reluctant to add this flag. |
Hi, I understand that we should be cautious about adding flags. What do you think about adding a specific label to debug pods instead of introducing a flag? This would at least make cleaning up debug pods easier. |
Introducing a flag that is only valid for a part of functionality would not be good user experience. Adding a label to manage such flows would be very hacky. We have decided to reject this request. But if in the future, removal functionality is supported for ephemeral containers (or designed to prohibit this forever?), we may reconsider this decision. /close |
@ardaguclu: Closing this issue. In response to this:
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-sigs/prow repository. |
What would you like to be added:
I would like to add the
--rm
flag tokubectl debug
, similar to the flag inkubectl run
anddocker run
, which allows automatic deletion of the debug pod upon exit. Since ephemeral containers cannot be removed, this flag would only apply when debugging a node or a pod with--copy-to
.I have already opened a PR for this feature, as its implementation is small:
kubernetes/kubernetes#129046
Why is this needed:
kubectl debug -it node
is very useful replacement forssh
, but I often forget to remove completed debug pods. These completed pods are generally not useful, and even the official documentation includes a step for "Cleaning up".The text was updated successfully, but these errors were encountered: