Backup Longhorn System
Longhorn system backup creates a resource bundle and uploads it to the remote backup target.
It includes below resources associating with the Longhorn system:
Note: Longhorn does not backup
Nodes
. The Longhorn manager on the target cluster is responsible for creating its own LonghornNode
custom resources.
Note: Longhorn system backup bundle only includes resources operated by Longhorn.
Here is an example of a cluster workload with a barePod
workload. The system backup will collect thePersistentVolumeClaim
,PersistentVolume
, andVolume
. The system backup will exclude thePod
during system backup resource collection.
You can create a Longhorn system backup using the Longhorn UI. Or with the kubectl
command.
Set the backup target. Longhorn saves the system backups to the remote backup store. You will see an error during creation when the backup target is unset.
Note: Unsetting the backup target clears the existing
SystemBackup
custom resource. Longhorn syncs to the remote backup store after setting the backup target. Another cluster can also sync to the same list of system backups when the backup target is the same.
Create a backup for all volumes (optional).
Note: Longhorn system restores volume with the latest backup. We recommend updating the last backup for all volumes. By taking volume backups, you ensure that the data is up-to-date with the system backup. For more information, please refer to the Configuration - Volume Backup Policy section.
The Longhorn system backup offers the following volume backup policies:
if-not-present
: Longhorn will create a backup for volumes that currently lack a backup.always
: Longhorn will create a backup for all volumes, regardless of their existing backups.disabled
: Longhorn will not create any backups for volumes.System Backup
page in the Setting
drop-down list.Create
under System Backup
.Name
for the system backup.Volume Backup Policy
for the system backup.Ready
.kubectl
Commandkubectl create
to create a Longhorn SystemBackup
custom resource.apiVersion: longhorn.io/v1beta2
kind: SystemBackup
metadata:
name: demo
namespace: longhorn-system
spec:
volumeBackupPolicy: if-not-present
Ready
.> kubectl -n longhorn-system get systembackup
NAME VERSION STATE CREATED
demo v1.4.0 Ready 2022-11-24T04:23:24Z
You can delete the Longhorn system backup in the remote backup target using the Longhorn UI. Or with the kubectl
command.
Go to the System Backup
page in the Setting
drop-down list.
Delete a single system backup in the Operation
drop-down menu next to the system backup. Or delete in batch with the Delete
button.
Note: Deleting the system backup will also make a deletion in the backup store.
kubectl
Commandkubectl delete
to delete a Longhorn SystemBackup
custom resource.> kubectl -n longhorn-system get systembackup
NAME VERSION STATE CREATED
demo v1.4.0 Ready 2022-11-24T04:23:24Z
> kubectl -n longhorn-system delete systembackup/demo
systembackup.longhorn.io "demo" deleted
Available since v1.4.0
© 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.