Please place the git repo under $GOPATH/src/github.com/vmware-tanzu/velero-plugin-for-vsphere.
Velero currently supports the following kinds of plugins:
- Block Store - creates snapshots from volumes (during a backup) and volumes from snapshots (during a restore).
To build the plugin, run
$ make
To build the image, run
$ make container
This builds an image tagged as velero/velero-plugin-for-vsphere
. If you want to specify a
different name, run
$ make container IMAGE=your-repo/your-name:here
To deploy your plugin image to an Velero server:
- In the CSI setup, it is required to use the hostNetwork option for the deployment. Run
kubectl patch deploy/velero -n velero --patch "$(cat deployment/patch-deployment-hostNetwork.yaml)"
. - Make sure your image is pushed to a registry that is accessible to your cluster's nodes.
- Run
velero plugin add <image>
, e.g.velero plugin add velero/vsphere-plugin-for-velero
When the plugin is deployed, it is only made available to use. To make the plugin effective, you must modify your configuration:
Volume snapshot storage:
- Run
kubectl edit volumesnapshotlocation <location-name> -n <velero-namespace>
e.g.kubectl edit volumesnapshotlocation default -n velero
ORvelero snapshot-location create <location-name> --provider <provider-name>
- Change the value of
spec.provider
to enable a Block Store plugin - Save and quit. The plugin will be used for the next
backup/restore
To run with the plugin, do the following:
-
Run
velero snapshot-location create example-default --provider velero.io/vsphere
-
Run
kubectl edit deployment/velero -n <velero-namespace>
-
Change the value of
spec.template.spec.args
to look like the following:- args: - server - --default-volume-snapshot-locations - velero.io/vsphere:example-default
Note: users can also run
kubectl apply -f deployment/create-deployment-for-plugin.yaml
to configure the deployment for the plugin, which is equivalent to steps 1 - 3 mentioned above. -
Run
kubectl apply -f examples/demo-app.yaml
to apply a sample nginx application that uses the example block store plugin. Note: This example works best on a virtual machine, as it uses the host's/tmp
directory for data storage.