Atlas Kubernetes Operator バージョン 2.6 以降、以前は パラメーターの形式であったさまざまなリソース構成は、独自の CRD に移行しました。 パラメーターベースの親リソース構成のサポートは非推奨です。 既存のパラメーターベースの親リソース構成は引き続き機能しますが、これらの構成のサポートは将来のリリースで削除される予定です。
将来的に Atlas Kubernetes Operator を使用してこれらのリソースを管理し続けるには、適切な CRD に移行してください。
影響を受ける構成
次の構成は影響を受けます。
Parameter | CRD |
|---|---|
| |
|
リソース固有の考慮事項
パラメーターをリソースに移行する前に、それらのパラメーターに固有の実装の詳細を検討してください。
ネットワークピアリング
atlasNetworkPeering リソースには次の考慮事項が適用されます。
atlasNetworkPeeringCRD は、 Kubernetes名前参照またはIDによって、対応するatlasNetworkContainerを参照できます。atlasNetworkPeeringCRD は、 Kubernetes名前参照またはIDでホストされているatlasProjectを参照できます。The spec.networkPeers parameter of an
atlasProjectCRD contains details of both the peering connection itself and the container that supports it. When you migrate from this parameter to anatlasNetworkPeeringCRD, you might need to create anatlasNetworkContainerCRD for the container that supports it. To learn more, see Network Container.
ネットワーク コンテナ
atlasNetworkContainer リソースには次の考慮事項が適用されます。
atlasNetworkPeering接続をパラメータからリソースに移行するときに、次のいずれかの場合に新しいatlasNetworkContainerリソースを作成する必要はありません。atlasNetworkPeering接続を管理する Atlas Kubernetes OperatoratlasProjectの外部で、atlasNetworkPeering接続をサポートするネットワークコンテナを管理するatlasNetworkPeering接続のコンテナのatlasNetworkContainerリソースはすでに存在します。
atlasNetworkContainerCRD は、 Kubernetes名前参照またはIDによってホストatlasProjectを参照できます。
サードパーティ統合
AtlasThirdPartyIntegration リソースには次の考慮事項が適用されます。
各サードパーティ統合には独自の
AtlasThirdPartyIntegrationリソースが必要です。同じリソース内で複数の統合を定義することはできません。各プロジェクトには、特定のタイプのサードパーティ統合のインスタンスのみを含めることができます。
AtlasProjectリソース内のそのタイプのspec.integrationsエントリ、またはその値のspec.typeを持つAtlasThirdPartyIntegrationリソースによって構成されます。例、
AtlasThirdPartyIntegrationCRD がspec.typeDATADOGの場合、AtlasProjectリソースでDATADOGのspec.integrations.typeを宣言することはできません。
移行手順
パラメーターレベルのリソース管理から 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 OperatorAtlas Kubernetes Operator2.0 の削除保護が無効になっているユーザーの場合、これにより、Atlas Kubernetes Operator リソースを削除するとAtlas atlasProjectAtlas Kubernetes Operator が Atlasプロジェクトを削除するか、アクティブなサブリソースを持つプロジェクトを削除しようとすると ブロック状態になる可能性があります。データベースユーザーや配置など。
親 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 atlasProjectCRD の パラメータを移行するには、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 として構成できるようになりました。