I migrated a Kubernetes namespace to a second cluster the way most guides describe it: install Velero on the new cluster, point it at the same bucket, restore. Before the restore, one velero backup delete on the new cluster removed a backup the old cluster had made. Its files left the bucket, a restore from it on the old cluster failed with NoSuchKey, and shortly after that the old cluster forgot the backup had ever existed. Nobody had typed a command on the old cluster. One field on the new cluster's backup location, accessMode: ReadOnly, refuses exactly that, and in the lab it did.
That was not the only Completed that lied. My very first Velero backup finished with Backup completed with status: Completed., zero errors and one warning, and the volume holding the data had not been backed up at all. The warning was in the backup log, not on the screen: Volume data in pod p26-shop/... is a hostPath volume which is not supported for pod volume backup, skipping.
That is why this post deletes things on purpose. I run Kubernetes clusters for a living and I have watched "we have backups" turn into "we have manifests in Git" during an incident more than once. So I wanted to see, on a laptop, what Velero actually brings back: after a namespace is deleted, after a restore lands on top of live objects, after the whole cluster is gone, and, the part this post is built around, when two clusters share one bucket during a migration. And I wanted to put it next to the other thing people call a Kubernetes backup, an etcd snapshot, and see what each of them is missing.
Everything here ran on kind, with an S3-compatible bucket in a container outside the cluster. No cloud account. kind has no CSI snapshot support, so volume data went through Velero's file-system backup, and I will say where that changes the picture for a real cluster.
What is Velero?
Velero is an open source tool that backs up Kubernetes objects and persistent volume data to object storage, and restores them into the same cluster or a different one. It runs inside the cluster as a controller, and you drive it with a CLI or by creating its custom resources.
The pieces, in the order you meet them:
- velero server: a Deployment in the
veleronamespace. It reads objects from the API server, writes them to a bucket as a compressed tarball, and does the reverse on restore. - Plugins: the code that talks to a provider. The AWS plugin speaks the S3 API, which is why it also works with MinIO, SeaweedFS, Ceph and other S3-compatible stores.
- BackupStorageLocation (BSL): where backups go. A bucket, an optional prefix, credentials and settings like
s3Url. Its status isAvailableorUnavailable. - VolumeSnapshotLocation: where disk snapshots go, for providers that have them. Not used in this lab.
- node-agent: a DaemonSet that copies files out of a pod's volume on the node, using kopia, and back in on restore. This is the file-system backup path.
- Backup, Restore, Schedule: custom resources. A Backup says what to take, a Restore says what to put back and where, a Schedule creates Backups on a cron expression with a time to live (TTL).
The problem, and why it matters
Most teams say they have Kubernetes backups, and most of them mean Git. The manifests are in a repository, Argo CD or a pipeline can apply them again, so the cluster is "reproducible". That is true for the shape of the workloads and false for almost everything that matters on the worst day: the rows in the database volume, the Secret that someone rotated by hand last month, the objects an operator created at runtime, the PersistentVolumeClaims that bind to specific disks.
The disaster is rarely dramatic. Someone runs kubectl delete namespace with the wrong context. An upgrade leaves the control plane in a state nobody wants to debug at three in the morning. A storage class gets changed and a StatefulSet is recreated. A region has a bad day. In each case the question is not "do we have a backup" but "what comes back, where, and has anyone tried".
That last part is the real gap. Backups that have never been restored are a hope. A restore has its own failure modes: objects that already exist, a storage class that does not exist in the new cluster, a Secret that was excluded, a volume that was quietly skipped. You only find those by restoring, and it is much cheaper to find them in a drill than during an outage.
So I wanted three things from this lab: a backup that includes the volume data and lives outside the cluster, a restore I have watched succeed and fail for real reasons, and an honest answer to "would an etcd snapshot have done the same job".
What Velero gives you
| In practice | What I saw in the lab | |
|---|---|---|
| Namespace-level backup | one team's namespace can be backed up and restored without touching anything else | p26-shop deleted and restored; other namespaces never involved |
| Volume data, not just objects | the PVC comes back with its files, not empty | 25 order lines before, 25 after, same checksum |
| Storage outside the cluster | losing the cluster does not lose the backups | a deleted kind cluster, a new one, the same bucket, the same data |
| Restore somewhere else | a copy for staging, a drill, or a migration | --namespace-mappings ran a second copy beside the original; a second cluster restored the namespace through a read-only location while the first kept running |
| Filters | back up only what you mean: labels, resource types, namespaces | a label selector left one ConfigMap out; a Secret exclusion broke the restored pod |
| Schedules with TTL | backups happen without a person, and old ones go away | a six-hourly schedule, a one-minute TTL removed from cluster and bucket |
The cost: another controller and a DaemonSet in every cluster, a bucket and its credentials to look after, file-system backups that read every byte of every volume on the node, and a restore process that someone has to rehearse. Velero makes the backup easy. It does not make the restore automatic, and it does not decide what is worth keeping.
How it works: what leaves the cluster, and how it comes back

The backup storage location
Everything starts with a bucket that Velero can reach. In the lab it is SeaweedFS in a container on the kind Docker network, so pods resolve it by container name (s3Url=http://p26-seaweedfs:8333) and my laptop reaches it on 127.0.0.1:4660. Velero validates the location regularly by listing the bucket. If the list call fails, the location goes Unavailable, and any backup aimed at it is refused before it starts.
The bucket is deliberately outside the cluster. A backup that lives on a volume inside the cluster it protects is a copy, not a backup.
Objects and volumes are two different paths
For objects, the server walks the API, applies your filters, runs any backup item actions (for example, a pod pulls in its PVC, a PVC pulls in its PV), and writes everything as JSON into <backup>.tar.gz along with a resource list, logs and results.
For volume data there are three paths, and which one you get depends on the cluster:
- Velero-native snapshots: the provider plugin asks the cloud for a disk snapshot (EBS, for example). Fast, but the snapshot stays in that cloud and region.
- CSI snapshots: Velero creates
VolumeSnapshotobjects through the CSI driver. Optionally the data is then moved to the bucket (data mover), so it survives the loss of the storage system. - File-system backup: the node-agent on the pod's node reads the files from the volume's directory and uploads them with kopia to a repository inside the bucket. Works with any volume type the node-agent can see, except
hostPath. Slower, reads everything, and the app keeps writing while it reads.
kind has no CSI snapshot support, so the lab uses the third path, turned on per backup with --default-volumes-to-fs-backup. On EKS or GKE the snapshot paths are usually the better choice for large volumes; I did not run them here.
The order of a restore
A restore is not "apply the tarball". Velero restores in a fixed priority order: CRDs and namespaces first, then the things others depend on (storage, PVs and PVCs, Secrets, ConfigMaps, ServiceAccounts), then pods and the controllers that own them. It drops fields that belong to the old cluster, so a Service gets a new ClusterIP. For volumes restored from a file-system backup, it injects a restore-wait init container into the pod, so the application container does not start until the node-agent has written the files into the new, empty volume. When it finds an object that already exists, the default is to leave it alone and record a warning.
The lab
A single-node kind cluster called velero-lab, Velero 1.18.4 with the AWS plugin 1.14.4, the node-agent on, volume snapshots off, and a small app in namespace p26-shop: a ConfigMap, a Secret, a PVC on kind's local-path provisioner, a Deployment that mounts it and gets its environment from both, a Service, and a second ConfigMap with a different label. The scripts write 25 order lines into the volume and record a checksum. Every phase has assertions, and make test runs all eleven from nothing. Phase 10 adds a second kind cluster, velero-lab-b, on the same bucket.
Two lab-only settings matter. The Velero server runs garbage collection every minute instead of every hour, so TTL can be shown without waiting. And the CLI on the host gets a publicUrl for the bucket, because describe and logs are downloaded through presigned URLs, and the in-cluster hostname does not resolve on a laptop (more in "Where it broke").
1. The backup that said Completed
The first backup used kind's default storage. It finished Completed with one warning. The warning was the whole story: the local-path provisioner creates hostPath PersistentVolumes by default, and Velero's file-system backup does not support hostPath volumes. It skips them and moves on. The phase stays Completed, because skipping is a warning, not an error.
The lab keeps that case as a reproducible failure, next to two other ways the data does not come back:

Three different outcomes, and only one of them is red. The hostPath case says Completed. The backup without volume data says Completed and restores a PVC that is Bound and empty. Only the missing node-agent produces PartiallyFailed. A dashboard that counts failed backups would have been green for two of the three.
The fix for kind is one annotation on the PVC, volumeType: local, which makes the provisioner create a local PV. Velero supports those. On a real cluster the fix is a CSI driver, and either snapshots or file-system backup on its volumes.
2. A backup with the data in it
With the PVC on a local PV, the same command produces a backup with a PodVolumeBackup in phase Completed, done by kopia.

Two things in the bucket are worth knowing. The object backup is plain: the tarball holds the objects as JSON, Secrets included, readable by anyone who can read the bucket. The volume data is not plain: it sits in a kopia repository per namespace, deduplicated and encrypted with a key Velero keeps in a Secret in its own namespace. Bucket access is the real security boundary here, so it gets its own credentials and its own policy.
3. Delete the namespace, then restore it
The disaster is one command: kubectl delete namespace p26-shop. The namespace goes, and because the PV's reclaim policy is Delete, the PV and its directory on the node go with it.

What came back: every object, the Secret value in the pod's environment, a new PV with the same 25 lines and the same checksum. What changed: the Service has a new ClusterIP, the PV has a new name, and the pod had an extra init container for a moment. Even on a clean restore there is one warning, because Kubernetes recreates kube-root-ca.crt in every new namespace before Velero gets to it. That warning appears on every restore of a whole namespace, which is a reason to read warnings rather than count them.
4. Schedules, and a TTL you can watch
A schedule is a cron expression plus a backup template. I created one for every six hours with a 72-hour TTL.

Creating the schedule did not produce a backup in this lab; it waited for its next cron tick. That surprised me, because a new schedule that does nothing until the next window is exactly how a team ends up with "the backup runs tonight" during an incident this afternoon. velero backup create --from-schedule takes one immediately from the schedule's own template, which is also how you test a schedule's settings without waiting for it.
The TTL is written on each backup at creation (EXPIRES 2d for a 72-hour TTL created a moment earlier). When it passes, the garbage collector deletes the Backup object, its files in the bucket and its kopia snapshots. In the lab a one-minute TTL was gone from both the cluster and the bucket shortly after the collector ran. In production the collector runs hourly by default, so expiry is approximate.
5. Choosing what goes in
Filters are where backups quietly become incomplete.

The label selector did what it says, with one detail: the Namespace object and the PV came along even though they do not carry the label, because Velero pulls in what selected items need. The exclusion also did what it says, and that is the problem. The backup completed, the restore completed, and the pod could not start: Error: secret "p26-db" not found. Excluding Secrets is a common idea ("we keep secrets in Vault, not in backups"), and it is fine only if the restore process puts them back first, for example with External Secrets Operator, before the workloads arrive.
6. A copy beside the original
--namespace-mappings p26-shop:p26-shop-drill restored the full backup into a new namespace while the original kept running. Both PVCs were Bound to different PVs, both Services had their own ClusterIP, and both volumes had the same 25 lines with the same checksum. This is the cheapest disaster recovery drill there is: no outage, no second cluster, and a real answer to "does our backup restore".
It is also how a migration starts, but a copy in the same cluster hides the hard part. In another cluster there is a second Velero on the same bucket, and that is where phase 10 found the risk.
7. The failures that will happen to you

A wrong key and a missing bucket look alike from a distance: both locations are Unavailable. The status message tells them apart, SignatureDoesNotMatch against NoSuchBucket, and a backup aimed at either is refused with FailedValidation before it reads anything. Alert on the location's phase, not only on failed backups, because a backup that was never allowed to start does not always show up where people look.
The restore over a live namespace is the one that catches people. I wrote a 26th order and changed a ConfigMap by hand, then restored the backup on top. Velero reported Completed with eight already exists warnings and changed nothing: the volume still had 26 lines, the ConfigMap still said changed by hand. A restore is not a rollback. If you want the backed-up version, delete what is there first, restore into a new namespace, or use --existing-resource-policy update, which did put the ConfigMap back. That policy updates objects; it does not rewrite the data in a volume that already exists.
8. The etcd snapshot, for comparison
Every kubeadm-style control plane, kind included, runs etcd as a static pod with etcdctl inside. I saved a snapshot from inside that pod and looked at what it holds.

The snapshot has everything the API server knows, for every namespace and every cluster-scoped object, at one revision. It has the Secret value in its bytes, because kind does not configure encryption at rest. And it has none of the volume data: order-0001 is not in it, because files on a PV were never in etcd.
I did not restore the snapshot on kind. Restoring one means stopping the API server and etcd, replacing etcd's data directory from the snapshot and starting them again, for the whole cluster at once. That is the right tool when the control plane itself is corrupted and you want it back exactly as it was, and the wrong one when you want one namespace back. On EKS, GKE or AKS you cannot do it at all; the provider runs etcd.
9. Lose the cluster
The last phase takes a fresh backup, deletes the kind cluster, creates a new one with the same name, installs Velero against the same bucket and restores.

The backups came back by themselves: Velero's backup-sync controller reads the bucket and recreates the Backup objects it finds. The schedule did not come back. It was a custom resource in the old cluster, not something in the bucket, and neither was Velero's own installation or its credentials. The new cluster had the data back and no backup running until someone created the schedule again. That is the line I would add to every DR runbook: step one after a restore is to put the backups back.
10. Migrate to a second cluster while the first is still running
This is the phase the post is about. Phase 9 had only one cluster at a time: the old one was gone before the new one touched the bucket. A real migration is not like that. The old cluster keeps serving traffic while the new one is built, both run Velero, and both point at the same bucket, because that is the whole idea: back up on A, restore on B.
The lab keeps velero-lab (A) running with the shop, writes a 27th order, and takes two backups on A: p26-cutover with the volume data, and p26-victim, a small one to lose on purpose. Then it creates a second kind cluster, velero-lab-b (B), with its own kubeconfig, and installs Velero on it with exactly the command from phase 0. Same bucket, same credentials, nothing else. That is what most migration guides and most first attempts look like.

B's location came up Available with access mode ReadWrite, the default, and within a sync period B listed every backup A had made. Then one command on B: velero backup delete p26-victim --confirm. Velero on B did what it was told. It deleted the backup's files from the bucket, because from B's point of view this was its bucket and its backup. Nothing on A was touched, and A still listed p26-victim as Completed for a while. A restore from it on A failed with NoSuchKey: the object backups/p26-victim/p26-victim.tar.gz was gone. A few sync periods later A's own backup-sync controller noticed the files were missing and dropped the Backup object. A lost a backup it had made, and nobody had run a command on A.
In the lab that was a backup I made to lose. In a real migration it is the cleanup someone runs on the new cluster to tidy up "old" backups, a TTL that expires on B, or a velero backup delete --all in the wrong terminal. Every Velero that has the bucket as a read-write location is an owner of every backup in it.

The fix is one field. A BackupStorageLocation has spec.accessMode, ReadWrite by default or ReadOnly. I patched B's location to ReadOnly and tried the same things again:
velero backup createon B ended asFailedValidationwithbackup can't be created because backup storage location default is currently in read-only mode. Nothing was written.velero backup delete p26-cutoveron B was accepted by the CLI, but the deletion request failed withcannot delete backup because backup storage location default is currently in read-only mode, andp26-cutoverwas still there.- The bucket had the same number of objects before and after both attempts.
- Backups kept syncing into B, so the restore still had everything it needed.
Then the cutover itself: A's Deployment scaled to zero so nothing writes after the backup, and velero restore create p26-migrate --from-backup p26-cutover on B, still through the read-only location. The restore completed, the pod came up on B, and the volume had the same 27 lines with the same checksum A had at cutover. A's namespace and PVC were still there, scaled down, which is the rollback path if B turns out to be wrong.
The last step is the one a runbook usually forgets: swap the writer. A's location went ReadOnly, B's went ReadWrite, and B's first backup completed. From that moment B owns the bucket and A can only read it, which is the same rule as before, pointing the other way.
Three things this phase made concrete for me:
- There is exactly one writer per bucket, or per prefix. Every other cluster that can see it is
ReadOnly. This is the rule I would put on the first line of any migration runbook. - The order of the cutover matters. Stop writes on A, take the final backup, restore on B, check the data with something better than "the pod is running", then swap the access modes. Writes that reach A after the final backup are not in B.
Completedin a list is not enough. A still listed the deleted backup asCompletedwhile its files were gone. Check the files, not the list.

Velero or an etcd snapshot?
They answer different questions, and a cluster that matters usually wants both, or a managed control plane plus Velero.
- Scope. Velero works per namespace, label and resource type. An etcd snapshot is the whole cluster at one revision.
- Volume data. Velero carries it (file-system backup or snapshots). An etcd snapshot never has it.
- Where it can be restored. Velero restores into the same cluster, another namespace or another cluster (through a read-only location there), across Kubernetes versions as long as the API versions still exist. An etcd snapshot restores into the same cluster's control plane, on a compatible etcd version.
- Consistency. An etcd snapshot is consistent for API objects by construction. Velero reads objects one by one over a short window, and reads volume files while the app may be writing.
- Who can use it. Velero works anywhere you can run a controller. etcd snapshots need access to the control plane, which managed services do not give you.
If the control plane is broken and you run it yourself, the etcd snapshot is the fastest way back to exactly where you were. If a team deleted their namespace, or the cluster is gone, or you need the data in the volumes, it is Velero.
Limits and rules you only learn by hitting them
- Two clusters on one bucket share their deletes. A second Velero with the default
ReadWritelocation can delete, and expire by TTL, backups another cluster made. Every cluster that is not the owner getsaccessMode: ReadOnly. This is the rule phase 10 is about. Completeddoes not mean "everything". A skippedhostPathvolume is a warning. Read the warnings column, and checkBackup Volumesindescribe --detailsfor each volume you care about.- Restore never overwrites by default. Existing objects are skipped with a warning.
--existing-resource-policy updateupdates objects, not the files in an existing volume. - File-system backup is not crash-consistent across a database. It copies files while the database writes. Use pre and post backup hooks (freeze, flush, or a dump to the volume) or the database's own backup tool, and restore-test it.
- Cluster-scoped resources are only included when they belong to what you back up. A namespace backup brings the PVs its PVCs use. It does not bring CRDs, ClusterRoles, StorageClasses or admission webhooks unless you include them. Restoring custom resources into a cluster that lacks their CRD fails for those items.
- Velero is not in the bucket. Its install, its Schedules, its BSL definitions and its credentials live in the cluster. Keep them in Git or in your cluster bootstrap.
- The bucket holds Secrets in readable JSON. Treat bucket read access like cluster-admin.
- Storage classes must exist on the restore side, or be mapped with Velero's change-storage-class configuration. A restore into a cluster without the class leaves PVCs
Pending. - The node-agent needs to run on every node with volumes you back up, and it needs access to the kubelet's pod directory. On some distributions that path differs and must be configured.
- TTL is checked by a periodic collector. Expiry is "after the next run", not "at that minute".
- A backup location in another region or account is what makes it disaster recovery. Same bucket, same account, same region covers a deleted namespace, not a lost region or a compromised account.
Moving a fleet, not a lab
One cluster with Velero is a lab. Twenty clusters is where the habits matter.
- Install Velero from the same place you install everything else. A Helm chart pinned to a version, values in Git, rolled out by the same GitOps setup as in the Argo CD app-of-apps post. That makes the BSL, the schedules and the node-agent settings reproducible on a new cluster, which is exactly the moment you need them.
- One bucket per environment, outside the environment's account. Production backups in a separate account with object lock or versioning, write-only credentials for the clusters, and read access only for the restore role.
- One writer per bucket prefix, written down. Give each cluster its own prefix in the BSL (
--prefix <cluster>), and when a cluster has to read another one's backups for a migration or a drill, add that location asReadOnly. Put the access mode in the same Git values as the rest of the install, so a new cluster never starts as a second writer by accident. - Schedules by tier, not by team request. For example: critical namespaces every few hours with a short TTL plus a daily one with a long TTL; everything else daily. Write the tiers down once and apply them with labels.
- Secrets come from the secret store, not from the backup. If Secrets are excluded, the restore runbook must recreate them first. The setup from the External Secrets Operator post does that by design: restore the
ExternalSecretobjects and the operator fetches the values again. - Alert on the location and on warnings.
BackupStorageLocationphase, backups notCompleted, backups with warnings, and the age of the last successful backup per schedule. The Velero server exposes metrics for these; the dashboards from the Prometheus and Grafana post are where they belong. - Restore drills on a calendar. Once a month, restore one critical namespace with a namespace mapping, check the data with something better than "the pod is running", write down what broke, delete the copy.
- Keep the etcd path for self-managed control planes. Velero does not replace it. Snapshot etcd on its own schedule, store it with the same care, and practise that restore too, separately.
What this does not solve: data in managed databases outside the cluster (RDS, Cloud SQL), which have their own backups; DNS and load balancer addresses that change in a new cluster; and anything a pod caches on node-local disks without a PVC.
Frequently asked
What is Velero used for? Backing up and restoring Kubernetes objects and persistent volume data, migrating namespaces between clusters, and running disaster recovery drills. It stores backups in object storage, usually S3 or an S3-compatible store.
Does Velero back up persistent volumes? Yes, in one of three ways: cloud provider snapshots, CSI snapshots (optionally moved to the bucket), or file-system backup through the node-agent with kopia. Without one of them, the PVC object is backed up but its data is not, and a restore gives you an empty volume.
What is the difference between Velero and an etcd snapshot? An etcd snapshot is every API object in the cluster at one moment, with no volume data, restorable only into the same control plane. Velero backs up chosen namespaces and resources plus volume data, and restores them into any compatible cluster.
Can Velero restore into a different namespace or cluster? Yes. --namespace-mappings old:new restores into another namespace. For another cluster, install Velero there against the same bucket, set that location's accessMode to ReadOnly, and restore; the backups appear through the backup-sync controller. Switch the access modes only at cutover.
Can two clusters share one Velero bucket? Yes, but only one of them should write. With two ReadWrite locations on the same bucket and prefix, either cluster can delete or expire backups the other made. In the lab a delete on the new cluster removed the old cluster's backup from the bucket, and the old cluster's restore from it failed with NoSuchKey. Use one prefix per cluster, and ReadOnly for every cluster that only needs to read.
Why does my Velero restore say Completed but nothing changed? Because the objects already existed. Velero skips existing objects with an already exists warning by default. Delete them first, restore into a new namespace, or use --existing-resource-policy update for objects.
Why is my BackupStorageLocation Unavailable? Velero cannot list the bucket. The status message has the S3 error: SignatureDoesNotMatch means wrong credentials, NoSuchBucket a wrong bucket name or region, and a DNS or connection error a wrong s3Url.
Does Velero back up hostPath volumes? Not with file-system backup; it skips them with a warning. On kind, the default local-path PVs are hostPath, so set volumeType: local on the PVC or use a different storage class.
How often should Velero back up, and how long should backups live? It depends on how much data you can lose and how far back you need to go. Schedule frequency is the first, TTL the second. A common pattern is frequent backups with a short TTL plus daily ones with a long TTL.
Where it broke
1. Volume data in pod p26-shop/... is a hostPath volume which is not supported for pod volume backup, skipping
The first real backup, status Completed, one warning, no volume data. kind's local-path provisioner creates hostPath PVs unless told otherwise. Fixed with volumeType: local on the PVC. The case is kept in phase 7 so it can be seen again.
2. dial tcp: lookup p26-seaweedfs: no such host
velero backup describe --details on my laptop could not list the resources. The CLI downloads the resource list and logs from the bucket through presigned URLs built from s3Url, and the container name only resolves inside the Docker network. Setting publicUrl=http://127.0.0.1:4660 on the BSL fixed it. On a real cluster the same thing happens with an in-cluster MinIO address.
3. failed to wait BackupRepository, errored early: backup repository is not ready: re-establish on BSL change, create or delete
My own doing. I patched the live BSL to add publicUrl, and the kopia repository for the namespace went NotReady because its location had changed. The next backup ended PartiallyFailed with this error. Deleting the BackupRepository object let Velero create it again. Lesson: changing a BSL that already holds repositories is a change to the backups, not a cosmetic edit. The lab now sets publicUrl at install.
4. A schedule that did not back anything up
velero schedule create succeeded, the schedule was Enabled, LAST BACKUP was n/a, and no backup appeared while I waited. My script expected one and died. velero backup create --from-schedule is now part of the phase. I did not dig into the controller code for the reason, so I am describing what happened, not what the documentation promises.
5. A script that stopped without a word
The wait loop for that first scheduled backup used kubectl get ... -o jsonpath='{.items[0].metadata.name}' inside $(...) under set -e. With no items, kubectl exits non-zero, and bash ended the script silently after Schedule "p26-shop-6h" created successfully. My mistake, not Velero's.
6. A backup that was deleted but still listed
After the TTL backup expired, aws s3 ls s3://p26-velero/backups/ still showed PRE p26-short-ttl/. The objects were gone; SeaweedFS keeps the empty "directory" as a prefix. The check now counts objects per backup instead of prefixes.
7. Error: secret "p26-db" not found
Expected, but worth listing: a backup with --exclude-resources secrets restored into a pod stuck in CreateContainerConfigError. Backup Completed, restore Completed, app down.
8. daemonset pod not found in running state in node velero-lab-control-plane
Also on purpose: the node-agent pushed off the node with a node selector that matches nothing. This one at least ends as PartiallyFailed, so it shows up as a failure.
9. FAIL p26-cutover was deleted through a ReadOnly location
The first run of phase 10 said the read-only location had let a delete through. It had not: B still listed p26-cutover and the bucket still had its files. My check was aws s3 ls ... | grep -q . under set -o pipefail; grep -q exits on the first match, the AWS CLI gets a broken pipe, and the pipeline counts as failed. The check now counts lines. My mistake again, and a reminder to read what a FAIL is actually based on.
10. A deleted backup that was still Completed
In the second run, after B deleted p26-victim, A kept listing it as Completed for a few sync periods. The script expected it to vanish within the first couple of minutes and failed. The files were already gone, and a restore from it on A failed with NoSuchKey. The phase now shows that failed restore first and then waits longer for A's backup-sync controller, which did drop the object.
The trade-off, side by side
Volume data path:
| File-system backup (node-agent + kopia) | CSI snapshots (with or without data mover) | No volume backup | |
|---|---|---|---|
| Plus | works on any node-visible volume type except hostPath, including kind; data lands in the bucket, outside the storage system | fast, storage-level, consistent at the volume level; data mover copies it out of the storage system | nothing extra to run, backups are small |
| Minus | reads every file, slower for large volumes, not crash-consistent for databases; needs the node-agent everywhere | needs a CSI driver with snapshot support and the snapshot CRDs; without data mover the snapshot dies with the storage | the PVC comes back empty, and the backup still says Completed |
| Where it fits | small and medium volumes, clusters without snapshot support, cross-cloud restores | production on a cloud provider with CSI snapshots | stateless namespaces, or data that lives in a managed service |
Kind of backup:
| Velero | etcd snapshot | |
|---|---|---|
| Holds | chosen namespaces and resources, plus volume data | every API object in the cluster, no volume data |
| Plus | restore one namespace, into another namespace or cluster; works on managed Kubernetes | one consistent revision; rolls back a broken control plane exactly |
| Minus | not a point-in-time copy of the cluster; restore skips existing objects; its own install is not in the bucket | all or nothing; same cluster only; not available on EKS, GKE, AKS; Secrets in plain bytes unless encryption at rest is on |
| Where it fits | deleted namespaces, lost clusters, migrations, drills | self-managed control planes, before risky control-plane upgrades |
The second cluster's backup location during a migration:
ReadWrite (the default) |
ReadOnly |
|
|---|---|---|
| Plus | nothing extra to set; the new cluster can start backing up at once | backups sync and restore as usual; create and delete are refused; the bucket did not change |
| Minus | the new cluster can delete or expire the old cluster's backups; a delete on B removed A's backup in the lab | no backups from the new cluster until the access modes are swapped at cutover |
| Where it fits | the one cluster that owns the bucket or prefix | every other cluster that needs to read it: migration targets, drill clusters, a standby |
None of the columns wins on its own. In the lab, file-system backup was the only option for volume data and Velero was the only thing that brought the data back; the etcd snapshot answered a different question.
When to use which
- Velero with volume backup for any namespace whose PVCs hold data you cannot regenerate.
- CSI snapshots on cloud clusters where the driver supports them, with data mover if the backup must survive the storage system or the region.
- File-system backup where snapshots are not available, and for small volumes where copying files is simpler.
- Database-native backups for databases, inside or outside the cluster, with Velero for everything around them.
- etcd snapshots whenever you run the control plane yourself, on their own schedule.
- Namespace mapping drills monthly, on the namespaces that matter most.
- A
ReadOnlylocation on every cluster that reads a bucket it does not own, and an explicit swap at cutover. - Never trust
Completedwithout looking at warnings and volumes.
Your call
I back up stateful namespaces with Velero to a bucket in a separate account, keep Secrets in a secret store rather than in the backup, and restore one namespace into a mapped copy every month. That is for a platform I run with an on-call rotation; a team with one stateless app and a managed database may reasonably decide Git and the database's own backups are enough. It is a choice for my clusters, not a rule for yours. Three things I would like to hear from real clusters:
- When did you last restore a Kubernetes backup on purpose, and what broke?
- Volume data in your backups: snapshots, file-system copies, or nothing because the data lives elsewhere?
- In your last cluster migration, was the new cluster's backup location read-only, or did both clusters write to the same bucket?
I am not after who is right. I want the pluses and minuses in the tables above to be visible to everyone who reads this, in words from real clusters, and the comments are where that happens: https://www.linkedin.com/in/mirac-can-yilmaz
Summary
- Two clusters on one bucket share their deletes. A
velero backup deleteon the new cluster removed a backup the old cluster had made; the old cluster's restore from it failed withNoSuchKey. With the new cluster's locationReadOnly, create and delete were refused, the bucket did not change, and the restore still worked. - A migration is: stop writes on the source, final backup, restore on the target through a read-only location, check the data, then swap the access modes so the target becomes the only writer.
- Velero backs up Kubernetes objects to a bucket as JSON and volume data through snapshots or the node-agent's file-system backup, and restores them into the same or another cluster.
Completedis not proof. AhostPathvolume was skipped with a warning, and a backup with no volume path restored an empty PVC, both with a green status.- A restore skips objects that already exist; it is not a rollback.
--existing-resource-policy updateupdates objects, not existing volume data. - Filters work as written. Excluding Secrets gave a restored pod that could not start until the Secret came from somewhere else.
- The backups survived the loss of the cluster because the bucket was outside it. The schedule, Velero's install and its credentials did not.
- An etcd snapshot holds every API object at one moment and no volume data, and only restores into the same control plane. It answers a different question than Velero.
Next in the series
This is post 12 of Core Skills. Previous: What Are Cloud Native Buildpacks?. Next: what a Kubernetes cluster actually costs, with OpenCost, and what right-sizing changes.
The code for this lab (the kind config, the app manifests, the eleven phase scripts including the two-cluster migration, the failure cases and make test) is shared with Lab Access members on Buy Me a Coffee; the repo invite comes by email after you join: https://buymeacoffee.com/miraccanyilmaz/membership