Atlas Kubernetes Operator は、Flex クラスターから専用クラスターへのインプレース移行をサポートしています。これにより、 Kubernetes環境からデータベースインフラストラクチャを直接増やすできます。
前提条件
始める前に、以下のものを用意してください。
Atlas Kubernetes Operator によって管理される既存の Flex クラスター階層
AtlasDeploymentKubernetesクラスター内の Flex クラスター階層の
AtlasDeploymentリソースを変更するための権限。Atlasプロジェクトで有効になっている請求。アップグレードすると、Atlas アカウントに料金が発生します。
手順
アップグレードする Flex クラスター構成を見つけます。
Flex クラスター構成は、Atlas Kubernetes Operator によって管理される AtlasDeploymentリソースで確認できます。
次の例は、us-east-1 リージョンのAmazon Web Servicesの Flex クラスター構成を示しています。
# my-cluster.yaml apiVersion: atlas.mongodb.com/v1 kind: AtlasDeployment metadata: name: my-flex-cluster spec: projectRef: name: my-atlas-project flexSpec: name: my-cluster providerSettings: backingProviderName: AWS regionName: US_EAST_1
spec.upgradeToDedicatedターゲットの専用クラスターの フィールドと完全な構成を追加します。
spec.upgradeToDedicatedフィールドを AtlasDeploymentリソースに追加します。このフィールドはブール値のフラグで、true に設定すると、Flex クラスターから専用クラスターへのインプレース アップグレードが開始されます。
spec.deploymentSpec ブロックで、ターゲット専用クラスターの完全な構成を指定します。これには、プロバイダー、リージョン、インスタンスサイズ、その他の必要なパラメーターなどの詳細が含まれます。
専用クラスターには、元の Flex クラスターと同じ名前を使用します。
注意
専用クラスターに別の名前を使用すると、移行は失敗します。
次の例は、Flex クラスター構成を変更して専用クラスターへの移行を開始する方法を示しています。
# my-cluster.yaml apiVersion: atlas.mongodb.com/v1 kind: AtlasDeployment metadata: # The name MUST remain the same name: my-flex-cluster spec: projectRef: name: my-atlas-project # Add the upgrade flag upgradeToDedicated: true # Add the full configuration for the target Dedicated-cluster deploymentSpec: name: "my-cluster" # The name MUST remain the same clusterType: REPLICASET backupEnabled: true replicationSpecs: - regionConfigs: - providerName: AWS regionName: US_EAST_1 priority: 7 electableSpecs: instanceSize: M10 nodeCount: 3
移行プロセスを監視します。
Atlas Kubernetes Operator は、移行プロセスをすぐに開始します。kubectl describe コマンドを使用して進捗状況を監視できます。
kubectl describe atlasdeployment my-flex-cluster
最初に、DeploymentReady 条件は次のように表示されます。
Status: Conditions: ... - Last Transition Time: 2025-06-18T10:00:00Z Message: Cluster upgrade to dedicated instance initiated in Atlas... Reason: FlexToDedicatedMigrationProgressing Status: "False" Type: DeploymentReady
移行が完了すると、DeploymentReady の条件は次のように更新されます。
Status: Conditions: ... - Last Transition Time: 2025-06-18T10:15:00Z Message: Cluster upgrade successful. You can now remove the 'upgradeToDedicated' flag from the spec. Status: "True" Type: DeploymentReady
アップグレード完了後の 出力にも Normalイベントが表示されます。移行が失敗した場合、DeploymentReady 条件にはエラー メッセージと Reason が表示されます。すでにクラスターを専用クラスターに移行している場合は、変更はありません。
移行後のクリーンアップ。
移行が完了したら、AtlasDeploymentリソースから upgradeToDedicated フラグを削除し、再度適用できます。この手順は任意ですが、構成をクリーンに維持し、移行が誤って再トリガーされるのを防ぐために推奨されます。
最後の AtlasDeploymentリソースは、次の例のようになります。
# my-cluster.yaml apiVersion: atlas.mongodb.com/v1 kind: AtlasDeployment metadata: name: my-flex-cluster spec: projectRef: name: my-atlas-project deploymentSpec: name: "my-cluster" # The name MUST remain the same clusterType: REPLICASET backupEnabled: true replicationSpecs: - regionConfigs: - providerName: AWS regionName: US_EAST_1 priority: 7 electableSpecs: instanceSize: M10 nodeCount: 3