Pods are stuck at ContainerCreating after deletion of the pod

7/29/2021

I am trying to delete my pod with force deletion with the following command

kubectl delete pods my-pod-fg4ss --grace-period=0 --force

but my pod is recreating

my-pod-fg4ss 0/3 ContainerCreating 0 2d3h

I am unable to delete the pod

-- Shrinidhi Devaraj
kubernetes
kubernetes-pod

1 Answer

7/29/2021

Most likely this pod is part of a Deployment. In Kubernetes, when you have a deployment resource it needs to have a minimum of 1 replica so that's why when you delete a pod it automatically creates a new one.

In order to delete the pod, you have to actually delete the deployment:

kubectl get deployments

Get the name of the deployment (probably "my-pod") and delete it:

kubectl delete deployment <name>
-- CaioT
Source: StackOverflow