mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
146 lines
4.0 KiB
Plaintext
146 lines
4.0 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// * backup_and_restore/application_backup_and_restore/installing/installing-oadp-ibm-cloud.adoc
|
|
|
|
:_mod-docs-content-type: PROCEDURE
|
|
[id="configuring-ibm-cos_{context}"]
|
|
= Configuring the COS instance
|
|
|
|
[role="_abstract"]
|
|
You create an {ibm-cloud-object-storage} instance to store the {oadp-short} backup data. After you create the COS instance, configure the `HMAC` service credentials.
|
|
|
|
.Prerequisites
|
|
|
|
* You have an {ibm-cloud-title} Platform account.
|
|
* You installed the link:https://cloud.ibm.com/docs/cli?topic=cli-getting-started[{ibm-cloud-title} CLI].
|
|
* You are logged in to {ibm-cloud-title}.
|
|
|
|
.Procedure
|
|
|
|
. Install the {ibm-cloud-object-storage} plugin by running the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ ibmcloud plugin install cos -f
|
|
----
|
|
|
|
. Set a bucket name by running the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ BUCKET=<bucket_name>
|
|
----
|
|
|
|
. Set a bucket region by running the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ REGION=<bucket_region> <1>
|
|
----
|
|
<1> Specify the bucket region, for example, `eu-gb`.
|
|
|
|
. Create a resource group by running the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ ibmcloud resource group-create <resource_group_name>
|
|
----
|
|
|
|
. Set the target resource group by running the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ ibmcloud target -g <resource_group_name>
|
|
----
|
|
|
|
. Verify that the target resource group is correctly set by running the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ ibmcloud target
|
|
----
|
|
+
|
|
.Example output
|
|
+
|
|
[source,yaml]
|
|
----
|
|
API endpoint: https://cloud.ibm.com
|
|
Region:
|
|
User: test-user
|
|
Account: Test Account (fb6......e95) <-> 2...122
|
|
Resource group: Default
|
|
----
|
|
+
|
|
In the example output, the resource group is set to `Default`.
|
|
|
|
. Set a resource group name by running the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ RESOURCE_GROUP=<resource_group> <1>
|
|
----
|
|
<1> Specify the resource group name, for example, `"default"`.
|
|
|
|
. Create an {ibm-cloud-title} `service-instance` resource by running the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ ibmcloud resource service-instance-create \
|
|
<service_instance_name> \// <1>
|
|
<service_name> \// <2>
|
|
<service_plan> \// <3>
|
|
<region_name> // <4>
|
|
----
|
|
<1> Specify a name for the `service-instance` resource.
|
|
<2> Specify the service name. Alternatively, you can specify a service ID.
|
|
<3> Specify the service plan for your {ibm-cloud-title} account.
|
|
<4> Specify the region name.
|
|
+
|
|
.Example command
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ ibmcloud resource service-instance-create test-service-instance cloud-object-storage \ // <1>
|
|
standard \
|
|
global \
|
|
-d premium-global-deployment // <2>
|
|
----
|
|
<1> The service name is `cloud-object-storage`.
|
|
<2> The `-d` flag specifies the deployment name.
|
|
|
|
. Extract the service instance ID by running the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ SERVICE_INSTANCE_ID=$(ibmcloud resource service-instance test-service-instance --output json | jq -r '.[0].id')
|
|
----
|
|
|
|
. Create a COS bucket by running the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ ibmcloud cos bucket-create \//
|
|
--bucket $BUCKET \//
|
|
--ibm-service-instance-id $SERVICE_INSTANCE_ID \//
|
|
--region $REGION
|
|
----
|
|
+
|
|
Variables such as `$BUCKET`, `$SERVICE_INSTANCE_ID`, and `$REGION` are replaced by the values you set previously.
|
|
|
|
. Create `HMAC` credentials by running the following command.
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ ibmcloud resource service-key-create test-key Writer --instance-name test-service-instance --parameters {\"HMAC\":true}
|
|
----
|
|
|
|
. Extract the access key ID and the secret access key from the `HMAC` credentials and save them in the `credentials-velero` file. You can use the `credentials-velero` file to create a `secret` for the backup storage location. Run the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ cat > credentials-velero << __EOF__
|
|
[default]
|
|
aws_access_key_id=$(ibmcloud resource service-key test-key -o json | jq -r '.[0].credentials.cos_hmac_keys.access_key_id')
|
|
aws_secret_access_key=$(ibmcloud resource service-key test-key -o json | jq -r '.[0].credentials.cos_hmac_keys.secret_access_key')
|
|
__EOF__
|
|
---- |