This is the documentation for the latest development version of Velero. Both code and docs may be unstable, and these docs are not guaranteed to be up to date or correct. See the latest version.
After you set up the Velero server, you can clone the examples used in the following sections by running the following:
git clone https://github.com/velero-io/velero.git
cd velero
Start the sample nginx app:
kubectl apply -f examples/nginx-app/base.yaml
Create a backup and wait for it to finish.
velero backup create nginx-backup --include-namespaces nginx-example --wait
Simulate a disaster by deleting the namespace only if the backup phase is Completed.
kubectl delete namespaces nginx-example
Wait for the namespace to be deleted.
Restore your lost resources:
velero restore create --from-backup nginx-backup
NOTE: For Azure, you must run Kubernetes version 1.7.2 or later to support PV snapshotting of managed disks.
Start the sample nginx app:
kubectl apply -f examples/nginx-app/with-pv.yaml
Create a backup with PV snapshotting and wait for it to finish. The --csi-snapshot-timeout flag sets the timeout for creating a CSI snapshot. The default is 10 minutes.
velero backup create nginx-pv-backup --include-namespaces nginx-example --csi-snapshot-timeout=20m --wait
Simulate a disaster by deleting the namespace only if the backup phase is Completed.
kubectl delete namespaces nginx-example
Because the default reclaim policy for dynamically-provisioned PVs is “Delete”, these commands should trigger your cloud provider to delete the disk that backs the PV. Deletion is asynchronous, so this may take some time. Before continuing to the next step, check your cloud provider to confirm that the disk no longer exists.
Restore your lost resources:
velero restore create --from-backup nginx-pv-backup
To help you get started, see the documentation.