Sort pods by container restart count kubectl

Surface the most-restarting pods to catch crashloops fast

kubectl get pods -A -o jsonpath='{range .items[*]}{.metadata.namespace}{"\t"}{.metadata.name}{"\t"}{.status.containerStatuses[0].restartCount}{"\n"}{end}' | sort -k3 -rn | head
more kubectl all 73 commands →