Home > front end >  How to delete a Kubernetes pod in Pending state without deleting a deployment?
How to delete a Kubernetes pod in Pending state without deleting a deployment?

Time:02-23

I ran

kubectl rollout restart deployment <my-deployment-name>

in order to restart my single pod, launched under the deployment.

NAME                                   READY   STATUS    RESTARTS   AGE
<pod-name>-vf24n                       1/1     Running   1          7d
<pod-name>-8fgqt                       0/1     Pending   0          14m

Sadly, I had no available resources on my affinity node to perform this operation, so the new created pod stuck in Pending state.

Normal   NotTriggerScaleUp  2m57s (x31 over 7m58s)  cluster-autoscaler  pod didn't trigger scale-up (it wouldn't fit if a new node is added):
Warning  FailedScheduling   47s (x9 over 8m)        default-scheduler   0/3 nodes are available: 1 Insufficient memory, 2 node(s) didn't match Pod's node affinity/selector.

I would like to delete the Pending pod or somehow revert the rollout restart operation, without deleting the deployment. Is it possible?

CodePudding user response:

kubectl rollout undo deployment/my-deployment-name will undo a rollout

  • Related