Kokil Thapa - Professional Web Developer in Nepal
Freelancer Web Developer in Nepal with 15+ Years of Experience

Kokil Thapa is an experienced full-stack web developer focused on building fast, secure, and scalable web applications. He helps businesses and individuals create SEO-friendly, user-focused digital platforms designed for long-term growth.

Velero: Backup and Restore Kubernetes

By Kokil Thapa | Last reviewed: August 2026

Running production workloads on Kubernetes without a verified backup strategy is a liability waiting to materialize. While etcd snapshots protect cluster state, they do not capture application data, persistent volumes, or cross-cluster migration requirements. Implementing Velero: Backup and Restore Kubernetes provides the necessary abstraction layer to secure both cluster resources and persistent storage against accidental deletion, corruption, or regional outages. For teams managing critical infrastructure, understanding this tool is as fundamental as configuring reliable CI/CD pipelines or securing application deployments.

How does Velero: Backup and Restore Kubernetes actually work?

Understanding the internal mechanics of Velero prevents misconfiguration during high-stress recovery scenarios. Unlike simple database dumps or raw disk imaging, Velero operates as a control-plane orchestrator that coordinates multiple subsystems. When you initiate a backup, the Velero server pod queries the Kubernetes API server for resource definitions (Deployments, Services, ConfigMaps) and simultaneously instructs storage providers to snapshot attached volumes.

Velero Backup Data FlowK8s API ServerResource MetadataVelero ServerOrchestrator PodS3 / Object StoreManifests + TarballsCSI / Node AgentVolume Snapshots
Core architecture of Velero: Backup and Restore Kubernetes showing metadata flow to object storage and volume snapshot coordination

The process follows a strict sequence that ensures consistency. First, Velero discovers all resources matching your backup criteria (namespace labels, resource types, or selectors). Second, it serializes these resources into JSON/YAML tarballs and uploads them to your configured object storage bucket. Third, if persistent volumes are included, it triggers either a CSI VolumeSnapshot or a filesystem-level backup via the node-agent DaemonSet. Finally, it records the backup status and expiration metadata back into the cluster as Custom Resources.

A common mistake I see in production environments is assuming Velero backs up the actual etcd database. It does not. Velero reconstructs cluster state by re-applying Kubernetes manifests. This distinction matters because custom resources managed by operators outside the standard API may require explicit annotation or plugin support to be captured correctly. Always verify that your specific CRDs are included in backup logs before trusting the system for disaster recovery.

How do you install and configure Velero with S3-compatible storage?

Installation requires three components: the Velero CLI on your local machine, the Velero server deployment in the cluster, and credentials for your object storage provider. In 2026, Helm is the standard installation method, replacing the deprecated `velero install` CLI command for production setups. The current stable release is Velero v1.16.x, which requires Kubernetes 1.28+ and supports modern CSI snapshot APIs.

Preparing S3-compatible storage credentials

Whether you use AWS S3, MinIO, DigitalOcean Spaces, or a Nepal-based cloud provider's object store, Velero needs IAM-style credentials. Create a file named credentials-velero:

[default]
aws_access_key_id = YOUR_ACCESS_KEY
aws_secret_access_key = YOUR_SECRET_KEY

For non-AWS providers, you must also specify the region and S3 URL in your Helm values. Never commit these credentials to Git. Use sealed secrets, external-secrets operator, or inject them directly during the Helm install step.

Helm installation with production defaults

Create a values.yaml that enables node-agent for filesystem backups and configures your specific storage backend:

configuration:
  backupStorageLocation:
    - name: default
      provider: aws
      bucket: my-k8s-backups
      config:
        region: us-east-1
        s3ForcePathStyle: true
        s3Url: https://nyc3.digitalocean.com
  volumeSnapshotLocation:
    - name: default
      provider: aws
      config:
        region: us-east-1

deployNodeAgent: true
nodeAgent:
  privileged: true
  resources:
    requests:
      cpu: 500m
      memory: 512Mi
    limits:
      cpu: 1000m
      memory: 1Gi

credentials:
  useSecret: true
  secretName: cloud-credentials

initContainers:
  - name: velero-plugin-for-aws
    image: velero/velero-plugin-for-aws:v1.11.0
    volumeMounts:
      - mountPath: /target
        name: plugins

Install using the official chart repository:

helm repo add vmware-tanzu https://vmware-tanzu.github.io/helm-charts
helm repo update
helm install velero vmware-tanzu/velero \
  --namespace velero \
  --create-namespace \
  --values values.yaml \
  --wait

After installation, verify connectivity immediately. Running velero backup-location get should show "Available" status within 60 seconds. If it shows "Unavailable", check network policies, credential formatting, and bucket permissions. I have debugged dozens of failed installations where the issue was simply a missing s3:ListBucket permission on the IAM policy. Velero requires read/write/list access to function.

What is the difference between CSI snapshots and filesystem backups?

Choosing the wrong volume backup method is the most frequent cause of slow restores and inflated storage costs. Velero supports two distinct approaches, each with different performance characteristics and infrastructure requirements. Understanding this trade-off is essential when architecting cloud hosting solutions for clients with varying budget and RPO constraints.

CriteriaCSI Volume SnapshotsFilesystem (Restic/Kopia)
SpeedNear-instant (cloud-native)Slow (file-by-file copy)
Storage EfficiencyIncremental at block levelDeduplicated but higher overhead
PortabilityCloud/vendor lockedWorks across any storage class
ConsistencyCrash-consistent onlyCan quiesce apps via hooks
Infrastructure ReqRequires CSI driver supportOnly needs node-agent pods
Best ForLarge databases, same-cloud DRCross-cloud migration, NFS, legacy
Backup Method Decision TreeNeed Cross-Cloud Migration?YES → Filesystem BackupNO → Check CSI SupportCSI Available? → Use CSINo CSI → Fallback Filesystem
Decision framework for selecting CSI vs filesystem backup methods in Velero: Backup and Restore Kubernetes workflows

In practice, I recommend CSI snapshots as the default for any cluster running on major cloud providers (AWS EBS, GCP PD, Azure Disk) with a compatible CSI driver. The performance difference is dramatic: a 500GB PostgreSQL volume takes seconds to snapshot via CSI but hours via filesystem backup. However, filesystem backups remain indispensable for NFS volumes, hostPath mounts, or migration scenarios where source and destination clouds differ.

When using filesystem backups, ensure node-agent pods have sufficient CPU and memory limits. Under-resourced agents cause backup timeouts on large volumes. Set requests to at least 500m CPU and 512Mi RAM per node, scaling up based on concurrent backup load. Monitor node-agent logs for "context deadline exceeded" errors, which indicate resource starvation rather than network issues.

How do you schedule automated backups and verify integrity?

Manual backups provide false confidence. Production systems require automated schedules with verification loops. Velero uses Schedule resources to define cron-based backup policies, but scheduling alone is insufficient without integrity testing.

Creating tiered backup schedules

Implement a multi-tier strategy that balances RPO, storage costs, and recovery granularity:

# Hourly namespace-level backups for critical apps
apiVersion: velero.io/v1
kind: Schedule
metadata:
  name: production-hourly
  namespace: velero
spec:
  schedule: "0 * * * *"
  template:
    includedNamespaces:
      - production-*
    snapshotVolumes: true
    ttl: 24h0m0s
    storageLocation: default
    volumeSnapshotLocations:
      - default

# Daily full-cluster backup with 30-day retention
apiVersion: velero.io/v1
kind: Schedule
metadata:
  name: cluster-daily
  namespace: velero
spec:
  schedule: "0 2 * * *"
  template:
    snapshotVolumes: true
    ttl: 720h0m0s
    excludeResources:
      - events
      - events.events.k8s.io

Exclude ephemeral resources like Events, ReplicaSets, and EndpointSlices unless you have specific forensic requirements. These resources regenerate automatically and bloat backup storage unnecessarily.

Automated restore verification

A backup you cannot restore is worthless. Implement weekly automated restore tests into a separate validation namespace or staging cluster. Use Velero's --namespace-mappings flag to avoid overwriting production:

velero restore create verify-$(date +%Y%m%d) \
  --from-backup production-hourly-20260822-020000 \
  --namespace-mappings production-app:verify-app \
  --wait

After restore completes, run health checks against the restored workloads. Verify pod readiness, database connectivity, and data integrity checksums. I integrate this verification into DevOps automation pipelines that alert on failure. Silent backup corruption is worse than no backups at all because it creates complacency.

How do you troubleshoot failed restores and partial backups?

Restore failures are inevitable in complex environments. Systematic debugging separates quick recoveries from extended outages. Velero exposes detailed logs and describe commands that pinpoint root causes when interpreted correctly.

  1. Check restore status first: Run velero restore describe <name> to see warnings and errors summary. Partial failures show as warnings; complete failures show as errors.
  2. Inspect pod logs: kubectl logs -n velero deploy/velero reveals API-level issues like RBAC denials or CRD conflicts. Node-agent logs (kubectl logs -n velero ds/node-agent) expose volume mount or snapshot problems.
  3. Validate resource compatibility: Restores fail when target clusters lack required CRDs, operators, or storage classes. Pre-flight checks should verify these dependencies exist before initiating restore.
  4. Review hook execution: If using pre/post-restore hooks for database quiescing, check hook container logs. Failed hooks often leave applications in inconsistent states even when the restore reports success.
  5. Examine download URLs: For manifest-only issues, download the backup tarball via velero backup download and inspect contents locally. Corrupted uploads or incomplete transfers become visible here.
Restore Failure Diagnostic FlowRestore Failed / PartialCheck Warnings/ErrorsInspect Velero LogsVerify Target ClusterRBAC / Permission FixStorage / Network FixInstall Missing CRDsRetry Restore After Fix
Systematic troubleshooting workflow for Velero: Backup and Restore Kubernetes restore failures

One recurring issue involves PersistentVolumeClaim binding during restore. If the target cluster uses different storage classes or availability zones, PVCs may remain pending indefinitely. Always map storage classes explicitly using --storage-class-mappings when restoring across environments. Another gotcha: restoring StatefulSets with ordered pod creation can timeout if headless services aren't created first. Velero handles this automatically in most cases, but custom operators sometimes interfere with resource ordering.

For partial backups where some volumes succeeded but others failed, treat the entire backup as compromised. Do not attempt selective volume restoration unless you fully understand application consistency boundaries. It is safer to restore from the last known-good complete backup and replay transaction logs than to risk data corruption from mismatched volume timestamps.

Implementing Reliable Velero: Backup and Restore Kubernetes Strategies

Effective Velero: Backup and Restore Kubernetes implementation requires treating backups as production infrastructure, not an afterthought. Start with CSI snapshots for performance-critical workloads, supplement with filesystem backups for portability, and automate verification weekly. Document your RTO/RPO targets explicitly and test against them quarterly under realistic conditions. Remember that backup reliability depends entirely on restore testing frequency. If you need assistance designing disaster recovery architectures or auditing existing Kubernetes backup configurations, reach out to discuss your infrastructure requirements.

Frequently Asked Questions

Velero is an open-source tool that backs up Kubernetes cluster resources and persistent volumes to object storage like S3 or MinIO. Unlike simple etcd snapshots, it captures API objects, namespaces, and volume data together, enabling full cluster restoration or migration across different cloud providers and environments.

Velero software is free and open-source. Costs are purely for object storage and compute. Expect NPR 500 to 2,000 monthly (USD 4–15) for S3-compatible storage holding typical application backups, plus minimal EC2 or VPS overhead for the Velero pod itself.

Yes. Velero uses CSI snapshots or its native Restic/Kopia integration to back up PersistentVolumeClaims. On AWS EBS or DigitalOcean Volumes, CSI is preferred for speed. For filesystem-level backups without snapshot support, Kopia handles encrypted, deduplicated uploads to object storage reliably in my experience.

Yes. Velero decouples backups from infrastructure by storing manifests and volume data in portable object storage. You can restore from AWS S3 to a Nepali VPS running MicroK8s, provided storage classes and volume sizes are compatible. Namespace mapping and resource filtering handle provider-specific differences during restoration.

Use the official Helm chart or velero install CLI with v1.14+. Specify your object storage provider, bucket, and credentials secret. For Nepal-based projects on budget VPS infrastructure, I configure MinIO as the backend with Kopia for volume backups, avoiding expensive cloud snapshot APIs while maintaining reliable disaster recovery.

Etcd snapshots only capture cluster state at the database level, missing persistent volume data entirely. Velero backs up both API resources and volume contents to external storage. In practice, I use etcd snapshots for quick control-plane recovery and Velero for full application-level disaster recovery including user-uploaded files and databases.

Schedule based on RPO requirements. For legal-tech portals handling client documents, I configure hourly incremental backups via Kopia and daily full backups. Stateless applications may only need weekly schedules. Always test restores quarterly; untested backups are functionally useless regardless of frequency or retention policy configuration.

Yes. When using Kopia or Restic as the volume backup method, all data is encrypted client-side before upload using a repository key you manage. Object storage server-side encryption adds another layer. Store the encryption key separately from the cluster; losing it means permanent data loss even if backups exist intact.

This usually indicates volume backup failures while API resources succeeded. Check velero backup logs for timeout errors or permission issues on PVCs. Common causes include misconfigured CSI drivers, insufficient S3 permissions, or pods not mounting volumes correctly. In my deployments, switching from Restic to Kopia resolved many timeout-related partial failures.

Yes. Use --include-namespaces during backup creation or define namespace selectors in Schedule resources. For multi-tenant platforms like Ajako Deal, I backup vendor and customer namespaces separately with different retention policies. Excluding kube-system prevents restoring cluster-managed resources that conflict with fresh installations during disaster recovery.

Run velero backup describe with --details to inspect included resources and volume snapshots. More importantly, perform test restores to isolated namespaces monthly. Automated validation scripts checking pod readiness and data integrity post-restore catch silent failures. Backups showing Completed status can still contain corrupted or incomplete volume data undetectable without restoration testing.

S3-compatible storage works universally. For Nepal-based clients avoiding international data transfer, I deploy MinIO on local VPS infrastructure within Kathmandu data centers. Cloudflare R2 offers zero egress fees for global access. AWS S3 remains viable but adds latency and USD-denominated costs; factor exchange rate volatility into long-term budget planning.

Velero does not guarantee application-consistent database snapshots automatically. For MySQL or PostgreSQL, implement pre-backup hooks executing FLUSH TABLES WITH READ LOCK or pg_start_backup before volume capture. Alternatively, dump databases to PVCs via CronJobs before scheduled Velero runs. Application-consistent backups require explicit coordination; crash-consistent defaults risk corruption.

Yes. Backup the WordPress namespace including PVCs for uploads and database volumes. Restore to the target cluster, updating StorageClass references and ingress annotations as needed. For WooCommerce stores like Petals Nepal, I validate media library integrity and database connectivity post-migration. Test thoroughly on staging before cutting over production traffic.

Missing RBAC permissions preventing volume access, incorrect timezone settings causing schedule drift, and untested credential rotation breaking automated backups. Another frequent issue is insufficient object storage lifecycle policies filling buckets unexpectedly. Always configure monitoring alerts for failed backups and review velero schedule get output weekly to confirm execution history matches expectations.

Share this article

Quick Contact Options
Choose how you want to connect me: