-
Notifications
You must be signed in to change notification settings - Fork 920
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 --cascade or --force flag to kubectl delete namespace, for non-empty namespaces #525
Comments
This looks like a nice feature to prevent accidental deletion of namespaces that have objects, I like this. I would like to take a look at implementing this. |
We expect the A solution that has been discussed in the past would consist of leveraging annotations on resources as a means of marking them "not safe to delete", similar to the work in kubernetes/kubernetes#17740 (comment) An immediate workaround would involve using admission webhooks to create this protection |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle rotten |
/area kubectl |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@fejta-bot: 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/test-infra repository. |
Today, if you drain a node, kubectl will prompt you for confirmation in the form of
--ignore-daemonsets
and--delete-local-data
if applicable. This is fine and a nice guard for doing something dangerous.Along the same lines, I would like some sort of
--force
or--cascade
flag for deleting namespaces, in case the namespace contains objects. This would implykubectl get -n <namespace> all
before the actual delete is executed./kind feature
/sig cli
What happened:
My namespace and all objects within it was deleted without confirmation or questioning.
What you expected to happen:
A warning or bail out asking for a confirmation or a "I-know-what-I'm-doing-flag` before proceeding.
How to reproduce it (as minimally and precisely as possible):
kubectl delete ns <any-namespace>
The text was updated successfully, but these errors were encountered: