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

Migrate a Flex cluster to a Dedicated cluster

Atlas Kubernetes Operator supports migrating from a Flex cluster to a Dedicated cluster in place. This enables you to scale your database infrastructure directly from your Kubernetes environment.

Before you begin, you must have the following:

  • An existing Flex cluster-tier AtlasDeployment managed by Atlas Kubernetes Operator.

  • Permissions to modify the Flex cluster-tier AtlasDeployment resource in your Kubernetes cluster.

  • Billing enabled for your Atlas project. Upgrading will result in charges to your Atlas account.

1

You can find your Flex cluster configuration in the AtlasDeployment resource managed by Atlas Kubernetes Operator.

The following example shows a Flex cluster configuration on AWS in the us-east-1 region.

# 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
2

Add the spec.upgradeToDedicated field to your AtlasDeployment resource. This field is a boolean flag that, when set to true, initiates an in-place upgrade from a Flex cluster to a Dedicated cluster.

In the spec.deploymentSpec block, provide the full configuration for the target Dedicated cluster. This includes details such as the provider, region, instance size, and any other necessary parameters.

Use the same name for your Dedicated cluster as your original Flex cluster.

Note

If you use a different name for the Dedicated cluster, the migration fails.

The following example shows how to modify the Flex cluster configuration to initiate the migration to a Dedicated cluster.

# 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
3

Use the kubectl apply command to apply the changes to your Kubernetes cluster.

kubectl apply -f my-cluster.yaml
4

Atlas Kubernetes Operator immediately starts the migration process. You can monitor the progress using the kubectl describe command.

kubectl describe atlasdeployment my-flex-cluster

Initially, the DeploymentReady condition appears as the following:

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

Once the migration is complete, the DeploymentReady condition updates to:

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

You also see a Normal event in the output after the upgrade completes. If the migration fails, the DeploymentReady condition shows an error message and the Reason. If you already migrated the cluster to Dedicated cluster, nothing changes.

5

After the migration is complete, you can remove the upgradeToDedicated flag from your AtlasDeployment resource and apply it again. This step is optional but recommended to keep your configuration clean and prevent accidental re-triggering of the migration.

The final AtlasDeployment resource looks like the following example:

# 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
6

You successfully migrated your Flex cluster to a Dedicated cluster. Your cluster is now a Dedicated cluster M10 instance. Manage it as a Dedicated cluster using Atlas Kubernetes Operator. Your application connection strings now point to the new Dedicated cluster.

Back

AtlasFederatedAuth

On this page