Open tksm opened 2 hours ago
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 triage/accepted
label.
The triage/accepted
label can be added by org members by writing /triage accepted
in a comment.
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.
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: https://github.com/kubernetes/kubernetes/pull/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".