Day-2 Drill: Namespace Backup & Restore
Back up a namespace's resources to a manifest archive, simulate accidental data loss (delete a resource — or the whole namespace), then restore from the backup and verify the round-trip with checks. A stateful data-writer on a PersistentVolume makes the crucial lesson concrete: the manifest backup round-trips Kubernetes OBJECTS, not the DATA on a volume. A dependency-light alternative to Velero that teaches the backup/restore loop every operator must rehearse before they need it.
What you'll do
- Capture a namespace's resources into a restorable manifest archive
- Simulate accidental loss by deleting a resource (or the whole namespace)
- Restore from the backup and verify the namespace round-trips intact
- See first-hand what a manifest-export backup covers (objects) and what it does NOT (PV data): delete the namespace, restore, and watch the data-writer's boot-id change
Stages
- 1baseline
Plant a restore marker in the go-api namespace so the round-trip is provable
restore-marker - 2stateful
Deploy a data-writer that persists a boot-id on a PersistentVolume, so PV-data loss is observable
data-writer
Prerequisites
These are installed into the lab cluster for you — listed so you know what the scenario actually depends on.
Related scenarios
- Day-2 Drill: Node Drain Under LoadCordon and drain a worker node while go-api serves live traffic. A PodDisruptionBudget keeps a minimum number of replicas available, so the scheduler reschedules pods onto the remaining nodes without dropping requests. The grade is the measured request success rate through the drain.
- Day-2 Drill: Rolling Cluster Upgrade Under LoadRoll the cluster's worker nodes to a newer Kubernetes version one at a time while go-api serves live traffic. Each node is drained (respecting the PodDisruptionBudget) before it is replaced, so the application stays available throughout. The grade is the measured request success rate across the upgrade window.
- Autoscaling Under LoadWatch KEDA scale go-api on Prometheus RPS: a spike drives it from 1 to several replicas, then cooldown brings it back. The flagship 'autoscaling actually works' demo, verified under traffic from the load generator.