Struggling with delivery, architecture alignment, or platform stability?
I help teams fix systemic engineering issues: processes, architecture, and clarity.
→ See how I work with teams.
"How to delete all pods with a status like Error" - that is a question I often get. The DevOps answer is a one-liner, filtering by status.reason and the status we want to query, es example:
kubectl get po -A --all-namespaces -o json | jq '.items[] | select(.status.reason!=null) | select(.status.reason | contains("Evicted")) | "kubectl delete po \(.metadata.name) -n \(.metadata.namespace)"' | xargs -n 1 bash -c
In that case we delete all pods with the Status "Evicted". But it works for every status based filtering.
Related guides:
If you need help with distributed systems, backend engineering, or data platforms, check my Services.