prole/tmp/fix_memory.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

44 lines
1.3 KiB
Bash

#!/usr/bin/env bash
set -euo pipefail
export KUBECONFIG=/Users/chrisfu/dev/prole/prole-k3s.kubeconfig
echo "==> Patching CR: reduce memory requests and enforce replicaCount=1..."
kubectl -n gitea patch gitlab gitlab --type=merge -p '{
"spec":{"chart":{"values":{
"gitlab":{
"webservice":{
"replicaCount":1,
"minReplicas":1,
"maxReplicas":1,
"resources":{
"requests":{"cpu":"200m","memory":"1500M"},
"limits":{"memory":"2000M"}
}
},
"sidekiq":{
"resources":{
"requests":{"cpu":"100m","memory":"800M"},
"limits":{"memory":"1200M"}
}
}
}
}}}}'
echo "==> Force-deleting all stuck Terminating/Pending webservice 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 with new memory limits..."
sleep 240
echo "==> Pod status:"
kubectl -n gitea get pods --no-headers \
| grep -v jemalloc-builder | grep -v Completed | sort
echo "==> CR phase:"
kubectl -n gitea get gitlab gitlab -o jsonpath='{.status.phase}' && echo