Skip to content
7 min read Updated

Velero Backs Up to the Cluster It's Backing Up: Breaking the Backup Circularity

Velero backed up into Garage S3 inside the same cluster, so losing the cluster meant losing the backups. Fixed with Cloudflare R2 offsite and PBS for VMs.


Disclosure: This post contains Amazon affiliate links (marked with *). As an Amazon Associate I earn from qualifying purchases. Buying through them costs you nothing extra.

The circularity: Velero backs up into Garage S3, which runs inside the Kubernetes cluster it’s backing up. Cluster lost → Garage PVC lost → Velero backup bucket gone → nothing to restore from.

It’s the backup equivalent of locking the spare key inside the safe it opens. An offsite target existed in config but was never activated, and that kind of gap stays invisible until you need the backup.

View the complete homelab infrastructure source on GitHub

The Two-Problem Stack

Two issues compound:

Problem 1: Backup Circularity

Velero’s backup storage location points to Garage, an S3-compatible object store running as a StatefulSet inside the cluster. Every Velero backup (daily snapshots of Vault, Authelia, databases, ArgoCD configs) lands in a bucket that only exists while the cluster survives.

Cluster lost → Garage PVC lost → Velero backup bucket gone → nothing to restore from

PBS backs up the VM/LXC disks to a Seagate 2TB External HDD*, but PBS runs on the same physical host, a BMAX Mini PC*. Lose the host and the USB HDD together and nothing is recoverable at the VM layer. Velero was supposed to be the last safety net, and it was circular.

Problem 2: Torn-State Hazard

Two PVCs with different storage backends, different failure modes:

PVCStorageLocationFailure mode
garage-metalocal-pathk3s nodeNode-pinned, survives if node survives
garage-dataNFS (nfs-client)NFS LXCSurvives if NFS LXC survives

On 2026-07-12, an unclean Garage shutdown (OOM kill) left db.sqlite corrupted. NFS was not the cause this time: garage-meta had been on local-path since 2026-06-23, when an earlier corruption (“database disk image is malformed”) traced back to the NFS/SQLite locking incompatibility and forced the metadata onto local disk. Local disk fixed the locking problem. It doesn’t make SQLite immune to a process killed mid-write. The metadata (SQLite, bucket/key ownership, access grants) and the actual object data were on different volumes with different rollback fates. A partial restore or node loss would leave one without the other, with no clean way to reconcile them.

The Four Options

Option A: Consolidate meta + data on one volume

Move garage-meta from local-path to NFS (same backend as garage-data). Both PVCs on the same storage class → same snapshot/restore fate.

Verdict: Fixes torn state but not circularity. NFS for SQLite is proven fragile: the 06-23 corruption happened while garage-meta was on nfs-client, and moving it back would reopen that. The opposite direction, moving data to local-path, needs disk I don’t have yet.

Option B: External off-cluster target (Cloudflare R2)

Activate the existing r2-offsite backup storage location. Velero dual-targets: in-cluster Garage for speed + off-cluster Cloudflare R2 for bootstrap.

Cluster lost → Garage gone → Velero still has offsite copy on R2
Bootstrap: rebuild cluster → ArgoCD → Velero → restore from R2

Cost: ~$0.015/GB/month on R2, egress free, first 10 GB of storage free each month. At current backup size (~5–10 GiB), negligible. Risk: near zero. It’s additive; no existing backup path changes.

Verdict: Directly solves circularity. The existing R2 config is ready and only needs credentials and a “go”.

Option C: PBS as the primary recovery layer

Lean into PBS as the from-scratch recovery path. PBS already backs up all VMs/LXCs (including the k3s VMs that carry Garage’s data). Velero becomes a convenience layer for single-app restore, not the bootstrap path.

Verdict: Already the real bootstrap path (DR Tier 1-4). Velero is Tier 5, usable only if Garage survived. PBS is the real safety net. The circularity is a Velero-level problem, not a PBS-level one.

Option D: Combine B + C (what I chose)

Activate R2 offsite for Velero (breaks circularity) and treat PBS as the primary VM-level recovery layer. Velero becomes the single-app/namespace convenience tool with a real offsite target.

LayerWhat it coversRecovery path
PBSVM/LXC disks, full host recoveryRestore VMs from PBS → cluster up
Velero + R2App-level config, secrets, databasesArgoCD → Velero → restore from R2
Garage rebuildIf PVCs are lost entirelyTerraform re-creates buckets, ESO re-seeds keys

Verdict: Covers both problems. R2 breaks circularity (zero risk, additive). PBS handles VM-level recovery (already there). Rebuilding Garage from scratch is the fallback if its PVCs are lost, which beats a partial restore that could leave metadata and data inconsistent.

The Recovery Model

Three independent layers, each covering a different failure scenario:

Scenario                          → Recovery path
─────────────────────────────────────────────────────
Single app crash                  → Kubernetes restart (self-heals)
Single PVC lost                   → Velero restore from R2 offsite
Full cluster lost (host survives) → PBS restores k3s VMs → Velero from R2
Host + USB HDD lost               → New host, rebuild cluster from Git, Velero from R2

No single layer has to be perfect. Each layer covers the failure modes the layer below misses. Garage’s torn-state problem becomes irrelevant when the recovery procedure is “rebuild from scratch” rather than “restore from backup.”

Implementation (Zero Downtime)

The R2 activation was purely additive; no existing backup path changed:

  1. Create Cloudflare R2 bucket (free tier)
  2. Populate r2-backuplocation.yml with real R2 credentials via External Secrets Operator
  3. Apply the daily-offsite Velero Schedule (already committed)
  4. Run one test backup, verify with velero backup describe
  5. Confirm PodVolumeBackup entries present for PVCs

The in-cluster Garage target stays. Velero now writes to both through separate schedules: Garage for fast local restores, R2 via daily-offsite for bootstrap from scratch. If Garage is gone, R2 still has a copy.

What I’d Change

  1. Implement R2 sooner. The config existed for weeks before activation. The circularity was a known risk, and “I’ll do it later” is exactly how disaster recovery gaps happen.

  2. Add a Velero backup age alert. Alert when the most recent successful backup is older than 48 hours. If backups silently stop, you want to know before you need one.

  3. Test the full recovery path. PBS restore of k3s VMs → cluster boot → ArgoCD reconciliation → Velero restore from R2. An untested recovery path is a theory, not a plan.


Backup circularity is a common structural flaw in self-hosted Kubernetes: the tool that protects you depends on the thing you’re protecting. The fix is always an independent offsite layer. Cloudflare R2 costs next to nothing at homelab scale, and with free egress you’re not penalized for actually restoring. The implementation was the easy part. The hard part was admitting my backup didn’t survive the scenario I built it for.

Further reading: Designing Data-Intensive Applications by Martin Kleppmann* isn’t a backup book, but its chapters on replication, consistency, and partial failures explain why torn state between metadata and data is so hard to recover from.

Was this helpful?
Share
DW

David Woitzik

Hybrid Cloud Engineer

I work mostly with Azure, Terraform, and Zero-Trust network design, and publish the Terraform templates and write-ups I wanted when I was solving the same problems.

Keep reading

More like this in your inbox

New Terraform modules and articles by email. No spam.