Openshift: SOP to restore/backup/migrate/disaster recovery with Velero
This commit is contained in:
parent
e70bfc2c68
commit
a7f6614be8
2 changed files with 77 additions and 0 deletions
76
modules/ocp4/pages/sop_velero.adoc
Normal file
76
modules/ocp4/pages/sop_velero.adoc
Normal file
|
@ -0,0 +1,76 @@
|
||||||
|
= SOP Velero
|
||||||
|
This SOP should be used in the following scenario:
|
||||||
|
|
||||||
|
- Performing a data migration between OpenShift clusters.
|
||||||
|
- Performing a data backup to S3
|
||||||
|
- Velero doesn't support restoring into a cluster with a lower Kubernetes version than where the backup was taken.
|
||||||
|
|
||||||
|
== Resources
|
||||||
|
- [1] https://velero.io/docs/main/migration-case/[Migrating between OpenShift clusters using Velero]
|
||||||
|
|
||||||
|
|
||||||
|
== Steps
|
||||||
|
1. Install the Velero CLI client.
|
||||||
|
+
|
||||||
|
eg:
|
||||||
|
+
|
||||||
|
----
|
||||||
|
wget https://github.com/vmware-tanzu/velero/releases/download/v1.8.1/velero-v1.8.1-linux-amd64.tar.gz
|
||||||
|
tar -zxf velero-v1.8.1-linux-amd64.tar.gz
|
||||||
|
ln -s velero-v1.8.1-linux-amd64/velero ~/bin/velero
|
||||||
|
----
|
||||||
|
|
||||||
|
|
||||||
|
2. Configure Velero to access S3
|
||||||
|
+
|
||||||
|
Create a file `credentials-velero` which contains the AWS access key and secret access key with permissions to access an S3 bucket.
|
||||||
|
+
|
||||||
|
----
|
||||||
|
[default]
|
||||||
|
aws_access_key_id=XXX
|
||||||
|
aws_secret_access_key=XXX
|
||||||
|
----
|
||||||
|
|
||||||
|
|
||||||
|
3. Next install Velero in the cluster
|
||||||
|
+
|
||||||
|
Ensure you are authenticated to the OpenShift cluster via the CLI.
|
||||||
|
+
|
||||||
|
Using something like the following:
|
||||||
|
+
|
||||||
|
----
|
||||||
|
REGION="us-east-1"
|
||||||
|
S3BUCKET="fedora-openshift-migration"
|
||||||
|
|
||||||
|
velero install \
|
||||||
|
--provider aws \
|
||||||
|
--plugins velero/velero-plugin-for-aws:v1.4.0 \
|
||||||
|
--bucket $S3BUCKET \
|
||||||
|
--backup-location-config region=$REGION \
|
||||||
|
--snapshot-location-config region=$REGION \
|
||||||
|
--use-volume-snapshots=true \
|
||||||
|
--image velero/velero:v1.4.0 \
|
||||||
|
--secret-file ./credentials-velero \
|
||||||
|
--use-restic
|
||||||
|
----
|
||||||
|
|
||||||
|
4. Perform a backup
|
||||||
|
+
|
||||||
|
eg:
|
||||||
|
+
|
||||||
|
----
|
||||||
|
velero backup create backupName --include-cluster-resources=true --ordered-resources 'persistentvolumes=pvName' --include-namespaces=namespaceName
|
||||||
|
----
|
||||||
|
|
||||||
|
|
||||||
|
5. Restore a backup
|
||||||
|
+
|
||||||
|
While authenticated to a second cluster to restore to, or original cluster where you are recovering to you can restore a backup like so:
|
||||||
|
+
|
||||||
|
----
|
||||||
|
velero backup get
|
||||||
|
velero restore create --from-backup backupName
|
||||||
|
----
|
||||||
|
|
||||||
|
For more information see the `Velero` documentation at [1].
|
||||||
|
|
|
@ -18,4 +18,5 @@
|
||||||
- xref:sop_configure_openshift_virtualization_operator.adoc[SOP Configure the Openshift Virtualization Operator]
|
- xref:sop_configure_openshift_virtualization_operator.adoc[SOP Configure the Openshift Virtualization Operator]
|
||||||
- xref:sop_add_node.adoc[SOP Add an OCP4 Node to an Existing Cluster]
|
- xref:sop_add_node.adoc[SOP Add an OCP4 Node to an Existing Cluster]
|
||||||
- xref:sop_add_odf_storage.adoc[SOP Add new capacity to the OCP4 ODF Storage Cluster]
|
- xref:sop_add_odf_storage.adoc[SOP Add new capacity to the OCP4 ODF Storage Cluster]
|
||||||
|
- xref:sop_velero.adoc[SOP Velero]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue