Restore Volume Recurring Jobs from a Backup
Since v1.4.0, Longhorn supports recurring jobs backup and restore along with the volume backup and restore. When restoring a backup volume, if users enable the Restore Volume Recurring Jobs
setting, the original recurring jobs of the volume will be restored back accordingly.
For more information on the setting Restore Volume Recurring Jobs
, refer to the settings section.
For more information on how volume backup works, refer to the concepts section.
When restoring a volume with recurring jobs, Longhorn will restore them together. If the volume name already exists, the volume and the recurring jobs will not be restored. If the recurring job name already exists but the spec is different, the restoring recurring job will be created with a randomly generated name to avoid conflict. Otherwise, Longhorn will try to reuse existing recurring jobs instead if they are the same as restoring recurring jobs of a backup volume.
By default, Longhorn will not automatically restore volume recurring jobs, users can enable the automatic restoration by Longhorn UI or kubectl.
Restore Volume Recurring Jobs
# kubectl -n longhorn-system edit settings.longhorn.io restore-volume-recurring-jobs
Then, set the value to true
.
# kubectl -n longhorn-system get setting restore-volume-recurring-jobs
NAME VALUE AGE
restore-volume-recurring-jobs false 28m
apiVersion: longhorn.io/v1beta2
kind: Volume
metadata:
labels:
longhornvolume: vol-01
name: vol-01
namespace: longhorn-system
spec:
restoreVolumeRecurringJob: ignored
engineImage: longhornio/longhorn-engine:v1.4.0
fromBackup: "s3://backupbucket@us-east-1?volume=minio-vol01&backup=backup-eeb2782d5b2f42bb"
frontend: blockdev
Users can override the setting restore-volume-recurring-jobs
by the volume spec property spec.restoreVolumeRecurringJob
.
Result: The restored volume recurring jobs are available on the RecurringJob page.
© 2019-2024 Longhorn Authors | Documentation Distributed under CC-BY-4.0
© 2024 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.