WP-0013/0014: warden credential routing, CoulombCore kubeconfig, apps-pg backup dry-run
Document OpenBao/warden paths for the offsite backup lane and flag the sealed Vault blocker. Point production Makefile targets at CoulombCore, auto-discover CNPG clusters in backup status, add apps-pg pg_dump dry-run tooling, and record Core Hub Helm cutover findings (live gitea image, adopt required).
This commit is contained in:
parent
cd7e7035ce
commit
a689270f18
7 changed files with 229 additions and 41 deletions
|
|
@ -2,12 +2,6 @@
|
|||
set -euo pipefail
|
||||
|
||||
namespace="${CNPG_NAMESPACE:-databases}"
|
||||
clusters=(
|
||||
apps-pg
|
||||
forgejo-db
|
||||
net-kingdom-pg
|
||||
state-hub-db
|
||||
)
|
||||
|
||||
if ! kubectl get ns "$namespace" >/dev/null 2>&1; then
|
||||
echo "ERROR: namespace $namespace is not reachable from the current kubeconfig" >&2
|
||||
|
|
@ -15,9 +9,23 @@ if ! kubectl get ns "$namespace" >/dev/null 2>&1; then
|
|||
fi
|
||||
|
||||
echo "CNPG backup posture in namespace ${namespace}"
|
||||
context="$(kubectl config current-context 2>/dev/null || echo unknown)"
|
||||
server="$(kubectl config view --minify -o jsonpath='{.clusters[0].cluster.server}' 2>/dev/null || echo unknown)"
|
||||
echo "kube-context: ${context}"
|
||||
echo "api-server: ${server}"
|
||||
echo
|
||||
|
||||
mapfile -t clusters < <(
|
||||
kubectl get cluster -n "$namespace" -o jsonpath='{range .items[*]}{.metadata.name}{"\n"}{end}' 2>/dev/null \
|
||||
| sort
|
||||
)
|
||||
if ((${#clusters[@]} == 0)); then
|
||||
echo "ERROR: no CNPG Cluster resources in ${namespace}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
missing=0
|
||||
logical_backup_note=0
|
||||
|
||||
for cluster in "${clusters[@]}"; do
|
||||
if ! kubectl get cluster "$cluster" -n "$namespace" >/dev/null 2>&1; then
|
||||
|
|
@ -41,6 +49,10 @@ for cluster in "${clusters[@]}"; do
|
|||
if [[ -z "$scheduled" ]]; then
|
||||
echo "${cluster}: ScheduledBackup = none"
|
||||
missing=$((missing + 1))
|
||||
if [[ "$cluster" == "apps-pg" || "$cluster" == "gitea-db" || "$cluster" == "forgejo-db" ]]; then
|
||||
echo "${cluster}: Phase 1 fallback = logical pg_dump (see make apps-pg-backup-dry-run or platform forgejo-backup)"
|
||||
logical_backup_note=1
|
||||
fi
|
||||
else
|
||||
echo "${cluster}: ScheduledBackup = ${scheduled}"
|
||||
fi
|
||||
|
|
@ -60,6 +72,10 @@ done
|
|||
if (( missing > 0 )); then
|
||||
echo "RESULT: degraded — ${missing} cluster(s) lack ScheduledBackup coverage"
|
||||
echo "See docs/app-data-backup-restore-handoff.md and manifests/cnpg-backup-readiness.yaml"
|
||||
if (( logical_backup_note )); then
|
||||
echo "Phase 1: logical pg_dump lane may still run when OpenBao offsite-lane is reachable"
|
||||
echo "See docs/credential-routing-railiance-apps.md"
|
||||
fi
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue