kubectl - 如何获取至少重新启动一次的所有 pods 的列表

kubectl - How to get the list of all pods that have been restarted at least once

kubectl get pods --all-namespaces 提供所有 pods 的列表。 RESTARTS 列显示了 pod 的重启次数。如何获取至少有一次重启的所有 pods 的列表?谢谢

kubectl get pods --all-namespaces | awk '>0'

或者只是

kubectl get po -A | awk '>0'

如果第 5 列 (RESTARTS) > 0,则使用 awk 打印