$ run as a normal user# run as root (or with sudo)
Know it before you install
A Backup saves the Kubernetes objects (as JSON) to a BackupStorageLocation (a bucket) and the volume data either as cloud snapshots (VolumeSnapshotLocation / CSI) or with file-system backup by the node agent (Kopia). A Restore recreates the objects and data. A Schedule makes backups automatically with a TTL.
| Item | Value |
|---|---|
| CLI | velero (from github.com/vmware-tanzu/velero/releases) |
| In the cluster | namespace velero: the Velero Deployment + node-agent DaemonSet |
| Plugins | velero/velero-plugin-for-aws (S3 and S3-compatible), Azure, GCP, CSI built in |
| Storage | a bucket per cluster (or a prefix) |
| Objects | Backup, Restore, Schedule, BackupStorageLocation, PodVolumeBackup |
Remember
The plugin version must match the Velero version — check the compatibility table in the plugin's README.
Install the CLI (RHEL and Ubuntu)
First configuration: install Velero in the cluster
Make a bucket (for example velero-prod on S3 or MinIO) and a user with rights only on it. Write its key to a local file (not in Git):
[default]
aws_access_key_id = VELERO_ACCESS_KEY
aws_secret_access_key = VELERO_SECRET_KEYInstall, with file-system backup of volumes by the node agent:
velero install --provider aws --plugins velero/velero-plugin-for-aws:v1.13.0 --bucket velero-prod --secret-file ./credentials-velero --backup-location-config region=eu-central-1,s3ForcePathStyle=true,s3Url=https://s3.example.com:9000 --use-volume-snapshots=false --use-node-agent --default-volumes-to-fs-backup
rm ./credentials-velero
kubectl -n velero get pods
velero backup-location get
NAME PROVIDER BUCKET/PREFIX PHASE LAST VALIDATED
default aws velero-prod Available 2026-11-17 10:02:11| Option | Why |
|---|---|
--provider aws + plugin | S3 API (AWS or compatible like MinIO, Ceph). |
s3ForcePathStyle, s3Url | Needed for S3-compatible storage (not for AWS S3 itself). |
--use-node-agent + --default-volumes-to-fs-backup | Back up PV data with Kopia, works with any storage. |
--use-volume-snapshots=false | No cloud disk snapshots (on AWS/Azure/GCP you can use them instead). |
On clouds with CSI snapshots, use --features=EnableCSI and VolumeSnapshotClasses instead of file-system backup for big volumes.
Back up and schedule
velero backup create shop-before-upgrade --include-namespaces shop --wait
velero backup describe shop-before-upgrade --details
velero backup logs shop-before-upgrade | tail
velero backup get
velero schedule create daily-all --schedule="0 2 * * *" --ttl 720h --exclude-namespaces kube-system,velero
velero schedule create hourly-shop --schedule="@every 1h" --include-namespaces shop --ttl 48h
velero schedule get--ttl 720h keeps backups 30 days, then Velero deletes them (objects and data).
Restore — and test restores
Restore into a new namespace to test without touching production:
velero restore create shop-test --from-backup shop-before-upgrade --namespace-mappings shop:shop-restore-test --wait
velero restore describe shop-test --details
kubectl -n shop-restore-test get pods,pvc
kubectl delete namespace shop-restore-testReal disaster: install Velero on the new cluster pointing to the same bucket (read-only mode is good: velero backup-location set default --access-mode ReadOnly), then velero restore create --from-backup NAME. By default Velero does not overwrite objects that already exist.
Real uses at work:
- Daily backups of all app namespaces (objects + volumes) with 30-day retention.
- A backup right before cluster upgrades or big changes.
- Moving apps to a new cluster (backup on old, restore on new).
Make it safe
Security checklist:
- A dedicated bucket per cluster, its own user with rights only there; versioning/object lock on the bucket.
- Backups contain Secrets — protect the bucket like a password store (encryption at rest, private network).
- Test restores regularly (to a test namespace) — a backup you never restored is not proven.
- Keep a copy of backups in another location/region (3-2-1).
- Version-match Velero and plugins; upgrade them together.
- Limit who can run
velero restore(RBAC on theveleronamespace).
Update and remove
Install the new CLI, then update the server and plugin images (as the upgrade notes say), for example:
kubectl -n velero set image deploy/velero velero=velero/velero:v1.17.1
kubectl -n velero set image ds/node-agent node-agent=velero/velero:v1.17.1
velero uninstallvelero uninstall removes Velero from the cluster; backups in the bucket stay.
Fix common problems
| Problem | Cause | Fix |
|---|---|---|
BackupStorageLocation Unavailable | Wrong bucket, credentials, s3Url, or TLS. | kubectl -n velero logs deploy/velero; check the secret and URL; trust the CA (caCert in the location config). |
Backup PartiallyFailed | Some volume or object failed. | velero backup describe NAME --details and velero backup logs NAME. |
| Volume data missing after restore | Volumes were not included (no fs-backup or snapshot). | Use --default-volumes-to-fs-backup or annotate Pods; check PodVolumeBackup objects. |
| Plugin errors at start | Plugin version does not match Velero. | Use the plugin version from the compatibility table. |
| Restore skipped objects: "already exists" | Objects are still in the cluster. | Restore into a new namespace, or delete them first (carefully). |
| Node agent fails to back up a volume | The Pod is not running or uses hostPath. | Back up running Pods; hostPath volumes are not supported. |
Next steps
- Quick how-tos: Back up and restore a namespace.
- The storage: MinIO / S3. etcd-level backup: etcd, CKA — Back up etcd.
- Install charts (Velero also has a Helm chart): Helm.
- At work: The 3-2-1 backup rule.
1How do you test a restore without touching production?
Restore into a new namespace with --namespace-mappings shop:shop-restore-test.
2Why must the Velero bucket be protected like a password store?
Backups contain all Kubernetes Secrets of the backed-up namespaces.