Skip to content

Commit ed99453

Browse files
authored
Add script for waiting for all pods to be running (#349)
1 parent 34cd25b commit ed99453

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
# Get a list of all namespaces
4+
namespaces=$(kubectl get ns --no-headers | awk '{ print $1 }')
5+
6+
# Wait for all pods in every namespace to be running
7+
for namespace in $namespaces; do
8+
echo "Waiting for pods in namespace $namespace to be running..."
9+
while [ "$(kubectl get pods --field-selector=status.phase=Running -n "$namespace" | wc -l)" != "$(kubectl get pods -n "$namespace" | wc -l)" ]; do
10+
sleep 1
11+
done
12+
done
13+
14+
# All pods in all namespaces are now running
15+
echo "All pods in all namespaces are running!"

0 commit comments

Comments
 (0)