dotfiles/.local/bin/scripts/kubeclean

7 lines
248 B
Plaintext
Raw Normal View History

2024-09-15 14:42:56 +00:00
#!/bin/sh -e
# Cleanup Inactive and Broken Pods
kubectl get pods --all-namespaces --no-headers |
egrep -iv 'PodInitializing|Running|ContainerCreating|Terminating' |
awk '{print "--namespace=" $1 " " $2}' |
xargs -L 1 kubectl delete pod