|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// migration/migrating_3_4/configuring-replication-repository.adoc |
| 4 | +// migration/migrating_4_1_4/configuring-replication-repository.adoc |
| 5 | +// migration/migrating_4_2_4/configuring-replication-repository.adoc |
| 6 | +[id='migration-configuring-mcg_{context}'] |
| 7 | += Configuring a Multi-Cloud Object Gateway storage bucket as a replication repository |
| 8 | + |
| 9 | +You can install the OpenShift Container Storage Operator and configure a Multi-Cloud Object Gateway (MCG) storage bucket as a replication repository on the CAM tool cluster. |
| 10 | + |
| 11 | +[id='installing-the-ocs-operator_{context}'] |
| 12 | +== Installing the OpenShift Container Storage Operator |
| 13 | + |
| 14 | +You can install the OpenShift Container Storage Operator from OperatorHub on the CAM tool cluster. |
| 15 | + |
| 16 | +.Procedure |
| 17 | + |
| 18 | +. In the {product-title} web console, click *Administration* -> *Namespaces*. |
| 19 | +. Click *Create Namespace*. |
| 20 | +. Enter `openshift-storage` in the *Name* field and click *Create*. |
| 21 | +. Click *Operators* -> *OperatorHub*. |
| 22 | +. Use *Filter by keyword* (in this case, *OCS*) to find the *OpenShift Container Storage Operator*. |
| 23 | +. Select the *OpenShift Container Storage Operator* and click *Install*. |
| 24 | +. On the *Create Operator Subscription* page, select the `openshift-storage` namespace. |
| 25 | +. Specify your update channel and approval strategy. |
| 26 | +. Click *Subscribe*. |
| 27 | ++ |
| 28 | +On the *Installed Operators* page, the *OpenShift Container Storage Operator* appears in the *openshift-storage* project with the status *Succeeded*. |
| 29 | + |
| 30 | +[id='configuring-mcg-storage-bucket_{context}'] |
| 31 | +== Creating the Multi-Cloud Object Gateway storage bucket |
| 32 | + |
| 33 | +You can create the Multi-Cloud Object Gateway (MCG) storage bucket's Custom Resources (CRs) on the CAM tool cluster. |
| 34 | + |
| 35 | +.Procedure |
| 36 | + |
| 37 | +. Log in to the CAM tool cluster. |
| 38 | +. Create the `NooBaa` CR configuration file, `noobaa.yml`, with the following content: |
| 39 | ++ |
| 40 | +[source,yaml] |
| 41 | +---- |
| 42 | +apiVersion: noobaa.io/v1alpha1 |
| 43 | +kind: NooBaa |
| 44 | +metadata: |
| 45 | + name: noobaa |
| 46 | + namespace: openshift-storage |
| 47 | +spec: |
| 48 | + dbResources: |
| 49 | + requests: |
| 50 | + cpu: 0.5 <1> |
| 51 | + memory: 1Gi |
| 52 | + coreResources: |
| 53 | + requests: |
| 54 | + cpu: 0.5 <1> |
| 55 | + memory: 1Gi |
| 56 | +---- |
| 57 | +<1> For a very small cluster, you can change the `cpu` value to `0.1`. |
| 58 | + |
| 59 | +. Create the `NooBaa` object: |
| 60 | ++ |
| 61 | +---- |
| 62 | +$ oc create -f noobaa.yml |
| 63 | +---- |
| 64 | + |
| 65 | +. Create the `BackingStore` CR configuration file, `bs.yml`, with the following content: |
| 66 | ++ |
| 67 | +[source,yaml] |
| 68 | +---- |
| 69 | +apiVersion: noobaa.io/v1alpha1 |
| 70 | +kind: BackingStore |
| 71 | +metadata: |
| 72 | + finalizers: |
| 73 | + - noobaa.io/finalizer |
| 74 | + labels: |
| 75 | + app: noobaa |
| 76 | + name: mcg-pv-pool-bs |
| 77 | + namespace: openshift-storage |
| 78 | +spec: |
| 79 | + pvPool: |
| 80 | + numVolumes: 3 <1> |
| 81 | + resources: |
| 82 | + requests: |
| 83 | + storage: 50Gi <2> |
| 84 | + storageClass: gp2 <3> |
| 85 | + type: pv-pool |
| 86 | +---- |
| 87 | +<1> Specify the number of volumes in the PV pool. |
| 88 | +<2> Specify the size of the volumes. |
| 89 | +<3> Specify the storage class. |
| 90 | + |
| 91 | +. Create the `BackingStore` object: |
| 92 | ++ |
| 93 | +---- |
| 94 | +$ oc create -f bs.yml |
| 95 | +---- |
| 96 | + |
| 97 | +. Create the `BucketClass` CR configuration file, `bc.yml`, with the following content: |
| 98 | ++ |
| 99 | +[source,yaml] |
| 100 | +---- |
| 101 | +apiVersion: noobaa.io/v1alpha1 |
| 102 | +kind: BucketClass |
| 103 | +metadata: |
| 104 | + labels: |
| 105 | + app: noobaa |
| 106 | + name: mcg-pv-pool-bc |
| 107 | + namespace: openshift-storage |
| 108 | +spec: |
| 109 | + placementPolicy: |
| 110 | + tiers: |
| 111 | + - backingStores: |
| 112 | + - mcg-pv-pool-bs |
| 113 | + placement: Spread |
| 114 | +---- |
| 115 | + |
| 116 | +. Create the `BucketClass` object: |
| 117 | ++ |
| 118 | +---- |
| 119 | +$ oc create -f bc.yml |
| 120 | +---- |
| 121 | + |
| 122 | +. Create the `ObjectBucketClaim` CR configuration file, `obc.yml`, with the following content: |
| 123 | ++ |
| 124 | +[source,yaml] |
| 125 | +---- |
| 126 | +apiVersion: objectbucket.io/v1alpha1 |
| 127 | +kind: ObjectBucketClaim |
| 128 | +metadata: |
| 129 | + name: migstorage |
| 130 | + namespace: openshift-storage |
| 131 | +spec: |
| 132 | + bucketName: migstorage <1> |
| 133 | + storageClassName: openshift-storage.noobaa.io |
| 134 | + additionalConfig: |
| 135 | + bucketclass: mcg-pv-pool-bc |
| 136 | +---- |
| 137 | +<1> Record the bucket name for adding the replication repository to the CAM web console. |
| 138 | + |
| 139 | +. Create the `ObjectBucketClaim` object: |
| 140 | ++ |
| 141 | +---- |
| 142 | +$ oc create -f obc.yml |
| 143 | +---- |
| 144 | + |
| 145 | +. Watch the resource creation process to verify that the `ObjectBucketClaim` status is `Bound`: |
| 146 | ++ |
| 147 | +---- |
| 148 | +$ watch -n 30 'oc get -n openshift-storage objectbucketclaim migstorage -o yaml' |
| 149 | +---- |
| 150 | ++ |
| 151 | +This process can take five to ten minutes. |
| 152 | + |
| 153 | +. Obtain and record the following values, which are required when you add the replication repository to the CAM web console: |
| 154 | + |
| 155 | +* S3 endpoint: |
| 156 | ++ |
| 157 | +---- |
| 158 | +$ oc get route -n openshift-storage s3 |
| 159 | +---- |
| 160 | + |
| 161 | +* S3 provider access key: |
| 162 | ++ |
| 163 | +---- |
| 164 | +$ oc get secret -n openshift-storage migstorage -o go-template='{{ .data.AWS_ACCESS_KEY_ID }}' | base64 -d |
| 165 | +---- |
| 166 | + |
| 167 | +* S3 provider secret access key: |
| 168 | ++ |
| 169 | +---- |
| 170 | +$ oc get secret -n openshift-storage migstorage -o go-template='{{ .data.AWS_SECRET_ACCESS_KEY }}' | base64 -d |
| 171 | +---- |
0 commit comments