简体   繁体   中英

How to get list of terminated and running pods list using Kubectl command

I want to see the list of terminated and running pods details in Kubernetes.

Below command only shows the running pods, somehow I want to see the history of all pods so far terminated.

$ ./kubectl get pods -o wide
NAME     READY     STATUS    RESTARTS   AGE       IP              NODE
POD1     1/1       Running   0          3d        10.333.33.333   node123
POD2     1/1       Running   0          4d        10.333.33.333   node121
POD3     1/1       Running   0          1m        10.333.33.333   node124

I expect the terminated pods list using kubectl command

Since v1.10 kubectl prints terminated pods by default:

--show-all (which only affected pods and only for human readable/non-API printers) is now defaulted to true and deprecated. The flag determines whether pods in a terminal state are displayed. It will be inert in 1.11 and removed in a future release.

If running older versions than v1.10, you still need to use the --show-all flag.

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