LinuxCommandLibrary

velero

Backup and restore Kubernetes cluster resources

TLDR

Create a backup containing all resources

$ velero backup create [backup_name]
copy

List all backups
$ velero backup get
copy

Delete a backup
$ velero backup delete [backup_name]
copy

Create a weekly backup, each living for 90 days (2160 hours)
$ velero schedule create [schedule_name] --schedules="[@every 7d]" --ttl [2160h0m0s]
copy

Create a restore from the latest successful backup triggered by specific schedule
$ velero restore create --from-schedule [schedule_name]
copy

SYNOPSIS

velero <command> [<subcommand>] [<flags>]

Common examples:
velero install --provider aws --bucket my-velero-bucket
velero backup create <backup-name> --include-namespaces <namespace>
velero restore get

PARAMETERS

--kubeconfig <path>
    Path to the kubeconfig file to use for Kubernetes client configuration. Overrides the default kubeconfig lookup behavior.

--context <name>
    The name of the kubeconfig context to use. If not specified, the current context from kubeconfig is used.

--namespace <name>
    The Kubernetes namespace in which the Velero server is running and where Velero resources are stored. Defaults to 'velero'.

--log-level <level>
    Logging level for the Velero CLI output (e.g., 'debug', 'info', 'warn', 'error'). Defaults to 'info'.

--output <format>
    Output format for commands that display resources (e.g., 'table', 'json', 'yaml'). Defaults to 'table'.

Subcommand-specific Flags
    Most Velero operations are performed via specific subcommands (e.g., backup, restore, install, schedule). Each subcommand has its own unique set of flags and options relevant to its operation, which can be viewed using the --help flag (e.g., velero backup create --help).

DESCRIPTION

Velero is an open-source tool designed to safely back up, restore, and migrate Kubernetes cluster resources and persistent volumes. It provides a robust solution for disaster recovery and cluster migration, ensuring business continuity for containerized applications.
Velero operates by taking snapshots of persistent volumes and backing up Kubernetes API objects, allowing for point-in-time recovery of your cluster's state. It captures the state of your cluster's resources, including deployments, services, configurations, and persistent data, making it invaluable for recovering from accidental deletions, cluster failures, or for migrating applications between clusters.
It requires a server-side component (the Velero server) running within the Kubernetes cluster and a command-line interface (CLI) for user interaction, enabling operations like creating backups, restoring data, and managing schedules for automated backups.

CAVEATS

Velero is not a standard Linux utility but rather a command-line client for a Kubernetes application. Its full functionality requires a Velero server component to be installed and running within a Kubernetes cluster. Furthermore, its ability to back up and restore persistent volumes is highly dependent on the configuration of appropriate object storage (for backup data) and volume snapshot providers (for persistent volume snapshots) within the specific cloud or on-premise environment.

ARCHITECTURE

Velero operates on a client-server model. The Velero CLI, used on a user's local machine or CI/CD pipeline, interacts with the Velero server components running as deployments and custom resources within a Kubernetes cluster. The server coordinates backup and restore operations by interacting with the Kubernetes API, object storage providers, and volume snapshot providers to manage cluster state and data.

STORAGE BACKENDS AND PLUGINS

Velero supports a wide range of object storage providers (e.g., AWS S3, Google Cloud Storage, Azure Blob Storage, MinIO) for storing backup data. For persistent volume backups, it leverages cloud provider-specific volume snapshot APIs (e.g., AWS EBS snapshots, CSI snapshots). This extensibility is managed through a robust plugin system, allowing users to integrate with various storage solutions and custom resources.

HISTORY

Originally developed by Heptio under the name Ark, the project was designed to address the critical need for backup and disaster recovery solutions in dynamic Kubernetes environments.
After Heptio was acquired by VMware, the project was rebranded as Velero (Latin for 'sailor' or 'ferryman'), signifying its role in safely transporting and managing Kubernetes data.
Since its rebranding, Velero has continued to evolve as a vital open-source project within the Cloud Native Computing Foundation (CNCF) landscape, gaining widespread adoption as a robust standard for Kubernetes backup and restore.

SEE ALSO

kubectl(1), helm(1)

Copied to clipboard