kubectl delete removes Kubernetes objects by name, manifest file, or selector. Deleting a Pod means removing the Pod and its containers, not stopping it for later restart. section 5.6.1
Use the command in progressively broader ways:
- Delete named objects: kubectl delete po kiada, or provide several names separated by spaces. section 5.6.1
- Delete objects described by files: kubectl delete -f pod.kiada-ssl.yaml, multiple comma-separated files, or a directory; use --recursive for subdirectories. section 5.6.2
- Delete all included object kinds and instances with kubectl delete all --all; review the scope with --interactive. section 5.6.4
Removing an application
If an application was created with kubectl apply -f app.yaml, remove its defined objects with kubectl delete -f app.yaml. Kubernetes may report a Pod as Terminating while containers shut down; use --wait=false to return without waiting. section 5.6.2 section 5.6.1
$ kubectl delete po kiada pod "kiada" deleted
Shows the command and confirmation output for deleting a named Pod. section 5.6.1
