Este conteúdo não está disponível no idioma selecionado.
Chapter 2. Accessing the Multicloud Object Gateway with your applications
You can access the object service with any application targeting AWS S3 or code that uses AWS S3 Software Development Kit (SDK). Applications need to specify the Multicloud Object Gateway (MCG) endpoint, an access key, and a secret access key. You can use your terminal or the MCG CLI to retrieve this information.
For information on accessing the RADOS Object Gateway (RGW) S3 endpoint, see Accessing the RADOS Object Gateway S3 endpoint.
Prerequisites
- A running OpenShift 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
# subscription-manager repos --enable=rh-odf-4-for-rhel-8-x86_64-rpms # yum install mcg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteSpecify 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
# subscription-manager repos --enable=rh-odf-4-for-rhel-8-ppc64le-rpms
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - For IBM Z, use the following command:
subscription-manager repos --enable=rh-odf-4-for-rhel-8-s390x-rpms
# subscription-manager repos --enable=rh-odf-4-for-rhel-8-s390x-rpms
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Alternatively, you can install the MCG package from the OpenShift Data Foundation RPMs found at Download RedHat OpenShift Data Foundation page.
NoteChoose the correct Product Variant according to your architecture.
You can access the relevant endpoint, access key, and secret access key in two ways:
For example:
- Accessing the MCG bucket(s) using the virtual-hosted style
- If the client application tries to access https://<bucket-name>.s3-openshift-storage.apps.mycluster-cluster.qe.rh-ocs.com
<bucket-name>
is the name of the MCG bucket
For example, https://mcg-test-bucket.s3-openshift-storage.apps.mycluster-cluster.qe.rh-ocs.com
A DNS entry is needed for
mcg-test-bucket.s3-openshift-storage.apps.mycluster-cluster.qe.rh-ocs.com
to point to the S3 Service.
Ensure that you have a DNS entry in order to point the client application to the MCG buckets using the virtual-hosted style.
2.1. Accessing the Multicloud Object Gateway from the terminal Copiar o linkLink copiado para a área de transferência!
Procedure
Run the describe
command to view information about the Multicloud Object Gateway (MCG) endpoint, including its access key (AWS_ACCESS_KEY_ID
value) and secret access key (AWS_SECRET_ACCESS_KEY
value).
oc describe noobaa -n openshift-storage
# oc describe noobaa -n openshift-storage
The output will look similar to the following:
The output from the oc describe noobaa
command lists the internal and external DNS names that are available. When using the internal DNS, the traffic is free. The external DNS uses Load Balancing to process the traffic, and therefore has a cost per hour.
2.2. Accessing the Multicloud Object Gateway from the MCG command-line interface Copiar o linkLink copiado para a área de transferência!
Prerequisites
Download the MCG command-line interface.
subscription-manager repos --enable=rh-odf-4-for-rhel-8-x86_64-rpms yum install mcg
# subscription-manager repos --enable=rh-odf-4-for-rhel-8-x86_64-rpms # yum install mcg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteSpecify 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
# subscription-manager repos --enable=rh-odf-4-for-rhel-8-ppc64le-rpms
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - For IBM Z, use the following command:
subscription-manager repos --enable=rh-odf-4-for-rhel-8-s390x-rpms
# subscription-manager repos --enable=rh-odf-4-for-rhel-8-s390x-rpms
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Procedure
Run the status
command to access the endpoint, access key, and secret access key:
noobaa status -n openshift-storage
noobaa status -n openshift-storage
The output will look similar to the following:
You have the relevant endpoint, access key, and secret access key in order to connect to your applications.
For example:
If AWS S3 CLI is the application, the following command will list the buckets in OpenShift Data Foundation:
AWS_ACCESS_KEY_ID=<AWS_ACCESS_KEY_ID> AWS_SECRET_ACCESS_KEY=<AWS_SECRET_ACCESS_KEY> aws --endpoint <ENDPOINT> --no-verify-ssl s3 ls
AWS_ACCESS_KEY_ID=<AWS_ACCESS_KEY_ID>
AWS_SECRET_ACCESS_KEY=<AWS_SECRET_ACCESS_KEY>
aws --endpoint <ENDPOINT> --no-verify-ssl s3 ls
2.3. Support of Multicloud Object Gateway data bucket APIs Copiar o linkLink copiado para a área de transferência!
The following table lists the Multicloud Object Gateway (MCG) data bucket APIs and their support levels.
Data buckets | Support | |
List buckets | Supported | |
Delete bucket | Supported | Replication configuration is part of MCG bucket class configuration |
Create bucket | Supported | A different set of canned ACLs |
Post bucket | Not supported | |
Put bucket | Partially supported | Replication configuration is part of MCG bucket class configuration |
Bucket lifecycle | Partially supported | Object expiration only |
Policy (Buckets, Objects) | Partially supported | Bucket policies are supported |
Bucket Website | Supported | |
Bucket ACLs (Get, Put) | Supported | A different set of canned ACLs |
Bucket Location | Partialy | Returns a default value only |
Bucket Notification | Not supported | |
Bucket Object Versions | Supported | |
Get Bucket Info (HEAD) | Supported | |
Bucket Request Payment | Partially supported | Returns the bucket owner |
Put Object | Supported | |
Delete Object | Supported | |
Get Object | Supported | |
Object ACLs (Get, Put) | Supported | |
Get Object Info (HEAD) | Supported | |
POST Object | Supported | |
Copy Object | Supported | |
Multipart Uploads | Supported | |
Object Tagging | Supported | |
Storage Class | Not supported |
No support for cors, metrics, inventory, analytics, inventory, logging, notifications, accelerate, replication, request payment, locks verbs