3.2 KiB
title, layout
| title | layout |
|---|---|
| Cluster migration | docs |
Velero can help you port your resources from one cluster to another, as long as you point each Velero instance to the same cloud object storage location.
Migration Limitations
Before migrating you should consider the following,
- Velero does not natively support the migration of persistent volumes snapshots across cloud providers. If you would like to migrate volume data between cloud platforms, enable restic, which will backup volume contents at the filesystem level.
- Velero doesn't support restoring into a cluster with a lower Kubernetes version than where the backup was taken.
- Migrating workloads across clusters that are not running the same version of Kubernetes might be possible, but some factors need to be considered before migration, including the compatibility of API groups between clusters for each custom resource. If a Kubernetes version upgrade breaks the compatibility of core/native API groups, migrating with Velero will not be possible without first updating the impacted custom resources. For more information about API group versions, please see EnableAPIGroupVersions.
- The Velero plugin for AWS and Azure does not support migrating data between regions. If you need to do this, you must use restic.
Migration Scenario
This scenario assumes that your clusters are hosted by the same cloud provider
-
(Cluster 1) Assuming you haven't already been checkpointing your data with the Velero
scheduleoperation, you need to first back up your entire cluster (replacing<BACKUP-NAME>as desired):velero backup create <BACKUP-NAME>The default backup retention period, expressed as TTL (time to live), is 30 days (720 hours); you can use the
--ttl <DURATION>flag to change this as necessary. See how velero works for more information about backup expiry. -
(Cluster 2) Configure
BackupStorageLocationsandVolumeSnapshotLocations, pointing to the locations used by Cluster 1, usingvelero backup-location createandvelero snapshot-location create. Make sure to configure theBackupStorageLocationsas read-only by using the--access-mode=ReadOnlyflag forvelero backup-location create. -
(Cluster 2) Make sure that the Velero Backup object is created. Velero resources are synchronized with the backup files in cloud storage.
velero backup describe <BACKUP-NAME>Note: The default sync interval is 1 minute, so make sure to wait before checking. You can configure this interval with the
--backup-sync-periodflag to the Velero server. -
(Cluster 2) Once you have confirmed that the right Backup (
<BACKUP-NAME>) is now present, you can restore everything with:velero restore create --from-backup <BACKUP-NAME>
Verify Both Clusters
Check that the second cluster is behaving as expected:
-
(Cluster 2) Run:
velero restore get -
Then run:
velero restore describe <RESTORE-NAME-FROM-GET-COMMAND>
If you encounter issues, make sure that Velero is running in the same namespace in both clusters.