Skip to content

Commit beba566

Browse files
committed
Loop kind diagnostics until prometheus pod is Running
https://claude.ai/code/session_019F8HyVvonD1Bjeu2VH3YDV
1 parent e193277 commit beba566

1 file changed

Lines changed: 18 additions & 8 deletions

File tree

.github/workflows/test-prometrix.yml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,24 @@ jobs:
3232
helm install kind-prometheus prometheus-community/kube-prometheus-stack --namespace prometheus --set prometheus.service.nodePort=30000 --set prometheus.service.type=NodePort --set grafana.service.nodePort=31000 --set grafana.service.type=NodePort --set alertmanager.service.nodePort=32000 --set alertmanager.service.type=NodePort --set prometheus-node-exporter.service.nodePort=32001 --set prometheus-node-exporter.service.type=NodePort
3333
- name: Kind deployment diagnostics
3434
run: |
35-
echo "=== CONTEXTS ==="
36-
kubectl config get-contexts
37-
echo "=== NAMESPACES ==="
38-
kubectl get namespaces
39-
echo "=== PODS ==="
40-
kubectl get pods --all-namespaces
41-
echo "=== SERVICES ==="
42-
kubectl get services --all-namespaces
35+
for i in $(seq 1 12); do
36+
echo "=== Attempt $i ==="
37+
echo "=== CONTEXTS ==="
38+
kubectl config get-contexts
39+
echo "=== NAMESPACES ==="
40+
kubectl get namespaces
41+
echo "=== PODS ==="
42+
kubectl get pods --all-namespaces
43+
echo "=== SERVICES ==="
44+
kubectl get services --all-namespaces
45+
if kubectl get pods -n prometheus --no-headers | grep kind-prometheus-kube-prome-prometheus | grep -q Running; then
46+
echo "kind-prometheus-kube-prome-prometheus is Running"
47+
exit 0
48+
fi
49+
sleep 5
50+
done
51+
echo "kind-prometheus-kube-prome-prometheus did not reach Running state"
52+
exit 1
4353
4454
- name: Install Prometrix
4555
run: |

0 commit comments

Comments
 (0)