2장. 애플리케이션을 사용하여 Multicloud Object Gateway에 액세스
AWS S3를 대상으로 하는 모든 애플리케이션 또는 AWS S3 SDK(Software Development Kit)를 사용하는 코드로 오브젝트 서비스에 액세스할 수 있습니다. 애플리케이션은 MCG(Multicloud Object Gateway) 끝점, 액세스 키 및 시크릿 액세스 키를 지정해야 합니다. 터미널 또는 MCG CLI를 사용하여 이 정보를 검색할 수 있습니다.
RADOS Object Gateway(RGW) S3 엔드포인트에 액세스하는 방법에 대한 자세한 내용은 RADOS Object Gateway S3 엔드 포인트 액세스를 참조하십시오.
사전 요구 사항
- 실행 중인 OpenShift Data Foundation Platform.
보다 쉽게 관리할 수 있도록 MCG 명령줄 인터페이스를 다운로드합니다.
# subscription-manager repos --enable=rh-odf-4-for-rhel-8-x86_64-rpms # yum install mcg
참고서브스크립션 관리자를 사용하여 리포지토리를 활성화하기 위해 적절한 아키텍처를 지정합니다.
- IBM Power의 경우 다음 명령을 사용합니다.
# subscription-manager repos --enable=rh-odf-4-for-rhel-8-ppc64le-rpms
- IBM Z 인프라의 경우 다음 명령을 사용하십시오.
# subscription-manager repos --enable=rh-odf-4-for-rhel-8-s390x-rpms
또는 Download RedHat OpenShift Data Foundation 페이지 ()에 있는 OpenShift Data Foundation RPM에서 MCG 패키지를 설치할 수 있습니다.
참고아키텍처에 따라 올바른 제품 변형을 선택합니다.
다음 두 가지 방법으로 관련 끝점, 액세스 키 및 시크릿 액세스 키에 액세스할 수 있습니다.
예 2.1. 예제
- 가상 호스트 스타일을 사용하여 MCG 버킷에 액세스
- 클라이언트 애플리케이션이 https://<bucket-name>.s3-openshift-storage.apps.mycluster-cluster.qe.rh-ocs.com에 액세스하려고 하면
<bucket-name>MCG 버킷의 이름입니다.
예: https://mcg-test-bucket.s3-openshift-storage.apps.mycluster-cluster.qe.rh-ocs.com
S3 서비스를 가리키도록
mcg-test-bucket.s3-openshift-storage.apps.mycluster-cluster.qe.rh-ocs.com에 DNS 항목이 필요합니다.
가상 호스트 스타일을 사용하여 클라이언트 애플리케이션을 MCG 버킷을 가리키도록 DNS 항목이 있는지 확인합니다.
2.1. 터미널에서 Multicloud Object Gateway에 액세스
절차
describe 명령을 실행하여 액세스 키(AWS_ACCESS_KEY_ID 값) 및 시크릿 액세스 키(AWS_SECRET_ACCESS_KEY 값)를 포함하여 MCG(Multicloud Object Gateway) 엔드포인트에 대한 정보를 봅니다.
# oc describe noobaa -n openshift-storage
출력은 다음과 유사합니다.
Name: noobaa
Namespace: openshift-storage
Labels: <none>
Annotations: <none>
API Version: noobaa.io/v1alpha1
Kind: NooBaa
Metadata:
Creation Timestamp: 2019-07-29T16:22:06Z
Generation: 1
Resource Version: 6718822
Self Link: /apis/noobaa.io/v1alpha1/namespaces/openshift-storage/noobaas/noobaa
UID: 019cfb4a-b21d-11e9-9a02-06c8de012f9e
Spec:
Status:
Accounts:
Admin:
Secret Ref:
Name: noobaa-admin
Namespace: openshift-storage
Actual Image: noobaa/noobaa-core:4.0
Observed Generation: 1
Phase: Ready
Readme:
Welcome to NooBaa!
-----------------
Welcome to NooBaa!
-----------------
NooBaa Core Version:
NooBaa Operator Version:
Lets get started:
1. Connect to Management console:
Read your mgmt console login information (email & password) from secret: "noobaa-admin".
kubectl get secret noobaa-admin -n openshift-storage -o json | jq '.data|map_values(@base64d)'
Open the management console service - take External IP/DNS or Node Port or use port forwarding:
kubectl port-forward -n openshift-storage service/noobaa-mgmt 11443:443 &
open https://localhost:11443
2. Test S3 client:
kubectl port-forward -n openshift-storage service/s3 10443:443 &
1
NOOBAA_ACCESS_KEY=$(kubectl get secret noobaa-admin -n openshift-storage -o json | jq -r '.data.AWS_ACCESS_KEY_ID|@base64d')
2
NOOBAA_SECRET_KEY=$(kubectl get secret noobaa-admin -n openshift-storage -o json | jq -r '.data.AWS_SECRET_ACCESS_KEY|@base64d')
alias s3='AWS_ACCESS_KEY_ID=$NOOBAA_ACCESS_KEY AWS_SECRET_ACCESS_KEY=$NOOBAA_SECRET_KEY aws --endpoint https://localhost:10443 --no-verify-ssl s3'
s3 ls
Services:
Service Mgmt:
External DNS:
https://noobaa-mgmt-openshift-storage.apps.mycluster-cluster.qe.rh-ocs.com
https://a3406079515be11eaa3b70683061451e-1194613580.us-east-2.elb.amazonaws.com:443
Internal DNS:
https://noobaa-mgmt.openshift-storage.svc:443
Internal IP:
https://172.30.235.12:443
Node Ports:
https://10.0.142.103:31385
Pod Ports:
https://10.131.0.19:8443
serviceS3:
External DNS: 3
https://s3-openshift-storage.apps.mycluster-cluster.qe.rh-ocs.com
https://a340f4e1315be11eaa3b70683061451e-943168195.us-east-2.elb.amazonaws.com:443
Internal DNS:
https://s3.openshift-storage.svc:443
Internal IP:
https://172.30.86.41:443
Node Ports:
https://10.0.142.103:31011
Pod Ports:
https://10.131.0.19:6443