Skip to content
Mementropy
RecipesHomelab recipesReference

Running a K3s restore drill with a test ConfigMap

Prove a K3s datastore backup brings data back.

By Ryan Hammang

Proving that a K3s SQLite backup on the NAS contains real cluster objects.

  • The backup from the previous recipe
  1. Create a marker:
Terminal window
kubectl create configmap backup-drill-$(date +%Y%m%d) \
--from-literal=sentinel=restore-verified
  1. Run the backup.
  2. Delete the marker from the live cluster.
  3. Restore the latest snapshot to a temp folder:
Terminal window
restic -r rclone:nas:<share>/<host>/restic restore latest --target /tmp/restore-drill
  1. Look for the marker’s key in the restored datastore:
Terminal window
sqlite3 /tmp/restore-drill/<path>/state.db \
"SELECT name FROM kine WHERE name LIKE '/registry/configmaps/default/backup-drill-%';"
  1. Remove the temp folder.

The query returns the marker’s key.

  • This proves the data is in the backup. It doesn’t prove a full node rebuild. Do that drill separately.