How do I force delete kubernetes pods?

前端 未结 7 1976
渐次进展
渐次进展 2021-01-31 07:58

I have the following pods:

NAME                                                 READY     STATUS        RESTARTS   AGE
xxx-myactivities-79f49cdfb4-nwg22                  


        
7条回答
  •  情话喂你
    2021-01-31 08:21

    kubectl get pod --all-namespaces | awk '{if ($4 != "Running") system ("kubectl -n " $1 " delete pods " $2  " --grace-period=0 " " --force ")}'
    

    you can use this command

提交回复
热议问题