Kubernetes is declarative until your etcd fails and you realize your manifests were not all in Git. Velero backs up cluster state and persistent volume data so you can recover from disasters.
What Velero Backs Up
- Kubernetes resources — deployments, services, configmaps, secrets, CRDs
- Persistent volumes — actual data on PVCs via volume snapshots
- Namespace-scoped or cluster-scoped — back up specific namespaces or everything
Installation
# Install Velero CLI
brew install velero
# Install Velero in cluster with AWS S3 backend
velero install \
--provider aws \
--plugins velero/velero-plugin-for-aws:v1.9 \
--bucket my-velero-backups \
--backup-location-config region=eu-west-1 \
--snapshot-location-config region=eu-west-1 \
--secret-file ./credentials-veleroVelero stores backups in object storage (S3, GCS, Azure Blob). Volume snapshots use your cloud provider's snapshot API.
Master this topic with hands-on labs
Go beyond reading — build real projects in sandboxed environments with expert video guidance.
Browse Courses →Manual Backup
# Back up everything
velero backup create full-backup
# Back up a specific namespace
velero backup create prod-backup \
--include-namespaces production
# Back up specific resources
velero backup create secrets-backup \
--include-resources secrets \
--include-namespaces production
# Check backup status
velero backup describe full-backup
velero backup logs full-backupScheduled Backups
# Daily backup at 2 AM, retain for 30 days
velero schedule create daily-backup \
--schedule="0 2 * * *" \
--ttl 720h \
--include-namespaces production,staging
# Hourly backup of critical namespace
velero schedule create critical-hourly \
--schedule="0 * * * *" \
--ttl 168h \
--include-namespaces paymentsOr as a Kubernetes resource:
apiVersion: velero.io/v1
kind: Schedule
metadata:
name: daily-production
namespace: velero
spec:
schedule: "0 2 * * *"
template:
includedNamespaces:
- production
ttl: 720h0m0s
storageLocation: default
volumeSnapshotLocations:
- defaultGet weekly IT automation tips
Docker, Ansible, Terraform, MLOps — curated insights delivered to your inbox. No spam.
Subscribe Free →Restore
# Restore everything from a backup
velero restore create --from-backup full-backup
# Restore to a different namespace
velero restore create --from-backup prod-backup \
--namespace-mappings production:production-restored
# Restore only specific resources
velero restore create --from-backup prod-backup \
--include-resources deployments,services
# Check restore status
velero restore describe <restore-name>Disaster Recovery Scenarios
Namespace Deletion
Someone ran kubectl delete namespace production:
velero restore create prod-recovery \
--from-backup daily-backup \
--include-namespaces productionCluster Migration
Move workloads to a new cluster:
# On the old cluster: create backup
velero backup create migration-backup
# On the new cluster: install Velero with the same storage backend
velero install --provider aws --bucket my-velero-backups ...
# Restore
velero restore create --from-backup migration-backupPersistent Volume Recovery
If a PVC's data is corrupted:
# Delete the corrupted PVC
kubectl delete pvc data-volume -n production
# Restore just that PVC from backup
velero restore create pvc-recovery \
--from-backup daily-backup \
--include-resources persistentvolumeclaims \
--include-namespaces production \
--selector app=my-databaseBest Practices
- Test restores regularly — a backup you have never restored is not a backup
- Back up to a different region — protect against regional outages
- Include resource quotas and RBAC — cluster-scoped resources are easy to forget
- Monitor backup success — alert on failed backups
- Document restore procedures — the person restoring may not be the person who set it up
# Quick restore test: restore to a test namespace
velero restore create test-restore \
--from-backup daily-backup \
--namespace-mappings production:restore-test
# Verify, then clean up
kubectl delete namespace restore-test---
Ready to go deeper? Master Kubernetes operations with hands-on courses at CopyPasteLearn.
Ready to learn by doing?
Stop reading tutorials — start building. Expert video courses with hands-on labs in real sandboxed environments.
Related Articles
Longhorn Cloud Native Storage Guide
Longhorn is a lightweight distributed storage system for Kubernetes. Learn how Longhorn provides replicated block storage, snapshots, and backups.
Rook Ceph Kubernetes Storage Guide
Rook deploys Ceph distributed storage on Kubernetes for block, file, and object storage. Learn how to set up Rook-Ceph for persistent volumes, shared.
Minio S3 Compatible Object Storage
MinIO provides S3-compatible object storage you can self-host anywhere. Learn how to deploy MinIO on Kubernetes for backups, artifacts, ML datasets.
Wasm on Kubernetes with Spin
WebAssembly (Wasm) runs serverless functions on Kubernetes with sub-millisecond cold starts. Learn how Fermyon Spin and SpinKube bring Wasm workloads to your.
Werf CI/CD for Kubernetes Guide
Werf is a CNCF tool that combines building, publishing, and deploying to Kubernetes into a single workflow. Learn how werf handles Dockerfiles, Helm charts.
What is Context7?
Discover Context7, the tool that gives version-specific, accurate documentation to LLMs and AI code editors like Cursor and Claude. No more hallucinated APIs.
Explore topics
Browse more articles on the topics covered here.