Skip to main content

Recovery drill: etcd

Extract Bex CRs from an etcd snapshot into a throwaway local etcd, then optionally apply reviewed manifests to a restore-* context.

Share
Last updated on September 23, 2026
On this page

Use scripts/restore-etcd.sh from the Bex repository (pinned revision in Platform recovery rehearsals). The script restores a snapshot into a local throwaway etcd, extracts selected CR prefixes, and can apply reviewed JSON only to a kube context whose name starts with restore-. It cannot perform in-place / Path B recovery against the live control plane.

Prepare

  • Confirm a decryptable etcd snapshot object exists (or pass --snapshot s3://…).
  • Install the etcd image pin you will use (--image).
  • Choose an empty --output-dir for extracted manifests.

DRY_RUN

bash
cd /path/to/bex
DRY_RUN=1 scripts/restore-etcd.sh --snapshot latest --output-dir /tmp/etcd-drill

Review planned S3/etcd steps. Expect object-store access when resolving latest.

Extract

bash
scripts/restore-etcd.sh --snapshot latest --output-dir /tmp/etcd-drill

Default prefixes cover Apps, Databases, and KeyValues under /registry/app.bex.co/…. Add --prefix for additional registry paths. Extraction does not contact Kubernetes.

Optional apply

After human review of the JSON files:

bash
scripts/restore-etcd.sh --apply-dir /tmp/etcd-drill \
  --target-context restore-drill \
  --confirm APPLY-restore-drill

Only the reviewed files are applied, and only to a restore-* context.

Verify and clean up

Confirm the expected CRs exist in the throwaway context, then delete that context/cluster per your local lab practice. Do not treat apply success as a live routing restore.

Was this page helpful?

Run this on infrastructure you own

bex is the open-source, AI-native Render alternative — push a git repo and get a running HTTPS service on your own machines.

Get started with bex