Shrinidhi Devaraj
Shrinidhi Devaraj

Reputation: 35

Pods are stuck at ContainerCreating after deletion of the pod

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

Upvotes: 1

Views: 3519

Answers (1)

CaioT
CaioT

Reputation: 2211

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>

Upvotes: 7

Related Questions