Files
oadp/RESTORE.md
2025-12-31 14:30:50 +11:00

1.5 KiB

Restore Procedure Runbook

Set Variables

VELERO_NS=openshift-adp
SRC_NS=n8n
TS=$(date +%Y%m%d-%H%M%S)
DST_NS=n8n-restore-test-$TS
RESTORE_NAME=n8n-restore-test-$TS
TEST_HOST=n8n-restore-$TS.apilab.us

Create Namespace

oc create ns $DST_NS

Apply Restore

cat <<EOF | oc apply -f -
apiVersion: velero.io/v1
kind: Restore
metadata:
  name: $RESTORE_NAME
  namespace: $VELERO_NS
spec:
  backupName: $BACKUP_NAME
  includeClusterResources: false
  includedNamespaces:
    - $SRC_NS
  namespaceMapping:
    $SRC_NS: $DST_NS
  restorePVs: true
  excludedResources:
    - routes.route.openshift.io
EOF

Monitor Restore

watch -n 5 "oc -n $VELERO_NS get restore $RESTORE_NAME -o jsonpath='{.status.phase}{\"\n\"}'"

Check when complete

oc -n $VELERO_NS describe restore $RESTORE_NAME

Monitor Deployments

oc -n $DST_NS rollout status deploy/postgres --timeout=10m
oc -n $DST_NS rollout status deploy/n8n --timeout=10m

Create Route and Test

cat <<EOF | oc -n $DST_NS apply -f -
apiVersion: route.openshift.io/v1
kind: Route
metadata:
  name: n8n-restore-test
spec:
  host: $TEST_HOST
  path: /
  to:
    kind: Service
    name: n8n
  port:
    targetPort: 5678
  tls:
    termination: edge
    insecureEdgeTerminationPolicy: Redirect
EOF

curl -kfsS https://$TEST_HOST/ >/dev/null && echo "PASS: UI reachable"

Cleanup

oc -n $VELERO_NS delete restore $RESTORE_NAME
oc delete ns $DST_NS