Creating an IBM COS cache bucket

Create an IBM COS cache bucket.

Before you begin

  • 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.
    • For IBM Power, use the following command:
      subscription-manager repos --enable=rh-odf-4-for-rhel-8-ppc64le-rpms
    • For IBM Z infrastructure, use the following command:
      subscription-manager repos --enable=rh-odf-4-for-rhel-8-s390x-rpms
  • 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.

About this task

This procedure describes creating a NamespaceStore. A NamespaceStore represents an underlying storage to be used as a read or write target for the data in the MCG namespace buckets.

Procedure

  1. Create NamespaceStore in one of the following ways:
    • From the MCG command-line interface, run the following command:
      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>
      namespacestore
      Name of the NamespaceStore
      IBM COS ENDPOINT
      An appropriate regional endpoint that corresponds to the location of the existing IBM bucket.
      IBM ACCESS KEY and IBM SECRET ACCESS KEY
      IBM access key ID and secret access key you created for this purpose.
      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.
    • Add storage resources by applying a YAML.
      1. Create a secret with credentials, where <namespacestore-secret-name> is a unique name for the NamespaceStore secret.
        apiVersion: v1
        kind: Secret
        metadata:
          name: <namespacestore-secret-name>
        type: Opaque
        data:
          IBM_COS_ACCESS_KEY_ID: <IBM COS ACCESS KEY ID ENCODED IN BASE64>
          IBM_COS_SECRET_ACCESS_KEY: <IBM COS SECRET ACCESS KEY ENCODED IN BASE64>

        You must supply and encode your own IBM COS access key ID and secret access key using Base64, and use the results in place of <IBM COS ACCESS KEY ID ENCODED IN BASE64> and <IBM COS SECRET ACCESS KEY ENCODED IN BASE64>.

      2. Apply the following YAML:
        apiVersion: noobaa.io/v1alpha1
        kind: NamespaceStore
        metadata:
          finalizers:
          - noobaa.io/finalizer
          labels:
            app: noobaa
          name: <namespacestore>
          namespace: openshift-storage
        spec:
          s3Compatible:
            endpoint: <IBM COS ENDPOINT>
            secret:
              name: <backingstore-secret-name>
              namespace: <namespace-secret>
            signatureVersion: v2
            targetBucket: <target-bucket>
          type: ibm-cos
        namespacestore
        A unique name for the NamespaceStore secret.
        IBM COS ENDPOINT
        An appropriate regional endpoint that corresponds to the location of the existing IBM bucket.
        backingstore-secret-name
        A name for the backing store secret created in the previous step.
        namespace-secret
        Namespace used to create the secret in the previous step.
        target-bucket
        the IBM COS bucket you created for the NamespaceStore.
  2. Run the following command to create a bucket class:
    noobaa bucketclass create namespace-bucketclass cache <my-bucket-class> --backingstores <backing-store> --hub-resource <namespacestore>
    my-bucket-class
    A unique bucket class name.
    backing-store
    Name of the relevant backing store. You can also list more than one backing stores separated by commas.
    namespacestore
    Name of the NamespaceStore created in the previous step.
  3. Run the following command to create a bucket using an Object Bucket Claim (OBC) resource that uses the bucket class defined in the previous step.
    noobaa obc create <my-bucket-claim> my-app --bucketclass <custom-bucket-class>
    my-bucket-claim
    A unique object bucket claim name.
    custom-bucket-class
    Name of the bucket class created in the previous step.