Add script to restart all pods in all namespaces

This commit is contained in:
Nico Schottelius 2026-06-26 17:21:48 +02:00
commit efa38d9669

View file

@ -0,0 +1,9 @@
#!/bin/sh
# Nico Schottelius, 2026-06-26
for ns in $(kubectl get ns | awk '{ print $1 }'| grep -v '^NAME$'); do
for pod in $(kubectl get pods -n $ns | awk '{ print $1 }'| grep -v '^NAME$'); do
echo "Deleting pods $pod in namespace $ns ..."
kubectl delete pod -n $ns $pod
done
done