Deleting Pods
Part of the Introduction to Kubernetes section of Coddy's Terminal journey. Lesson 6 of 45.
When you no longer need a Pod, delete it by name:
kubectl delete pod webKubernetes confirms with pod "web" deleted. The container is stopped and the Pod disappears from the list.
List the Pods again and you get:
No resources found in default namespace.A Pod started with kubectl run is on its own: once deleted, nothing brings it back. Later you will meet Deployments, which recreate Pods for you.
Deleting a Pod that does not exist is an error: Error from server (NotFound): pods "web" not found. Kubernetes tells you exactly which resource it could not find.
Challenge
BeginnerStart a Pod named web from the nginx image, delete it, then list the Pods to confirm it is gone.
Try it yourself
This lesson includes a short quiz. Start the lesson to answer it and track your progress.
All lessons in Introduction to Kubernetes
Practice on your own: Terminal playground