prole/tmp/watch_convergence.sh

29 lines
1.1 KiB
Bash

#!/usr/bin/env bash
export KUBECONFIG=/Users/chrisfu/dev/knoe/knoe-k3s.kubeconfig
echo "==> Force-restarting registry with fresh buckets..."
kubectl -n gitea delete pod -l app=registry --ignore-not-found
echo "==> Watching GitLab convergence (5-min window)..."
for i in $(seq 1 10); do
echo ""
echo "--- [$i/10] $(date -u '+%H:%M:%S') ---"
kubectl -n gitea get pods --no-headers \
| grep -v jemalloc-builder | grep -v Completed | sort \
| awk '{printf " %-55s %s/%s %s\n", $1, $2, $3, $4}'
done_count=$(kubectl -n gitea get pods --no-headers 2>/dev/null \
| grep -v jemalloc-builder | grep -v Completed \
| awk '{print $2}' | grep -c "^1/1$" || echo 0)
total=$(kubectl -n gitea get pods --no-headers 2>/dev/null \
| grep -v jemalloc-builder | grep -v Completed | wc -l | tr -d ' ')
echo " Running 1/1: $done_count / $total"
sleep 30
done
echo ""
echo "==> Final GitLab CR phase:"
kubectl -n gitea get gitlab gitlab -o jsonpath='{.status.phase}' && echo
echo "==> Installer run 9 tail:"
tail -5 /Users/chrisfu/dev/knoe/logs/install_run9.log 2>&1