#!/usr/bin/env bash set -euo pipefail export KUBECONFIG=/Users/chrisfu/dev/knoe/knoe-k3s.kubeconfig echo "==> Patching CR: increase liveness probe delays for slow RPi boot..." && \ kubectl -n gitea patch gitlab gitlab --type=merge -p '{ "spec":{"chart":{"values":{ "gitlab":{ "webservice":{ "livenessProbe":{ "initialDelaySeconds":3600, "periodSeconds":60, "timeoutSeconds":30, "failureThreshold":5 }, "readinessProbe":{ "initialDelaySeconds":120, "periodSeconds":30, "timeoutSeconds":30, "failureThreshold":60 } }, "sidekiq":{ "livenessProbe":{ "initialDelaySeconds":3600, "periodSeconds":60, "timeoutSeconds":30, "failureThreshold":5 }, "readinessProbe":{ "initialDelaySeconds":120, "periodSeconds":30, "timeoutSeconds":30, "failureThreshold":60 } } } }}}}' echo "==> Force-deleting all crashing webservice/sidekiq pods..." && \ for pod in $(kubectl -n gitea get pods --no-headers | grep -E "webservice|sidekiq" | awk '{print $1}'); do kubectl -n gitea delete pod "$pod" --force --grace-period=0 --ignore-not-found 2>/dev/null || true done echo "==> Done — operator will reconcile new pods with long liveness grace period." && \ echo " Monitor with: kubectl -n gitea get pods -w | grep -E 'webservice|sidekiq'"