Join us Sept 17 at .local NYC! Use code WEB50 to save 50% on tickets. Learn more >
MongoDB Event
Docs Menu
Docs Home
/ /
MongoDB Atlas Kubernetes Operator
/

매개변수를 사용자 지정 리소스 정의로 마이그레이션

Atlas Kubernetes Operator 버전 2.6부터는 이전에 매개변수 형태를 취했던 다양한 리소스 구성이 자체 CRD로 전환되었습니다. 매개변수 기반 상위 리소스 구성에 대한 지원은 더 이상 사용되지 않습니다. 기존 매개변수 기반 상위 리소스 구성은 계속 작동하지만 이러한 구성에 대한 지원 향후 출시하다 에서 제거될 예정입니다.

향후 Atlas Kubernetes Operator 통해 이러한 리소스를 계속 관리하려면 적절한 CRD로 마이그레이션 .

영향을 받는 구성은 다음과 같습니다.

Parameter
CRD

spec.customRoles

매개변수 수준 리소스 관리 에서 CRD 관리 로 마이그레이션 하려면 다음을 수행합니다.

1

프로젝트 조정을 비활성화하고 하위 리소스 참조를 편집합니다.

  1. 상위 리소스의 metadatamongodb.com/atlas-reconciliation-policy: "skip" 주석을 추가합니다. 이렇게 하면 Atlas Kubernetes Operator 상위 리소스 와 해당 하위 리소스를 조정하려고 시도하는 것을 방지할 수 있습니다.

  2. 생성한 새 CRD와의 충돌을 방지하려면 마이그레이션 하려는 리소스 에 해당하는 매개변수를 상위 리소스 에서 삭제 해야 합니다.

customRoles 구성을 가진 atlasProject 의 다음 예시 살펴보겠습니다.

apiVersion: atlas.mongodb.com/v1
kind: AtlasProject
metadata:
name: my-project
spec:
name: Test project
connectionSecretRef:
name: my-atlas-key
customRoles:
role:
name: my-role
actions:
- name: getShardMap
resources:
cluster: true
- name: shardingState
resources:
cluster: true
- name: connPoolStats
resources:
cluster: true
- name: getLog
resources:
cluster: true
inheritedRoles:
- name: operator-role-1
role: backup
projectIpAccessList:
- cidrBlock: "203.0.113.0/24"
comment: "CIDR block for Application Server B - D"

5 및 6 줄에 annotations 차단 추가했는지 확인하고 이전 예시 에 표시된 customRoles 차단 제거 .

apiVersion: atlas.mongodb.com/v1
kind: AtlasProject
metadata:
name: my-project
annotations:
mongodb.com/atlas-reconciliation-policy: "skip"
spec:
name: Test project
connectionSecretRef:
name: my-atlas-key
projectIpAccessList:
- cidrBlock: "203.0.113.0/24"
comment: "CIDR block for Application Server B - D"

경고

이 주석을 적용 하지 않으면 Atlas Kubernetes Operator 는 사용자가 다른 리소스를 수정할 때 조정을 계속 시도합니다. Atlas Kubernetes Operator 에서 새 기본값: 삭제 보호 2.0 기능이 비활성화된 사용자의 경우, 리소스 를 제거 할 때 Atlas Kubernetes Operator 가 Atlas 프로젝트 를 atlasProject 제거하거나 활성 하위 리소스가 있는 프로젝트 를 제거 하려고 시도하는 차단된 상태 가 될 수 있습니다. 예를 들어 데이터베이스 사용자 또는 배포서버입니다.

2

생성한 새 CRD와의 충돌을 방지하려면 먼저 상위 리소스 에서 마이그레이션 하려는 리소스 에 해당하는 매개변수를 삭제 해야 합니다. 예시 들어, 이전에 표시된 atlasProject CRD에서 customRoles 매개변수를 제거 .

apiVersion: atlas.mongodb.com/v1
kind: AtlasProject
metadata:
name: my-project
annotations:
mongodb.com/atlas-reconciliation-policy: "skip"
spec:
name: Test project
connectionSecretRef:
name: my-atlas-key
projectIpAccessList:
- cidrBlock: "203.0.113.0/24"
comment: "CIDR block for Application Server B - D"
3

구문에 따라 마이그레이션 하려는 매개변수에 적합한 kind 의 CRD를 생성합니다. 예시 들어, 이전에 표시된 customRoles atlasProject CRD의 매개변수를 마이그레이션 하려면 Custom Resource(사용자 AtlasCustomRole 지정 리소스)를 만듭니다.

apiVersion: atlas.mongodb.com/v1
kind: AtlasCustomRole
metadata:
name: shard-operator-role
namespace: mongodb-atlas-system
labels:
mongodb.com/atlas-reconciliation-policy: keep
spec:
projectRef:
name: my-project
namespace: my-operator-namespace
role:
name: my-role
actions:
- name: getShardMap
resources:
cluster: true
- name: shardingState
resources:
cluster: true
- name: connPoolStats
resources:
cluster: true
- name: getLog
resources:
cluster: true
inheritedRoles:
- name: operator-role-1
role: backup
4
5

또한 이제 이 리소스 독립 CRD로 구성할 수 있습니다.

돌아가기

독립적인 사용자 지정 리소스 정의

이 페이지의 내용