kubectl delete — deleting resources.
1# Basic commands2kubectl delete pod pod_name3kubectl delete pod pod_name -n production4kubectl delete pod pod_name --grace-period=0 --force56# Deployment7kubectl delete deployment myapp8kubectl delete deployment myapp -n production9kubectl delete deployment myapp --cascade=background10kubectl delete deployment my_name --ignore-not-found1112# Service13kubectl delete svc my-service14kubectl delete svc my-service -n production1516# ConfigMap/Secret17kubectl delete configmap my-config18kubectl delete secret my-secret1920# Ingress21kubectl delete ingress my-ingress22kubectl delete ingress my-ingress -n production2324# All Pods with label25kubectl delete pods -l app=myapp26kubectl delete pods -l app=myapp -n production2728# All Pods in namespace29kubectl delete pods --all -n production3031# All Pods in all namespaces32kubectl delete pods --all-namespaces3334# Delete by label (all resources)35kubectl delete all -l app=myapp36kubectl delete all -l app=myapp -n production3738# Delete by file39kubectl delete -f deployment.yaml40kubectl delete -f deployment.yaml -n production41kubectl delete -f deployment.yaml --ignore-not-found4243# Delete all (careful!)44kubectl delete pods --all -n production --grace-period=0 --force45kubectl delete all --all -n production --grace-period=0 --force
Options: