Use command restore-to-file
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
1.1 Volume has no base image: Make a copy of
examples/restore_to_file.yaml.template as e.g.
1.2 Volume has a base image: Make a copy of
examples/restore_to_file_with_base_image.yaml.template as e.g.
restore.yaml, and set argument
backing-file by replacing
<BASE_IMAGE> with your base image, e.g.
Set the node which the output file should be placed on by replacing
Specify the host path of output file by modifying field
hostpath of volume
disk-directory. By default the directory is
Set the first argument (backup url) by replacing
s3://backupbucket@us-east-1/backupstore?backup=backup-bd326da2c4414b02&volume=volumeexamplename. Do not delete
output-file by replacing
output-format by replacing
<OUTPUT_FORMAT>. Now support
Set S3 Credential Secret by replacing
Execute the yaml using e.g.
kubectl create -f restore.yaml.
Watching 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