Kubernetes

How to delete all pods whose status is not "Running"?

Difficulty: unrated

Source: bregman-arie/devops-exercises by Arie Bregman

Answer

kubectl delete pods --field-selector=status.phase!='Running'