How Do You Terminate Pods in Kubernetes?

Problem scenario
You have some Pods in Kubernetes that you want deleted. What should you do?

Solution
1. Find the names. You can run this to find out: kubectl get pods

2. Run this command, but replace "foobar" with the name of the pod you want deleted: kubectl delete pods foobar

3. That should be it. Run kubectl get pods to verify deletion was successful. If the Pods keep coming back, run this: kubectl get deployments

4. With the results you may need to run kubectl delete deployments foobar (where foobar is the name of the Deployment responsible for the Pods self-healing automatically).

Leave a comment

Your email address will not be published. Required fields are marked *