This command gives users the ability to restore a backup to a raw image or a qcow2 image. If the backup is based on a backing file, users should provide the backing file as a qcow2 image with --backing file parameter.
Copy the yaml template: Make a copy of
examples/restore_to_file.yaml.templateas e.g.restore.yaml.Set the node which the output file should be placed on by replacing
<NODE_NAME>, e.g.node1.Specify the host path of output file by modifying field
hostpathof volumedisk-directory. By default the directory is/tmp/restore/.Set the first argument (backup url) by replacing
<BACKUP_URL>, e.g.s3://backupbucket@us-east-1/backupstore?backup=backup-bd326da2c4414b02&volume=volumeexamplename. Do not delete''.Set argument
output-fileby replacing<OUTPUT_FILE>, e.g.volume.raworvolume.qcow2.Set argument
output-formatby replacing<OUTPUT_FORMAT>. The supported options areraworqcow2.Set the S3 Credential Secret by replacing
<S3_SECRET_NAME>, e.g.minio-secret.Execute the yaml using e.g.:
kubectl create -f restore.yaml
Watch the result using:
kubectl -n longhorn-system get pod restore-to-file -w
After the pod status changed to Completed, you should able to find <OUTPUT_FILE> at e.g. /tmp/restore on the <NODE_NAME>.
