prole/tmp/fix_node_spread.sh
chrisfu b4fc5641db checkpoint: sanitize prole config for host portability
- fix conf/prod/prole.cfg by replacing hardcoded /Users/chrisfu paths with /Users/chrisfu

- remove injected [update.sh] log lines and stray password artifacts so config is executable

- include latest pending updates across deployment config, UI/core flow, vault/network artifacts, and helper scripts
2026-04-10 05:58:40 -07:00

41 lines
1.4 KiB
Bash

#!/usr/bin/env bash
set -euo pipefail
export KUBECONFIG=/Users/chrisfu/dev/prole/prole-k3s.kubeconfig
echo "==> Removing global.nodeSelector so pods spread across cluster..."
kubectl -n gitea patch gitlab gitlab --type=json -p '[
{"op":"remove","path":"/spec/chart/values/global/nodeSelector"}
]' 2>/dev/null || true
echo "==> Removing per-component nodeSelectors except gitaly + minio..."
kubectl -n gitea patch gitlab gitlab --type=merge -p '{
"spec":{"chart":{"values":{
"gitlab":{
"webservice":{"nodeSelector":null},
"sidekiq":{"nodeSelector":null},
"toolbox":{"nodeSelector":null},
"migrations":{"nodeSelector":null},
"gitlab-exporter":{"nodeSelector":null}
},
"registry":{"nodeSelector":null}
}}}}'
echo "==> Force-deleting all stuck Terminating/Pending webservice+sidekiq pods..."
for pod in $(kubectl -n gitea get pods --no-headers \
| grep -E "webservice|sidekiq|minio-create" \
| awk '{print $1}'); do
kubectl -n gitea delete pod "$pod" --force --grace-period=0 \
--ignore-not-found 2>/dev/null || true
done
echo "==> Waiting 4min for operator to reconcile and pods to spread..."
sleep 240
echo "==> Final pod status (with node placement):"
kubectl -n gitea get pods --no-headers \
| grep -v jemalloc-builder | grep -v Completed \
| awk '{print $1, $2, $3, $4}' | sort
echo "==> GitLab CR phase:"
kubectl -n gitea get gitlab gitlab -o jsonpath='{.status.phase}' && echo