6 lines
248 B
Bash
Executable file
6 lines
248 B
Bash
Executable file
#!/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
|