Add script to restart all pods in all namespaces
This commit is contained in:
parent
6fd0118d83
commit
efa38d9669
1 changed files with 9 additions and 0 deletions
9
k8s/k8s-restart-all-pods-in-all-namespaces.sh
Normal file
9
k8s/k8s-restart-all-pods-in-all-namespaces.sh
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue