LinuxCommandLibrary

kubectl-delete

Delete Kubernetes resources.

TLDR

Delete a specific pod

$ kubectl delete pod [pod_name]
copy


Delete a specific deployment
$ kubectl delete deployment [deployment_name]
copy


Delete a specific node
$ kubectl delete node [node_name]
copy


Delete all pods in a specified namespace
$ kubectl delete pods --all --namespace [namespace]
copy


Delete all deployments and services in a specified namespace
$ kubectl delete deployments,services --all --namespace [namespace]
copy


Delete all nodes
$ kubectl delete nodes --all
copy


Delete resources defined in a YAML manifest
$ kubectl delete --filename [path/to/manifest.yaml]
copy

Copied to clipboard