[Solved] Kubernetes Pod Not Getting Deleted

Problem: I created a test container on a kubernetes cluster using kubectl run command. Now if I am trying to delete the container, it is not getting deleted.

Solution: When launching kubernetes pods using run command, it creates a deployment object.

So when you try to delete the pod, it won’t get deleted. For this, first, you need to delete the deployment object using the following command.

kubectl get deployment

kubectl delete deployment <deployment-name>

Then Delete the pods.

kubectl delete pod <pod-name>