delete_namespace
Delete a Kubernetes namespace and all contained resources, with dry-run preview and safeguards against deleting protected control-plane namespaces or its own service account namespace.
Instructions
[WRITE][risk=high] Delete a namespace and EVERYTHING in it. HIGH RISK — no undo.
Pass dry_run=True to preview without deleting.
Two namespaces are refused. The cluster's control-plane namespaces (kube-system, kube-public, kube-node-lease) need confirm=True — deleting one takes DNS and pod networking with it. The namespace holding this target's own ServiceAccount credential is refused outright and confirm does NOT override it: that delete revokes the credential it is running on. Both refusals are raised on the dry_run path too, so a preview never shows a green wouldDelete for a delete that would be rejected.
Args: name: Namespace name to delete. dry_run: If True, preview without deleting. confirm: Acknowledge deleting a protected control-plane namespace. target: k8s target name from config.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| target | No | ||
| confirm | No | ||
| dry_run | No |