prole/_rebind_d002b.sh
chrisfu 9b9d6fdc88 Rename Prole storage objects to Synology and sync deployment updates
- Rename iSCSI storage class and PV/PVC selectors/labels from prole to synology across k8s and OpenTofu manifests\n- Update CNPG/OpenBao/Garage/monitoring init flows, render helpers, and mock scripts for synology-backed storage objects\n- Integrate related UI/core/service config/version updates and add supporting regression tests for CNPG storage/image behavior\n- Keep storage reconciliation tests aligned with current CNPG affinity output

Co-authored-by: Junie <junie@jetbrains.com>
2026-03-22 21:50:02 -07:00

51 lines
1.3 KiB
Bash

#!/usr/bin/env bash
set -euo pipefail
NS=prole-db
# Delete the job first, then the PVCs CNPG created with wrong volumeName
kubectl delete job -n "$NS" -l cnpg.io/instanceName=prole-db-4 --ignore-not-found
kubectl delete pvc prole-db-4 prole-db-4-wal -n "$NS" --ignore-not-found
echo "Deleted prole-db-4 job and PVCs"
# Wait for d002 PVs to become Available
for pv in synology-iscsi-d002-data synology-iscsi-d002-wal; do
for i in $(seq 1 30); do
phase=$(kubectl get pv "$pv" -o jsonpath='{.status.phase}' 2>/dev/null || echo "")
echo " $pv: $phase"
if [[ "$phase" == "Available" ]]; then break; fi
sleep 2
done
done
# Pre-bind with 1Gi (matching CNPG cluster spec size)
kubectl create -f - <<'YAML'
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: prole-db-4
namespace: prole-db
spec:
accessModes: [ReadWriteOnce]
resources:
requests:
storage: 1Gi
storageClassName: synology-iscsi
volumeName: synology-iscsi-d002-data
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: prole-db-4-wal
namespace: prole-db
spec:
accessModes: [ReadWriteOnce]
resources:
requests:
storage: 1Gi
storageClassName: synology-iscsi
volumeName: synology-iscsi-d002-wal
YAML
echo "Created prole-db-4 PVCs pre-bound to d002 (merlin)"
sleep 8
kubectl get pvc -n "$NS"