mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-07 00:48:01 +01:00
100 lines
2.9 KiB
Plaintext
100 lines
2.9 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// * migration/migrating_3_4/configuring-replication-repository-3-4.adoc
|
|
// * migration/migrating_4_1_4/configuring-replication-repository-4-1-4.adoc
|
|
// * migration/migrating_4_2_4/configuring-replication-repository-4-2-4.adoc
|
|
|
|
[id='migration-configuring-azure_{context}']
|
|
= Configuring a Microsoft Azure Blob storage container as a replication repository
|
|
|
|
You can configure a Microsoft Azure Blob storage container as a replication repository for the {mtc-full} ({mtc-short}).
|
|
|
|
.Prerequisites
|
|
|
|
* You must have an link:https://docs.microsoft.com/en-us/azure/storage/common/storage-quickstart-create-account?toc=%2Fazure%2Fstorage%2Fblobs%2Ftoc.json&tabs=azure-portal[Azure storage account].
|
|
* You must have the link:https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest[Azure CLI] installed.
|
|
* The Azure Blob storage container must be accessible to the source and target clusters.
|
|
* If you are using the snapshot copy method:
|
|
** The source and target clusters must be in the same region.
|
|
** The source and target clusters must have the same storage class.
|
|
** The storage class must be compatible with snapshots.
|
|
|
|
.Procedure
|
|
|
|
. Set the `AZURE_RESOURCE_GROUP` variable:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ AZURE_RESOURCE_GROUP=Velero_Backups
|
|
----
|
|
|
|
. Create an Azure resource group:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ az group create -n $AZURE_RESOURCE_GROUP --location <CentralUS> <1>
|
|
----
|
|
<1> Specify your location.
|
|
|
|
. Set the `AZURE_STORAGE_ACCOUNT_ID` variable:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ AZURE_STORAGE_ACCOUNT_ID=velerobackups
|
|
----
|
|
|
|
. Create an Azure storage account:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ az storage account create \
|
|
--name $AZURE_STORAGE_ACCOUNT_ID \
|
|
--resource-group $AZURE_RESOURCE_GROUP \
|
|
--sku Standard_GRS \
|
|
--encryption-services blob \
|
|
--https-only true \
|
|
--kind BlobStorage \
|
|
--access-tier Hot
|
|
----
|
|
|
|
. Set the `BLOB_CONTAINER` variable:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ BLOB_CONTAINER=velero
|
|
----
|
|
|
|
. Create an Azure Blob storage container:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ az storage container create \
|
|
-n $BLOB_CONTAINER \
|
|
--public-access off \
|
|
--account-name $AZURE_STORAGE_ACCOUNT_ID
|
|
----
|
|
|
|
. Create a service principal and credentials for `velero`:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ AZURE_SUBSCRIPTION_ID=`az account list --query '[?isDefault].id' -o tsv` \
|
|
AZURE_TENANT_ID=`az account list --query '[?isDefault].tenantId' -o tsv` \
|
|
AZURE_CLIENT_SECRET=`az ad sp create-for-rbac --name "velero" --role "Contributor" --query 'password' -o tsv` \
|
|
AZURE_CLIENT_ID=`az ad sp list --display-name "velero" --query '[0].appId' -o tsv`
|
|
----
|
|
|
|
. Save the service principal credentials in the `credentials-velero` file:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ cat << EOF > ./credentials-velero
|
|
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_RESOURCE_GROUP=${AZURE_RESOURCE_GROUP}
|
|
AZURE_CLOUD_NAME=AzurePublicCloud
|
|
EOF
|
|
----
|