简体   繁体   中英

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

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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM