Creating an AWS cache bucket

Create an AWS 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. In case of 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 aws-s3 <namespacestore> --access-key <AWS ACCESS KEY> --secret-key <AWS SECRET ACCESS KEY> --target-bucket <bucket-name>
      namespacestore
      Name of the namespacestore
      AWS ACCESS KEY and AWS SECRET ACCESS KEY
      AWS access key ID and secret access key you created for this purpose.
      bucket-name
      An existing AWS 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:
          AWS_ACCESS_KEY_ID: <AWS ACCESS KEY ID ENCODED IN BASE64>
          AWS_SECRET_ACCESS_KEY: <AWS SECRET ACCESS KEY ENCODED IN BASE64>

        You must supply and encode your own AWS access key ID and secret access key using Base64, and use the results in place of <AWS ACCESS KEY ID ENCODED IN BASE64> and <AWS 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:
          awsS3:
            secret:
              name: <namespacestore-secret-name>
              namespace: <namespace-secret>
            targetBucket: <target-bucket>
          type: aws-s3
        namespacestore
        A unique name for the NamespaceStore secret.
        namespacestore-secret-name
        A name for the NamespaceStore secret created in the previous step.
        namespace-secret
        Namespace used to create the secret in the previous step.
        target-bucket
        the AWS S3 bucket you created for the NamespaceStore.
  2. Run the following command to create a bucket class:
    noobaa bucketclass create namespace-bucketclass cache <my-cache-bucket-class> --backingstores <backing-store> --hub-resource <namespacestore>
    my-cache-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.