A 12-Step Guide to Velero Backup and Restore on Kubernetes

While etcd snapshots protect the control plane, Velero provides the necessary portability to move persistent volumes and API objects between disparate environments. This fundamental distinction is why platform engineers prioritize Velero as a comprehensive disaster recovery and migration tool in 2026. As clusters grow more complex, the ability to snapshot etcd remains insufficient because it does not capture the underlying data stored in persistent volumes or the specific configurations required to recreate resources in a different cloud provider. Velero bridges this gap by querying the Kubernetes API to gather objects, such as secrets, deployments, and namespaces, and packaging them into compressed tarballs stored in off-cluster object storage. This ensures that even if a complete regional failure occurs, the operational state of the environment remains preserved and ready for restoration on an entirely new set of infrastructure. The process requires a meticulous understanding of how API objects relate to physical storage, making the configuration of backup storage locations and volume snapshots a core competency for modern system administrators who must guarantee high availability.

1: Planning the Kubernetes Infrastructure

To begin this technical journey, the first step involves constructing a primary cluster that serves as the production source. Using Kind (Kubernetes in Docker) provides a controlled environment to simulate multi-node architectures without the overhead of cloud billing during the initial development phase. A configuration file named kind-prod-a.yaml should define a cluster with one control-plane node and two worker nodes. This specific layout is intentional; it allows for realistic pod scheduling across multiple workers, which is essential for testing how Velero handles volume attachments across different nodes. When the cluster is initialized, the system automatically pulls the Kubernetes 1.37 node image, which is the stable standard in early 2026. This setup ensures that the environment is consistent with modern orchestration practices while providing the isolation needed to experiment with destructive recovery scenarios. Once the nodes are in a Ready state, verifying the version with kubectl confirms that the control plane is synchronized and ready to host stateful workloads that require robust protection.

2: Provisioning the Source Cluster

Creating the source environment requires running specific command-line operations that bridge the local container runtime with the Kubernetes control plane. By running the kind create cluster command and applying the previously defined configuration, the developer initiates a sequence that bootstraps a local API server and configures the container network interface. It is vital to confirm that the context is correctly set to the new cluster to avoid accidentally deploying to other existing environments. A quick inspection of the node status should reveal three distinct entities in the Ready state, indicating that the kubelet on each node has successfully communicated its health to the primary controller. At this stage, the infrastructure is a blank slate, devoid of complex networking rules or resource quotas that might complicate the initial backup drill. Establishing this baseline allows for a clean transition into the application deployment phase, where the presence of persistent storage will finally introduce the challenges associated with stateful data management.

3: Deploying the Application Namespace

With the infrastructure in place, the focus shifts to deploying a stateful application that represents a typical e-commerce store. This application is more than just a collection of stateless containers; it relies on a PostgreSQL database managed via a StatefulSet to maintain order records. The complexity of backing up databases lies in their active memory state and open file handles, which can lead to corruption if a backup is taken mid-transaction. To mitigate this risk, the Postgres pod must be configured with specific annotations that tell Velero how to handle the persistent volume. By using the backup.velero.io/backup-volumes annotation, the node agent is instructed to include the data volume in its scan. This level of precision separates a professional recovery strategy from a basic file-level copy, providing the reliability needed for enterprise-grade data protection. The application manifests are applied to a dedicated namespace, ensuring all related resources are grouped for easier management and logical isolation from cluster-wide services.

4: Configuring Stateful Database Persistence

Successfully deploying the database requires creating a PersistentVolumeClaim that the local-path provisioner within kind can satisfy. In this scenario, a 1 GiB volume is requested to store PostgreSQL data files, providing enough space for laboratory exercises without consuming excessive host resources. Once the Postgres pod is running, it must be populated with synthetic data to serve as a benchmark for successful recovery. By executing SQL commands through the kubectl exec interface, a table named “orders” is created and filled with 500 unique entries. This specific row count acts as a verification metric; if the restoration process is flawed, the count will either fail to return or show a mismatch, signaling that data was lost during the transition to object storage. Monitoring the rollout status of the StatefulSet ensures that the database is fully initialized and that the persistent volume is correctly bound to the pod before any backup operations are initiated, preventing the capture of an empty or uninitialized storage state.

5: Implementing Pre-Backup Consistency Hooks

Integrating pre-backup hooks is a critical step in ensuring that captured data is not only present but also consistent and usable. These hooks are defined as annotations within the pod specification and instruct Velero to run specific commands immediately before a volume snapshot or copy begins. For a PostgreSQL database, the CHECKPOINT command is essential because it forces the database engine to flush all dirty buffers to the physical disk and update the transaction log. This action guarantees that the on-disk format is in a stable state from which the database can recover without lengthy log replays or the risk of corruption. Without these hooks, the backup would represent a crash-consistent state, which might work in most cases but could fail during the recovery of high-transaction systems. Automating this flush through Velero’s hook mechanism removes the burden of manual intervention, allowing for a seamless and reliable backup process that occurs entirely within the Kubernetes-native lifecycle management framework.

6: Creating Secure Object Storage

Velero requires a remote destination to store the archives it creates, and Amazon S3 is the industry standard for this purpose in 2026. Creating a globally unique bucket is the first step, and the name should often include a random suffix to avoid naming collisions with other users. It is imperative to select an AWS Region that minimizes latency and aligns with the organization’s data residency requirements. Once the bucket is created, the configuration must be hardened to prevent unauthorized access, starting with the implementation of a public access block. This security measure ensures that even if a policy is misconfigured later, the data remains inaccessible to the public internet. Furthermore, enabling default server-side encryption with AES-256 adds an additional layer of protection, ensuring that the data is encrypted before it is written to the physical storage media. These foundational steps create a secure landing zone for sensitive cluster data, which often includes decrypted secrets and application-specific configuration files that would be invaluable to an attacker.

7: Hardening the S3 Bucket Configuration

After the initial creation of the S3 bucket, the focus turns toward advanced security settings that further reduce the risk of data loss or tampering. Configuring bucket versioning is a highly recommended practice, as it allows for the recovery of previous states if a backup is accidentally deleted or overwritten. In 2026, many organizations also implement object locking with a defined retention period to defend against ransomware attacks that might attempt to encrypt or purge historical backups. While these features add to the total storage cost, the security they provide is often considered mandatory for production environments. It is also important to consider the storage class used for the backup data; while S3 Standard is suitable for the frequent access required during development and testing, moving older backups to Intelligent-Tiering or Standard-Infrequent Access can provide significant cost savings without sacrificing availability. These considerations ensure that the backup infrastructure is as resilient and cost-effective as the primary compute resources it is designed to protect.

8: Defining IAM Policies for Least Privilege

Granting Velero access to the S3 bucket must be done with the principle of least privilege in mind to minimize the blast radius of a potential credential leak. A dedicated IAM user should be created with a policy that explicitly limits actions to the specific bucket and its contents. This policy should include permissions for reading, writing, and deleting objects, as well as listing bucket contents, which Velero needs to synchronize its local metadata with the remote store. Crucially, the policy should not grant broader permissions, such as S3:CreateBucket or any administrative actions that are not strictly required for daily backup operations. By scoping the policy to specific ARNs, the administrator ensures that the Velero identity cannot interfere with other organizational resources. This rigorous approach to security is essential because the credentials will be stored as a secret within the Kubernetes cluster, making them a high-value target for lateral movement within the network if a pod is compromised.

9: Distributing Cloud Access Credentials

Once the IAM user and policy are established, the resulting access keys must be securely transferred to the Kubernetes environment. A local credentials file is created following the standard AWS CLI format, which Velero consumes during the installation process. This file contains the access key ID and the secret access key, and it must be handled with extreme care to avoid accidental commits to version control systems. Adding the filename to the .gitignore file and setting restrictive file permissions on the local machine are the first steps in securing these tokens. Within the cluster, Velero stores these credentials as a Kubernetes Secret, which it uses to authenticate requests to the AWS API. In more advanced production setups on EKS, engineers often skip static keys entirely in favor of IAM Roles for Service Accounts, which utilize OIDC to provide short-lived, rotatable tokens. Regardless of the method, ensuring that the Velero server has a stable and secure path to authenticate with the cloud provider is the foundation of all subsequent backup and restore activities.

10: Installing the Command-Line Interface

The Velero command-line interface is the primary tool used by administrators to manage backups, schedules, and restores from their local workstations. Installation varies by operating system, but on Linux, it typically involves downloading the latest v1.18 binary, verifying its checksum for security, and moving it to a directory within the system path. It is vital to ensure that the CLI version matches the server version deployed to the cluster, as discrepancies can lead to unexpected behavior or failures when processing custom resource definitions. The CLI provides a powerful set of commands that allow for deep inspection of the backup state, the ability to trigger manual runs, and the tools needed to troubleshoot failed operations. By having the CLI properly configured on the management machine, the operator gains the visibility required to oversee the entire data protection lifecycle across multiple clusters from a single, consistent interface that integrates seamlessly with existing DevOps workflows.

11: Matching Binary and Server Versions

Version inconsistency is a common pitfall that can cause significant delays during recovery operations. The Velero ecosystem moves quickly, and each minor release introduces changes to the underlying data movers and plugin APIs. For the year 2026, sticking to the v1.18 line ensures access to modern features like Kopia-based file-system backups while maintaining a stable foundation that has been thoroughly vetted by the community. When a new CLI is installed, running the velero version --client-only command confirms that the local binary is ready. Later, after the server is installed, the full version command will show both the client and server versions, which should ideally be identical. This alignment ensures that the manifests generated by the CLI are fully compatible with the server’s expectations, preventing errors during the installation of CRDs or the creation of backup objects. Keeping a close eye on versioning also facilitates easier upgrades in the future, as the migration paths between versions are well-documented and predictable once the baseline is correctly established.

12: Deploying Velero Server Components

Installing the Velero server into the source cluster is the moment when the theoretical configuration becomes an operational reality. The velero install command uses several flags to specify the AWS provider, relevant plugins, and the target S3 bucket. Crucial for this lab environment is the inclusion of the --use-node-agent and --uploader-type kopia flags, which enable the modern data movement path for persistent volumes. Since kind clusters do not support traditional cloud-native snapshots, the node-agent provides a way to back up volume data by accessing files directly from the underlying host. The installation process creates a dedicated namespace and deploys the Velero controller along with the node-agent as a DaemonSet. This ensures that every worker node has a local agent capable of performing volume copies. Monitoring the pod status and the logs of the newly created deployment allows administrators to confirm that the server has successfully authenticated with S3 and is ready to process its first backup request.

13: Configuring the AWS Storage Plugin

The AWS plugin is a separate component that Velero uses to translate generic backup requests into provider-specific API calls. During installation, the plugin version must be selected from a compatibility table that aligns it with the Velero server version. This plugin handles the complexities of S3 communication, including multipart uploads for large files and various storage classes. It also manages the lifecycle of objects in the bucket, ensuring they are correctly labeled and organized for easy retrieval. Configuring the plugin requires providing the correct AWS Region and the path to the credentials secret created earlier. If the plugin is misconfigured, Velero will be unable to validate its backup storage location, and all backup attempts will fail immediately. This layer of abstraction allows Velero to remain provider-agnostic while still offering deep integration with the unique features of every major cloud storage platform.

14: Initializing the Kopia Data Mover

With the server running and the plugin configured, the system initializes the Kopia repository within the S3 bucket to manage volume data. Kopia is a powerful, open-source backup tool that provides deduplication, compression, and encryption out of the box. By using Kopia as the uploader, Velero can significantly reduce the amount of data transferred to the cloud, as only unique blocks are uploaded during each backup run. This is particularly beneficial for large database volumes where only a small percentage of data changes between backups. The node-agent on each cluster node coordinates with the Velero server to identify which volumes need to be processed and then uses Kopia to sync the files to the remote repository. This shift toward Kopia modernizes the Velero data path, replacing older, slower methods with a more efficient and resilient architecture. Monitoring the initialization of this repository is a key step in verifying that the data mover is ready to handle the stateful components of the application.

15: Validating Backup Storage Locations

Before proceeding with the first backup, the administrator must verify that the Backup Storage Location is in the Available phase. This status indicates that the Velero server has successfully performed a round-trip test to the S3 bucket, proving that it can list, read, and write objects using the provided credentials. If the status shows as Unavailable, it often points to issues with IAM permissions, incorrect bucket names, or networking restrictions that prevent the cluster from reaching the S3 API. Troubleshooting these issues early is vital, as a faulty storage location will block both manual and scheduled backups. Using the velero backup-location get command provides a quick summary of the location’s health and the time it was last validated. This validation is not a one-time event; Velero continuously checks the status of its storage locations to ensure it can always fulfill its mandate of protecting the cluster’s state, providing a reliable heartbeat for the entire backup infrastructure.

16: Executing the First Manual Backup

The first manual backup serves as a proof of concept for the entire setup, verifying that all components are working in harmony. By targeting the shop namespace, the administrator instructs Velero to capture every resource associated with the application, including the crucial Postgres persistent volume. The command is run with the –wait flag, which causes the CLI to block until the backup reaches a terminal state, providing immediate feedback on its success or failure. During this process, Velero generates a unique backup name, creates a record in the cluster, and triggers the pre-backup hooks in the Postgres pod. The Node Agent then identifies the data volume and begins uploading the database files to the Kopia repository. Watching the transition from InProgress to Completed is a satisfying milestone that confirms the application’s state is safely mirrored in the cloud, protected from local cluster failures or accidental deletions.

17: Investigating Backup Logs and Metadata

A successful backup phase is only the beginning; a diligent administrator must inspect the logs and metadata to ensure no warnings or partial failures occurred. The velero backup describe command provides a wealth of information, including the total number of items backed up and the status of each volume. If any item was skipped or a hook failed to execute, it will be noted in this summary. For a deeper dive, the velero backup logs command retrieves the detailed execution trace directly from the S3 bucket. These logs are invaluable for identifying silent issues, such as permission errors on specific subdirectories or slow network throughput that might affect backup windows. Reviewing these logs after the first run ensures that the backup is truly comprehensive and that the captured data is exactly what is needed for a full recovery. This level of scrutiny builds confidence in the safety net and ensures that the system is ready for the automation phase that follows.

18: Automating Nightly Backup Schedules

Manual backups are insufficient for production systems where data changes constantly, necessitating the creation of automated schedules. A Velero Schedule is a custom resource that uses a standard cron expression to define when backups should occur. Setting a schedule for 02:00 UTC ensures that the backup runs during off-peak hours, minimizing the impact of pre-backup hooks on application performance. Each time the schedule triggers, Velero creates a new backup object with a timestamped name, following the same logic as a manual backup. This automation ensures that the Recovery Point Objective is met without requiring human intervention. In addition to the timing, the schedule defines which namespaces to include and applies any necessary resource filters. By managing these schedules as code within a Git repository, the platform team can ensure that every new environment is automatically enrolled in the backup program, reducing the risk of human error and ensuring consistent data protection across the entire fleet of clusters.

19: Defining Retention and Expiration Policies

As the number of automated backups grows, managing storage costs becomes a primary concern addressed through time-to-live (TTL) settings. Every backup created by Velero has an associated TTL that determines how long it remains in the S3 bucket before being automatically deleted. For nightly backups, a 30-day retention period is a common standard, providing a month-long window to recover from accidental deletions or silent data corruption. Once the TTL expires, the Velero server’s garbage collection process removes objects from the bucket and deletes the corresponding records from the cluster. This automated lifecycle management prevents object storage costs from spiraling out of control and ensures that only relevant recovery points are maintained. It is important to balance the need for historical data with storage budget practicalities, which often leads teams to create multiple schedules with different retention periods, such as daily backups kept for a month and weekly backups kept for a year.

20: Preparing the Disaster Recovery Cluster

The ultimate test of any backup strategy is the ability to restore data into a completely different environment, simulating a disaster recovery scenario. A second cluster, named kind-prod-b, is created to serve as this target. This cluster should be identical in version to the source cluster to minimize compatibility issues during initial testing. Installing Velero into this new cluster follows the same process as before, using the same bucket and credentials, but with one critical difference: the backup storage location is patched to be read-only. This ensures that the recovery cluster can see and pull data from the bucket but cannot accidentally delete or modify the backups that the source cluster still relies on. This isolation is a fundamental security practice in disaster recovery planning, protecting the integrity of the backup archives while providing the visibility needed to perform a full restoration. The sync process then brings the metadata for the source backups into the new cluster’s local state.

21: Mapping Storage Classes for Migration

One common challenge when restoring to a new cluster is the discrepancy between storage class names in different environments or cloud providers. A Persistent Volume Claim that requests a specific class on the source cluster will fail to bind on the target if that class does not exist. Velero solves this through a mapping mechanism defined in a ConfigMap. Before the restoration begins, the administrator creates a mapping that instructs the Velero restore plugin to substitute the old storage class name with a valid one for the new environment. This transformation happens in-flight as the objects are being recreated, ensuring that the new persistent volumes are successfully provisioned by the target cluster’s storage controller. This capability is essential for cross-cloud migrations, where a source cluster on one provider might use a specific SSD class that must be translated into an equivalent high-performance volume on the destination. Without this remapping, the restoration would stall, leaving pods in a Pending state and delaying the recovery of critical services.

22: Enabling Read-Only Bucket Access

Configuring the disaster recovery (DR) cluster to access the backup bucket in read-only mode is a vital safeguard against operational errors. When several clusters share the same object storage backend, there is a risk that a misconfigured lifecycle policy or an accidental deletion command from a non-production cluster could purge the primary backup archives. By setting the accessMode to ReadOnly in the BackupStorageLocation specification, the Velero server in the DR cluster is restricted to list and get operations. This means it can populate its local cache with the list of available backups and download data for restoration, but it is forbidden from making any destructive changes. In 2026, many organizations will take this further by using different IAM identities for the source and DR clusters, with the latter having an IAM policy that lacks the s3:DeleteObject permission entirely. This defense-in-depth approach ensures that the “golden copy” of the data remains protected throughout the entire testing and recovery process, providing peace of mind to the operations team.

23: Initiating the Restoration Process

With the target cluster prepared and the metadata synced, the administrator initiates the restore command, targeting the latest successful backup. This process triggers a sequence in which Velero recreates the namespaces, secrets, and deployments in the new cluster. For stateful components like PostgreSQL, the node agent pulls the volume data from the Kopia repository and populates the newly provisioned persistent volumes. During this phase, Velero injects an init container named restore-wait into the pods, which prevents the application containers from starting until the data restoration is complete. This ensures that the database engine does not attempt to initialize on an empty disk while the restore agent is still writing files. Monitoring the restore progress through the CLI provides real-time updates on the number of items restored and any errors that occur. The successful completion of this phase is the primary goal of the entire exercise, moving the application from a dormant state in the cloud back into a live, running environment.

24: Verifying Data Consistency and Integrity

A completed restore phase does not guarantee that the application is functional; the final step is to verify the integrity of the data within the restored database. By executing a count query on the orders table in the new Postgres pod, the administrator confirms that all 500 records are present and accounted for. This check proves that the pre-backup hooks worked correctly, the Kopia uploader captured all blocks, and the restore process successfully reassembled the volume. Beyond simple row counts, it is also important to check for the presence of application secrets and the correct configuration of service endpoints. In a real-world scenario, this verification might include running a suite of automated smoke tests to ensure that the web front end can communicate with the database and that users can still place orders. Proving that the data survived the journey between clusters is the ultimate validation of the backup strategy, transforming the backup from a theoretical asset into a proven recovery mechanism.

25: Performing Selective Resource Recovery

Not every incident requires a full cluster restoration; often, you only need to recover a single deleted secret or a specific deployment corrupted by a bad configuration change. Velero provides powerful filtering options that allow for the precise restoration of individual resources or namespaces. By using label selectors or resource filters, administrators can restore exactly what is needed without affecting the rest of the cluster. It is also possible to restore a namespace under a different name, which is incredibly useful for side-by-side comparisons between the current state and a known good backup. This selective recovery capability significantly reduces the resolution time for minor incidents and provides a flexible tool for developers who need to recover older versions of their manifests. Mastering these selective restoration techniques allows operations teams to respond with precision to a wide variety of failure modes, from minor human errors to complex application regressions that require a rollback of specific stateful components.

26: Monitoring Performance with Prometheus

Observability is the final pillar of a robust backup strategy, ensuring that failures are detected and addressed before they impact recovery times. Velero exposes a Prometheus-compatible metrics endpoint that provides insights into backup success rates, durations, and the size of the stored data. By scraping these metrics, the platform team can build dashboards that visualize the health of the backup pipeline across all clusters in the organization. These metrics reveal trends, such as increasing backup times, which might indicate a need for more efficient filtering or a transition to a faster storage class. They also provide a historical record of backup performance, which is often required for compliance audits. In 2026, integrating Velero metrics into a centralized observability platform is standard practice, allowing engineers to correlate backup activity with cluster-wide performance events and ensuring that the data protection layer remains as transparent and accountable as any other production service.

27: Establishing Reliable Alerting Rules

Metrics are only useful when paired with an alerting system that notifies the team when things go wrong. A critical alert is the “backup staleness” rule, which triggers if no successful backup has been recorded for a specific schedule within the last 25 hours. This catches silent failures where a schedule might be paused or credentials may have expired without triggering an immediate error. Other important alerts include those for partial failures, which might indicate that a specific volume is no longer being protected, and outright failures that require immediate investigation. By routing these alerts to an on-call system, the organization ensures that backup health is maintained around the clock. This proactive approach prevents the nightmare scenario of discovering that backups have been failing for weeks only when they are needed for recovery. Reliable alerting transforms Velero from a tool that is periodically checked into a managed service that guarantees continuous data protection through automated oversight.

28: Scripting the Automated Recovery Drill

The complexity of the manual steps involved in a full recovery suggests that automation is the only way to ensure the process remains repeatable and error-free. By encapsulating the entire drill—from creating a backup on the source cluster to verifying rows on the target—into a shell script, the team can run recovery tests on a weekly basis. This script acts as a living document of the recovery procedure, ensuring that any changes in the infrastructure are reflected in the drill logic. It automates the deletion of old namespaces, the synchronization of metadata, and the final validation checks, providing a clear “pass” or “fail” signal. In 2026, these automated drills are often integrated into CI/CD pipelines, where a successful recovery test is a prerequisite for promoting a new version of the application to production. This continuous validation ensures that the organization’s recovery capability is always in sync with its deployment velocity, providing a truly resilient foundation for modern Kubernetes operations.

29: Securing Production Backup Pipelines

Transitioning from a test environment to a production setting requires a significant focus on hardening identity and access management for Velero. In 2026, the use of static AWS access keys is largely discouraged in favor of more secure, short-lived credential mechanisms. For clusters running on Amazon EKS, implementing IAM Roles for Service Accounts provides a seamless way to associate a Kubernetes service account with an AWS IAM role. This setup uses OIDC to issue temporary tokens that are automatically rotated, eliminating the risk of long-lived keys being leaked or stolen. Additionally, the network path between the cluster and the S3 API should be secured using VPC endpoints, ensuring that backup data never traverses the public internet. By combining these identity and network security measures, the platform team can protect sensitive data within backups and ensure that the backup infrastructure itself does not become a security liability for the organization.

30: Strategic Improvements for Continuous Resilience

The implementation of Velero across the Kubernetes environment provided a significant boost to the organization’s ability to handle catastrophic failures and complex migrations. Throughout the process, the team discovered that the true value of a backup system lay not in data storage, but in the verified ability to restore that data under pressure. By moving beyond simple manifest backups and embracing file-system consistency with Kopia and pre-backup hooks, the reliability of database recoveries reached a level that allowed for a reduction in recovery time objectives. The use of automated drills proved essential, as it identified subtle configuration drift that would have otherwise compromised a real-world restoration effort. Looking ahead, the focus shifted toward expanding these capabilities to include cross-region replication and the use of immutable object storage to defend against evolving security threats. The maturity of the Velero ecosystem in 2026 established it as the definitive choice for teams that demanded a portable, scalable, and highly observable approach to data protection in the cloud-native era.

Trending

Subscribe to Newsletter

Stay informed about the latest news, developments, and solutions in data security and management.

Invalid Email Address
Invalid Email Address

We'll Be Sending You Our Best Soon

You’re all set to receive our content directly in your inbox.

Something went wrong, please try again later

Subscribe to Newsletter

Stay informed about the latest news, developments, and solutions in data security and management.

Invalid Email Address
Invalid Email Address

We'll Be Sending You Our Best Soon

You’re all set to receive our content directly in your inbox.

Something went wrong, please try again later