BackupStores and BackupTargets
A backupstore is a NFS server or S3 compatible server.
A backup target represents a backupstore in Longhorn. The backup target can be set at Settings/General/BackupTarget
See here for details on how to setup backup target.
Longhorn also supports setting up recurring snapshot/backup jobs for volumes, via Longhorn UI or Kubernetes Storage Class. See here for details.
The user can setup a S3 or NFS type backupstore to store the backups of Longhorn volumes.
If the user doesn’t have access to AWS S3 or want to give a try first, we’ve also provided a way to setup a local S3 testing backupstore using Minio.
Create a new bucket in AWS S3.
Follow the guide to create a new AWS IAM user, with the following permissions set:
Pay attention that you should have / at the end, otherwise you will get an error.
Also please make sure you’ve set <your-aws-region> in the URL.
For example, for Google Cloud Storage, you can find the region code here: https://cloud.google.com/storage/docs/locations
Your secret name with AWS keys from 3rd point.
We provides two testing purpose backupstore based on NFS server and Minio S3 server for testing, in ./deploy/backupstores.
Use following command to setup a Minio S3 server for BackupStore after longhorn-system was created.
kubectl create -f https://raw.githubusercontent.com/longhorn/longhorn/master/deploy/backupstores/minio-backupstore.yaml
Now set Settings/General/BackupTarget to
And Setttings/General/BackupTargetSecret to
Click the Backup tab in the UI, it should report an empty list without error out.
The minio-secret yaml looks like this:
AWS_ACCESS_KEY_ID: bG9uZ2hvcm4tdGVzdC1hY2Nlc3Mta2V5 # longhorn-test-access-key
AWS_SECRET_ACCESS_KEY: bG9uZ2hvcm4tdGVzdC1zZWNyZXQta2V5 # longhorn-test-secret-key
AWS_ENDPOINTS: aHR0cDovL21pbmlvLXNlcnZpY2UuZGVmYXVsdDo5MDAw # http://minio-service.default:9000
Please follow the Kubernetes document to create the secret.
Notice the secret must be created in the longhorn-system namespace for Longhorn to access.
For using NFS server as backupstore, NFS server must support NFSv4.
The target URL would looks like:
You can find an example NFS backupstore for testing purpose here.
© 2019-2020 Longhorn Authors | Documentation Distributed under CC-BY-4.0
© 2020 The Linux Foundation. All rights reserved. The Linux Foundation has registered trademarks and uses trademarks. For a list of trademarks of The Linux Foundation, please see our Trademark Usage page.