We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 34cd25b commit ed99453Copy full SHA for ed99453
scripts/wait-for-all-pods-running.sh
@@ -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