Add an IBM COS namespace bucket using the Multicloud Object Gateway CLI.
Before you begin
- Ensure you have a running Fusion Data Foundation
Platform.
- Download the MCG command-line interface for easier
management.
subscription-manager repos --enable=rh-odf-4-for-rhel-8-x86_64-rpms
yum install mcg
Note: Specify
the appropriate architecture for enabling the repositories using the subscription manager.
-
Alternatively, you can install the MCG package from the RPMs found at Download Red Hat OpenShift Data Foundation page.
Note: Choose the correct Product Variant according to your architecture.
Procedure
- In the MCG command-line interface, create a NamespaceStore resource.
A NamespaceStore represents an underlying storage to be used as a
read
or
write
target for the data in the MCG namespace buckets.
noobaa namespacestore create ibm-cos <namespacestore> --endpoint <IBM COS ENDPOINT> --access-key <IBM ACCESS KEY> --secret-key <IBM SECRET ACCESS KEY> --target-bucket <bucket-name> -n openshift-storage
- namespacestore
-
The name of the NamespaceStore.
- IBM ACCESS KEY, IBM SECRET ACCESS KEY,
IBM COS
ENDPOINT
-
An IBM access key ID, secret access key, and the appropriate regional endpoint that corresponds
to the location of the existing IBM bucket.
-
bucket-name
-
An existing IBM bucket name. This argument tells the MCG which bucket to use as a target bucket
for its backing store, and subsequently, data storage and administration.
- Create a namespace bucket class that defines a
namespace policy for the namespace buckets. The namespace policy can be either
single or multi.
-
To create a namespace bucket class with a namespace policy of type single:
noobaa bucketclass create namespace-bucketclass single <my-bucket-class> --resource <resource> -n openshift-storage
-
resource-name
- The name you want to give the resource.
-
my-bucket-class
- A unique bucket class name.
-
resource
- A single namespace-store that defines the
read
and write
target of the namespace bucket.
-
To create a namespace bucket class with a namespace policy of type multi:
noobaa bucketclass create namespace-bucketclass multi <my-bucket-class> --write-resource <write-resource> --read-resources <read-resources> -n openshift-storage
-
resource-name
-
The name you want to give the resource.
-
my-bucket-class
-
A unique bucket class name.
-
write-resource
-
A single namespace-store that defines the write
target of the namespace
bucket.
-
read-resources
-
A list of namespace-stores separated by commas that defines the read
targets of
the namespace bucket.
- Create a bucket using an Object Bucket Class (OBC) resource that uses the bucket class
defined in the previous step.
noobaa obc create my-bucket-claim -n openshift-storage --app-namespace my-app --bucketclass <custom-bucket-class>
-
bucket-name
-
A bucket name of your choice.
-
custom-bucket-class
-
The name of the bucket class created in the previous step.
After the OBC is provisioned by the operator, a bucket is created in the MCG, and the operator
creates a Secret
and a ConfigMap
with the same name and in the
same namespace as that of the OBC.