Docs Menu
Docs Home
/ /
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 부터는 Kubernetes 에서 삭제 사용자 지정 2.0 리소스가 더 이상 ( 기본값) Atlas 에서 삭제되지 않습니다. 대신 Atlas Kubernetes Operator Atlas 에서 해당 리소스 관리를 중지할 뿐입니다. 예시 들어, Kubernetes 에서 Custom Resource(사용자 AtlasProject 지정 리소스)를 삭제 하면 기본값 으로 Atlas Kubernetes Operator 더 이상 Atlas 에서 해당 프로젝트 자동으로 삭제하지 않습니다. 이러한 동작 변경은 우발적이거나 예기치 않은 삭제를 방지하기 위한 것입니다. 이 동작을 Atlas Kubernetes Operator 이전에 사용된 기본값 으로 되돌리는 2 방법0 등 자세한 학습 새 기본값: Atlas Kubernetes Operator 2 의 삭제0 보호 기능을 참조하세요.

    마찬가지로, Atlas Kubernetes Operator 를 사용하여 Kubernetes 의 Atlas 프로젝트 에서 팀을 제거 하는 경우 Atlas Kubernetes Atlas Kubernetes Operator 는 Atlas 에서 팀을 삭제 하지 않습니다.

  • 기본값 Atlas 구성 값을 암시적으로 사용하지 않으려면 원하는 구성 세부 정보를 명시적으로 정의하세요. 경우에 따라 Atlas 기본값을 상속하면 조정 루프가 발생하여 사용자 지정 리소스 READY 상태 달성하지 못할 수 있습니다. 예시 들어 AtlasDeployment 사용자 지정 리소스 에 원하는 자동 확장 동작을 명시적으로 정의하면 포함된 예시 와 같이 사용자 지정 리소스 의 정적 인스턴스 크기가 자동 확장이 활성화된 Atlas 배포서버 에 반복적으로 적용되지 않도록 할 수 있습니다.

    autoScaling:
    diskGB:
    enabled: true
    compute:
    enabled: true
    scaleDownEnabled: true
    minInstanceSize: M30
    maxInstanceSize: M40
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