Cleanup evicted pods
Bulk-delete all Evicted pods left behind by node-pressure eviction
kubectl get po -A | grep Evicted | awk '{print $2" -n "$1}' | xargs -L1 kubectl delete po
- tool
- k8s-debug27 commands
More k8s-debug commands
-
kubectl patch po <pod> -n <ns> -p '{"metadata":{"finalizers":null}}' --type=merge; kubectl delete po <pod> -n <ns> --grace-period=0 --forceClear finalizers to unstick a pod hung in Terminating; note: confirm node is gone first
-
kubectl get --raw /api/v1/nodes/<node>/proxy/stats/summary | jq '.pods[] | {name:.podRef.name, mem:.memory.workingSetBytes}'Pull live per-pod memory from kubelet Summary API, bypassing metrics-server
-
kubectl debug node/<node> -it --image=nicolaka/netshoot -- conntrack -SCheck per-CPU conntrack drops/insert_failed; nf_conntrack table exhaustion drops packets
-
kubectl run dnstest --rm -it --image=nicolaka/netshoot --restart=Never -- dig +short <name>.<ns>.svc.cluster.localResolve a Service FQDN from an ephemeral pod to isolate CoreDNS vs app DNS issues
-
kubectl events --for pod/<pod> -n <ns> --types=WarningStream only Warning events scoped to one pod in chronological order; modern: replaces get events filter