문서 메뉴
문서 홈
/ /
MongoDB Atlas Kubernetes Operator

Data Federation 설정

이 페이지의 내용

  • 전제 조건
  • 절차
  • Atlas에서 Amazon Web Services IAM 역할 생성
  • AWS IAM 역할 신뢰 정책을 수정합니다.
  • AtlasDataFederation 사용자 지정 리소스를 만듭니다.
  • 연합 데이터베이스 인스턴스의 상태를 확인합니다.
  • 다음 단계로 넘어갑니다.

이 튜토리얼에서는 Atlas Kubernetes Operator를 사용하여 Kubernetes 구성 파일에서 Atlas에서 연합 데이터베이스 인스턴스를 생성하는 방법을 보여줍니다. 이 튜토리얼의 연합 데이터베이스 인스턴스는 Amazon Web Services S3 버킷과 Atlas cluster를 연결합니다.

이 튜토리얼에는 다음이 필요합니다.

중요

Custom Resource(사용자 정의 리소스)는 더 이상 기본적으로 객체를 삭제하지 않음

Atlas Kubernetes Operator는 사용자 지정 리소스 구성 파일을 사용하여 Atlas 구성을 관리합니다. 다만 Atlas Kubernetes Operator 2.0부터는 Kubernetes에서 삭제한 사용자 지정 리소스가 더 이상 Atlas에서 삭제되지 않습니다. 대신 Atlas Kubernetes Operator에서는 이러한 리소스의 관리가 중단될 뿐입니다. 그 예로 Kubernetes에서 AtlasProject 사용자 지정 리소스를 삭제하는 경우, Atlas Kubernetes Operator는 Atlas에서 해당 프로젝트를 더 이상 자동으로 삭제하지 않음으로써 우발적이거나 예기치 못한 삭제를 방지할 수 있습니다. Atlas Kubernetes Operator 2.0 이전에 사용된 기본값으로 이 동작을 되돌리는 방법을 포함하여 자세한 내용은 새로운 기본값: Atlas Kubernetes Operator 2.0의 삭제 방지를 참조하세요.

1
  1. 다음 Atlas CLI 명령을 실행하여 Atlas에서 새 Amazon Web Services IAM 역할을 생성합니다. 다음 자리 표시자를 원하는 값으로 바꿉니다.

    자리 표시자
    설명
    PROJECT-ID
    사용할 Atlas 프로젝트를 식별하는 고유한 24자 16진수 문자열입니다.
    atlas cloudProviders accessRoles aws create --projectId <PROJECT-ID>
  2. 반환된 필드 값 RoleID, Atlas AWS Account ARNUnique External ID 에 유의하세요.

    AWS IAM role '<RoleID>' successfully created.
    Atlas AWS Account ARN: <AtlasAWSAccountARN>
    Unique External ID: <AtlasAssumedRoleExternalID>
2
  1. AWS 관리 콘솔에 로그인합니다.

  2. Identity and Access Management (IAM) 서비스로 이동합니다.

  3. 왼쪽 탐색에서 Roles 을 선택합니다.

  4. 역할 목록에서 Atlas 액세스에 사용하려는 기존 IAM 역할을 클릭합니다.

  5. 0}Trust Relationships 탭을 선택합니다.

  6. Edit trust relationship 버튼을 클릭합니다.

  7. Policy Document를 편집합니다. 다음 내용이 포함된 새 Statement 객체를 추가합니다.

    참고

    강조 표시된 줄을 이전 단계에서 반환된 값으로 바꿉니다.

    {
    "Version":"2012-10-17",
    "Statement":[
    {
    "Effect":"Allow",
    "Principal":{
    "AWS":"<atlasAWSAccountArn>"
    },
    "Action":"sts:AssumeRole",
    "Condition":{
    "StringEquals":{
    "sts:ExternalId":"<atlasAssumedRoleExternalId>"
    }
    }
    }
    ]
    }
  8. Update Trust Policy 버튼을 클릭합니다.

3

다음 명령을 실행하여 AtlasDataFederation 사용자 지정 리소스 를 생성합니다. roleId 는 이전 단계에서 RoleID 에 대해 반환된 값과 일치해야 하며 spec.projectRef.nameAtlasProject 사용자 지정 리소스의 이름과 일치해야 합니다.

cat <<EOF | kubectl apply -f -
apiVersion: atlas.mongodb.com/v1
kind: AtlasDataFederation
metadata:
name: my-federated-deployment
spec:
projectRef:
name: my-project
namespace: default
cloudProviderConfig:
aws:
roleId: 12345678
testS3Bucket: my-bucket
dataProcessRegion:
cloudProvider: AWS
region: OREGON_USA
name: my-fdi
storage:
databases:
- collections:
- dataSources:
- allowInsecure: false
collection: my-collection
collectionRegex:
database: my-database
databaseRegex:
defaultFormat: ".avro"
path: /
provenanceFieldName: string
storeName: my-data-store
urls:
- string:
name: my-collection-mdb
maxWildcardCollections: 100
name: my-database-mdb
views:
- name: my-view
pipeline:
source: my-source-collection
stores:
- name: my-store
provider: S3
additionalStorageClasses:
- STANDARD
bucket: my-bucket
delimiter: /
includeTags: false
prefix: data-
public: false
region: US_WEST_1
EOF
4

데이터베이스 사용자가 준비되었음을 나타내는 True 응답을 받을 때까지 다음 명령을 실행합니다.

kubectl get atlasdatafederation my-federated-deployment -o=jsonpath='{.status.conditions[?(@.type=="Ready")].status}'

연합 데이터베이스 인스턴스에 대한 비공개 엔드포인트를 구성하려면 비공개 엔드포인트 관리를 참조하세요.

돌아가기

Import Projects

다음

Atlas Search