How do I force delete kubernetes pods?

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

I have the following pods:

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


        
7条回答
  •  执念已碎
    2021-01-31 08:02

    To clean the pods you need to delete their deployments namespace.

    First discover that deployments existed:

    $ kubectl get deployments --all-namespaces
    NAME                               READY     STATUS        RESTARTS   AGE
    chetabahana-web-584b95d576-62ccj   1/1       Running       0          20m
    tutorial-web-56fbccc56b-wbwjq      1/1       Running       0          1m
    

    Delete the deployment -xxxx like this:

    $ kubectl delete deployment 
    

    For example to delete tutorial-web-56fbccc56b-wbwjq run:

    $ kubectl delete deployment tutorial
    

    Then all corresponded pods of tutorial-xxxx will terminate by itself.

    NAME                               READY     STATUS        RESTARTS   AGE
    chetabahana-web-584b95d576-62ccj   1/1       Running       0          20m
    tutorial-web-56fbccc56b-wbwjq      0/1       Terminating   0          1m
    

提交回复
热议问题