You specify backup and snapshot locations and their secrets in the DataProtectionApplication
custom resource (CR).
Backup locations
You can specify one of the following AWS S3-compatible object storage solutions as a backup location:
-
Multicloud Object Gateway (MCG)
-
Red Hat Container Storage
-
Ceph RADOS Gateway; also known as Ceph Object Gateway
-
Red Hat OpenShift Data Foundation
-
MinIO
Velero backs up OKD resources, Kubernetes objects, and internal images as an archive file on object storage.
Snapshot locations
If you use your cloud provider’s native snapshot API to back up persistent volumes, you must specify the cloud provider as the snapshot location.
If you use Container Storage Interface (CSI) snapshots, you do not need to specify a snapshot location because you will create a VolumeSnapshotClass
CR to register the CSI driver.
If you use File System Backup (FSB), you do not need to specify a snapshot location because FSB backs up the file system on object storage.
secrets
If the backup and snapshot locations use the same credentials or if you do not require a snapshot location, you create a default Secret
.
If the backup and snapshot locations use different credentials, you create two secret objects:
-
Custom Secret
for the backup location, which you specify in the DataProtectionApplication
CR.
-
Default Secret
for the snapshot location, which is not referenced in the DataProtectionApplication
CR.
|
The Data Protection Application requires a default Secret . Otherwise, the installation will fail.
If you do not want to specify backup or snapshot locations during the installation, you can create a default Secret with an empty credentials-velero file.
|
Creating a default Secret
You create a default Secret
if your backup and snapshot locations use the same credentials or if you do not require a snapshot location.
The default name of the Secret
is cloud-credentials-azure
.
|
The DataProtectionApplication custom resource (CR) requires a default Secret . Otherwise, the installation will fail. If the name of the backup location Secret is not specified, the default name is used.
If you do not want to use the backup location credentials during the installation, you can create a Secret with the default name by using an empty credentials-velero file.
|
Prerequisites
-
Your object storage and cloud storage, if any, must use the same credentials.
-
You must configure object storage for Velero.
Procedure
-
Create a credentials-velero
file for the backup storage location in the appropriate format for your cloud provider.
See the following example:
AZURE_SUBSCRIPTION_ID= <azure_subscription_id>
AZURE_TENANT_ID=<azure_tenant_id>
AZURE_CLIENT_ID=<azure_client_id>
AZURE_CLIENT_SECRET=<azure_client_secret>
AZURE_STORAGE_ACCOUNT_ACCESS_KEY=<azure_storage_account_access_key>
AZURE_RESOURCE_GROUP=<azure_resource_group>
AZURE_CLOUD_NAME=<azure_cloud_name>
-
Create a Secret
custom resource (CR) with the default name:
$ oc create secret generic cloud-credentials-azure -n openshift-adp --from-file cloud=credentials-velero
The Secret
is referenced in the spec.backupLocations.credential
block of the DataProtectionApplication
CR when you install the Data Protection Application.
Creating secrets for different credentials
If your backup and snapshot locations use different credentials, you must create two Secret
objects:
-
Backup location Secret
with a custom name. The custom name is specified in the spec.backupLocations
block of the DataProtectionApplication
custom resource (CR).
-
Snapshot location Secret
with the default name, cloud-credentials-azure
. This Secret
is not specified in the DataProtectionApplication
CR.
Procedure
-
Create a credentials-velero
file for the snapshot location in the appropriate format for your cloud provider.
-
Create a Secret
for the snapshot location with the default name:
$ oc create secret generic cloud-credentials-azure -n openshift-adp --from-file cloud=credentials-velero
-
Create a credentials-velero
file for the backup location in the appropriate format for your object storage.
-
Create a Secret
for the backup location with a custom name:
$ oc create secret generic <custom_secret> -n openshift-adp --from-file cloud=credentials-velero
-
Add the Secret
with the custom name to the DataProtectionApplication
CR, as in the following example:
apiVersion: oadp.openshift.io/v1alpha1
kind: DataProtectionApplication
metadata:
name: <dpa_sample>
namespace: openshift-adp
spec:
...
backupLocations:
- velero:
config:
resourceGroup: <azure_resource_group>
storageAccount: <azure_storage_account_id>
subscriptionId: <azure_subscription_id>
storageAccountKeyEnvVar: AZURE_STORAGE_ACCOUNT_ACCESS_KEY
credential:
key: cloud
name: <custom_secret> (1)
provider: azure
default: true
objectStorage:
bucket: <bucket_name>
prefix: <prefix>
snapshotLocations:
- velero:
config:
resourceGroup: <azure_resource_group>
subscriptionId: <azure_subscription_id>
incremental: "true"
provider: azure
1 |
Backup location Secret with custom name. |