매개변수를 사용자 지정 리소스 정의로 마이그레이션
이 페이지의 내용
Atlas Kubernetes Operator 버전 2.6부터는 이전에 매개변수 형태를 취했던 다양한 리소스 구성이 자체 CRD로 전환되었습니다. 매개변수 기반 상위 리소스 구성에 대한 지원은 더 이상 사용되지 않습니다. 기존 매개변수 기반 상위 리소스 구성은 계속 작동하지만 이러한 구성에 대한 지원 향후 출시하다 에서 제거될 예정입니다.
향후 Atlas Kubernetes Operator 통해 이러한 리소스를 계속 관리하려면 적절한 CRD로 마이그레이션 .
영향을 받는 구성
영향을 받는 구성은 다음과 같습니다.
리소스별 고려 사항
매개변수를 리소스로 마이그레이션 전에 해당 매개변수와 관련된 구현 세부 정보를 고려하세요.
네트워크 피어링
다음 고려 사항은 atlasNetworkPeering
리소스에 적용 .
atlasNetworkPeering
CRD는 Kubernetes 이름 참조 또는 ID 로 해당atlasNetworkContainer
를 참조할 수 있습니다.atlasNetworkPeering
CRD는 Kubernetes 이름 참조 또는 ID 로 이를 호스팅하는atlasProject
를 참조할 수 있습니다.atlasProject
CRD의spec.networkPeers
매개변수에는 피어링 연결 자체와 이를 지원하는 컨테이너에 대한 세부 정보가 모두 포함되어 있습니다. 이 매개변수에서atlasNetworkPeering
CRD로 마이그레이션 경우, 이를 지원하는 컨테이너 에 대해atlasNetworkContainer
CRD를 생성해야 할 수 있습니다. 자세한 학습 은 네트워크 컨테이너를 참조하세요.
네트워크 컨테이너
다음 고려 사항은 atlasNetworkContainer
리소스에 적용 .
다음과 같은 경우에는
atlasNetworkPeering
연결을 매개변수에서 리소스 로 마이그레이션 할 때 새atlasNetworkContainer
리소스 생성할 필요가 없습니다.atlasNetworkPeering
연결을 관리 관리 Atlas Kubernetes OperatoratlasProject
외부에서atlasNetworkPeering
연결을 지원하는 네트워크 컨테이너 관리 .atlasNetworkPeering
연결의 컨테이너 에 대한atlasNetworkContainer
리소스 이미 존재합니다.
atlasNetworkContainer
CRD는 Kubernetes 이름 참조 또는 ID 로 호스팅하다atlasProject
를 참조할 수 있습니다.
마이그레이션 절차
매개변수 수준 리소스 관리 에서 CRD 관리 로 마이그레이션 하려면 다음을 수행합니다.
프로젝트 조정을 비활성화하고 하위 리소스 참조를 편집합니다.
상위 리소스의
metadata
에mongodb.com/atlas-reconciliation-policy: "skip"
주석을 추가합니다. 이렇게 하면 Atlas Kubernetes Operator 상위 리소스 와 해당 하위 리소스를 조정하려고 시도하는 것을 방지할 수 있습니다.생성한 새 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
제거하거나 활성 하위 리소스가 있는 프로젝트 를 제거 하려고 시도하는 차단된 상태 가 될 수 있습니다. 예를 들어 데이터베이스 사용자 또는 배포서버입니다.
상위 CRD에서 매개변수를 삭제합니다.
생성한 새 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"
새 CRD를 만듭니다.
구문에 따라 마이그레이션 하려는 매개변수에 적합한 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
또한 이제 이 리소스 독립 CRD로 구성할 수 있습니다.