“Ghost” kubernetes pod stuck in terminating

后端 未结 3 2353
清歌不尽
清歌不尽 2021-02-20 14:54

The situation

I have a kubernetes pod stuck in \"Terminating\" state that resists pod deletions

NAME                             READY STATUS       RES         


        
相关标签:
3条回答
  • 2021-02-20 15:03

    In my case nothing worked, no logs, no delete, absolutely nothing. I had to restart all the nodes, then the situation cleared up, no more Terminating pods.

    0 讨论(0)
  • 2021-02-20 15:06

    Try removing the finalizers from the pod:

    kubectl patch pod funny-turtle-myservice-xxx-yyy -p '{"metadata":{"finalizers":null}}'
    
    0 讨论(0)
  • 2021-02-20 15:07

    In my case, the solution proposed by the accepted answer did not work, it kept stuck in "Terminating" status. What did the trick for me was:

    kubectl delete pods <pod> --grace-period=0 --force
    
    0 讨论(0)
提交回复
热议问题