Documentation for version v0.11.0 is no longer actively maintained. The version you are currently viewing is a static snapshot. For up-to-date documentation, see the latest version.
velero backup delete.
mkdir $HOME/go export GOPATH=$HOME/go go get github.com/heptio/velero
go is your
import path for Go.
For Go development, it is recommended to add the Go import path (
$HOME/go in this example) to your path.
Download the archive named
Source code from the
release page and extract it in your Go import path as
Note that the Makefile targets assume building from a git repository. When building from an archive, you will be limited to the
go build commands described below.
You can build your Velero image locally on the machine where you run your cluster, or you can push it to a private registry. This section covers both workflows.
$REGISTRY environment variable (used in the
Makefile) to push the Velero images to your own registry. This allows any node in your cluster to pull your locally built image.
In the Velero root directory, to build your container with the tag
To push your image to a registry, use
To build only the
velero binary, run:
go build ./cmd/velero
The following files are automatically generated from the source code:
make update to regenerate files if you make the following changes:
Run generate-proto.sh to regenerate files if you make the following changes:
make build builds an
velero binary for
To build for another platform, run
For example, to build for the Mac, run
All binaries are placed in
_output/bin/<GOOS>/<GOARCH>– for example,
Makefile has a convenience target,
all-build, that builds the following platforms:
To run unit tests, use
make test. You can also run
make verify to ensure that all generated
files (clientset, listers, shared informers, docs) are up to date.
When running Velero, you will need to account for the following (all of which are handled in the
To provision a cluster on AWS using Amazon’s official CloudFormation templates, here are two options:
Running the Velero server locally can speed up iterative development. This eliminates the need to rebuild the Velero server image and redeploy it to the cluster with each change.
Set the appropriate environment variable for your cloud provider:
You may create resources on a cluster using our example configurations.
Here is how to setup using an existing cluster in AWS: At the root of the Velero repo:
examples/aws/05-backupstoragelocation.yaml to point to your AWS S3 bucket and region. Note: you can run
aws s3api list-buckets to get the name of all your buckets.
examples/aws/06-volumesnapshotlocation.yaml to point to your AWS region.
Then run the commands below.
00-prereqs.yaml contains all our CustomResourceDefinitions (CRDs) that allow us to perform CRUD operations on backups, restores, schedules, etc. it also contains the
velero namespace, the
velero ServiceAccount, and a cluster role binding to grant the
velero ServiceAccount the cluster-admin role:
kubectl apply -f examples/common/00-prereqs.yaml
10-deployment.yaml is a sample Velero config resource for AWS:
kubectl apply -f examples/aws/10-deployment.yaml
05-backupstoragelocation.yaml specifies the location of your backup storage, together with the optional
kubectl apply -f examples/aws/05-backupstoragelocation.yaml
kubectl apply -f examples/aws/05-backupstoragelocation.yaml examples/aws/06-volumesnapshotlocation.yaml
velero is in your
PATH or specify the full path.
Set variable for Velero as needed. The variables below can be exported as environment variables or passed as CLI cmd flags:
--kubeconfig: set the path to the kubeconfig file the Velero server uses to talk to the Kubernetes apiserver
--namespace: the set namespace where the Velero server should look for backups, schedules, restores
--log-level: set the Velero server’s log level
--plugin-dir: set the directory where the Velero server looks for plugins
--metrics-address: set the bind address and port where Prometheus metrics are exposed
Start the server:
We have examples of deployments for different cloud providers in
kubectl --namespace=velero set image deployment/velero velero=$REGISTRY/velero:$VERSION
$VERSION are the values that you built Velero with.
If you need to add or update the vendored dependencies, see Vendoring dependencies.