Migration to Flex Clusters
Important
Migration to Flex Clusters
Atlas deprecated
M2andM5clusters and Serverless instances. Atlas will automatically migrate allM2andM5clusters to Flex clusters. For Serverless instances, Atlas will determine whether to migrate instances to Free clusters, Flex clusters, or Dedicated clusters according to your usage, then migrate your Serverless instances automatically. To see which tiers Atlas will migrate your instances to, consult the All Clusters page in the Atlas UI. To learn more, see the Flex Migration Guide in the Atlas documentation.Replace references to
spec.serverlessSpecwith configuration forspec.flexSpec.
Breaking Changes with Atlas Kubernetes Operator 2.0
Important
Action Required for Breaking Changes with Atlas Kubernetes Operator 2.0
With Atlas Kubernetes Operator 2.0,
deploymentSpecreplacesadvancedDeploymentSpecin theAtlasDeploymentcustom resource. You must update yourAtlasDeploymentcustom resource as follows:If you use
advancedDeploymentSpec, rename it todeploymentSpec. You don't need to change any formatting.If you used
deploymentSpecprior to Atlas Kubernetes Operator 2.0, rewrite yourAtlasDeploymentcustom resource to match the formatting used in the examples.
Atlas Kubernetes Operator uses custom resource configuration files to manage your Atlas configuration. As of Atlas Kubernetes Operator 2.0, custom resources you delete in Kubernetes are no longer deleted in Atlas. Instead, Atlas Kubernetes Operator simply stops managing those resources. For example, if you delete an
AtlasProjectCustom Resource in Kubernetes, Atlas Kubernetes Operator no longer automatically deletes the corresponding project from Atlas, preventing accidental or unexpected deletions. To learn more, including how to revert this behavior to the default used prior to Atlas Kubernetes Operator 2.0, see New Default: Deletion Protection in Atlas Kubernetes Operator 2.0.
About the AtlasDeployment Custom Resource
The AtlasDeployment custom resource configures your MongoDB cluster
or Flex cluster in Atlas. When you create the AtlasDeployment
custom resource, Atlas Kubernetes Operator tries to create or update a cluster or
Flex cluster in Atlas.
Atlas Kubernetes Operator does one of the following actions depending on the values you
specify in the AtlasDeployment custom resource:
If you specify values for fields under
spec.deploymentSpec, Atlas Kubernetes Operator uses the Atlas Clusters API Resource to create a new cluster or update an existing cluster.If you specify values for fields under
spec.flexSpec, Atlas Kubernetes Operator uses the Atlas Flex Instance API Resource to create a new Flex cluster or update an existing Flex cluster.
Note
Don't specify values for fields under spec.serverlessSpec because
Serverless instances are deprecated. Instead, specify fields under
spec.flexSpec. To learn more, see Migration to Flex Clusters.
Creating or updating a cluster or Flex cluster can take up to 10 minutes. Atlas Kubernetes Operator monitors the update process.
You can run the following command to check on the status:
kubectl get atlasdeployment -o yaml
The following example shows the status section of a cluster that is provisioning:
status: conditions: - lastTransitionTime: "2024-03-18T16:32:43Z" status: "False" type: ClusterReady reason: ClusterCreating message: Cluster is provisioning
The ClusterReady status will change to True when the cluster
or Serverless instance is ready.
Examples
Status Example
The following example shows the AtlasDeployment resource with a
ClusterReady status of True:
apiVersion: atlas.mongodb.com/v1 kind: AtlasDeployment metadata: name: my-atlas-cluster namespace: mongodb-atlas-system spec: projectRef: name: my-project deploymentSpec: name: test-cluster tags: - key: "environment" value: "production" replicationSpecs: - zoneName: US-Zone numShards: 3 regionConfigs: - regionName: CENTRAL_US providerName: GCP backingProviderName: GCP priority: 7 electableSpecs: instanceSize: M10 nodeCount: 3 status: conditions: - lastTransitionTime: "2024-03-18T16:32:43Z" status: "True" type: Ready - lastTransitionTime: "2024-03-18T16:32:43Z" status: "True" type: ClusterReady connectionStrings: standard: mongodb://test-cluster-shard-00-00.kpc8f.mongodb.net:27017,test-cluster-shard-00-01.kpc8f.mongodb.net:27017,test-cluster-shard-00-02.kpc8f.mongodb.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-1gm1pv-shard-0 standardSrv: mongodb+srv://test-cluster.kpc8f.mongodb.net mongoDBVersion: 6.0 mongoURIUpdated: "2024-03-12T12:21:41Z" observedGeneration: 1 stateName: IDLE
Configuration Example
The following example shows an AtlasDeployment custom resource
specification configured for auto-scaling multi-region clusters:
apiVersion: atlas.mongodb.com/v1 kind: AtlasDeployment metadata: name: test-cluster-name namespace: mongodb-atlas-system spec: projectRef: name: development deploymentSpec: clusterType: REPLICASET name: service-name tags: - key: "environment" value: "production" backupEnabled: true replicationSpecs: - numShards: 1 regionConfigs: - regionName: EASTERN_US providerName: GCP autoScaling: diskGB: enabled: true compute: enabled: true scaleDownEnabled: true minInstanceSize: M30 maxInstanceSize: M40 analyticsSpecs: instanceSize: M30 nodeCount: 1 electableSpecs: instanceSize: M30 nodeCount: 3 priority: 7 readOnlySpecs: instanceSize: M30 nodeCount: 1
Additional Options Example
The following example shows an AtlasDeployment custom resource
specification configured with some of the additional options.
apiVersion: atlas.mongodb.com/v1 kind: AtlasDeployment metadata: name: my-atlas-cluster spec: projectRef: name: my-project deploymentSpec: name: test-cluster tags: - key: "environment" value: "production" replicationSpecs: - zoneName: Zone 1 regionConfigs: - electableSpecs: instanceSize: M10 nodeCount: 3 providerName: AWS regionName: US_EAST_1 priority: 7 processArgs: javascriptEnabled: false
Flex Cluster Example
Notes on Transition To Flex Clusters
Until January 2026, to preserve backwards compatibility for a period of time, Atlas allows you to manage migrated clusters through both the Serverless instances and Flex clusters APIs, including when you're using Atlas Kubernetes Operator.
You can create and manage Flex clusters in the same AtlasDeployment in which you created and managed Serverless instances and
M2andM5clusters.You can't create NEW
M2/M5clusters and Serverless instances in Atlas. Attempting to do so creates a Flex cluster instead.You can still use existing Serverless instances in Atlas Kubernetes Operator even though existing Serverless instances are deprecated as of early February 2025.
For your existing Serverless instances, you can choose to replace references to
spec.serverlessSpecin the AtlasDeployment with the configuration forspec.flexSpec. Or, you can continue using the same spec. Managing a deployment via thespec.serverlessSpecin theAtlasDeploymentCustom Resource will continue to work even once Atlas automatically migrates these existing clusters to Flex clusters in March 2025.For your existing
M2andM5clusters, you can choose to replace references tospec.deploymentSpecin theAtlasDeploymentCustom Resource with the configuration forspec.flexSpec. Or, you can continue using the same spec. Managing a deployment via thespec.deploymentSpecin theAtlasDeploymentCustom Resource will continue to work even once Atlas automatically migrates these existingM2andM5clusters to Flex clusters in May 2025.For your existing Serverless instances, if you receive errors during reconciliations related to private endpoints, you must upgrade to Atlas Kubernetes Operator 2.7.1, or replace the
serverlessSpecconfiguration with the configuration forflexSpecin theAtlasDeploymentcustom resource.For your
M2andM5clusters, to avoid reconciliation errors that you might notice after the automigration, make the following changes to your CRD configurations:Remove the
spec.deploymentSpec.replicationSpecs.zoneNamesetting.Remove any of the
spec.deploymentSpec.replicationSpecs.regionConfigssettings after the first set of settings.Specify
replicasetonly in thespec.deploymentSpec.clusterType.
Alternatively, replace references to
spec.deploymentSpecin the AtlasDeployment with the configuration forspec.flexSpec.By January 2026, you must remove all remaining
M2/M5and Serverless Instance configurations from your Atlas Kubernetes Operator custom resources because backwards compatibility of APIs ends January 2026, when the old APIs will be removed and only APIs related to Flex clusters will remain in place.Newer releases of Atlas Kubernetes Operator will cease supporting existing
M2/M5clusters and Serverless instances. Older versions of Atlas Kubernetes Operator will continue to support these instance types until January 2026.
To learn more, see Migration to Flex Clusters in this guide and the Flex Migration Guide in the Atlas documentation.
The following example shows an AtlasDeployment custom resource
specification configured for a Flex cluster:
apiVersion: atlas.mongodb.com/v1 kind: AtlasDeployment metadata: name: test-cluster-name namespace: mongodb-atlas-system spec: projectRef: name: my-project flexSpec: name: flex-cluster tags: - key: "environment" value: "production" providerSettings: backingProviderName: AWS regionName: US_EAST_1
Serverless Instance Example
Note
Don't specify values for fields under spec.serverlessSpec
because Serverless instances are deprecated. Instead, specify fields
under spec.flexSpec. To learn more, see Migration to Flex Clusters.
The following example shows an AtlasDeployment custom resource
specification configured for a Serverless instance:
apiVersion: atlas.mongodb.com/v1 kind: AtlasDeployment metadata: name: test-cluster-name namespace: mongodb-atlas-system spec: projectRef: name: development serverlessSpec: name: serverless-instance tags: - key: "environment" value: "production" providerSettings: providerName: AWS regionName: US_EAST_1
Multi-Region Cluster Example
Clusters can span regions and cloud service providers. To learn more, see Considerations.
Note
While the Atlas Cluster API
Resource sends requests using the
v1.5 Atlas API versions, the Atlas Kubernetes Operator apiVersion field
uses v1. In this case, v1 refers to the version of
the Kubernetes API.
The following example shows an AtlasDeployment custom
resource specification configured for multi-region clusters:
apiVersion: atlas.mongodb.com/v1 kind: AtlasDeployment metadata: name: my-atlas-cluster spec: projectRef: name: my-project deploymentSpec: clusterType: REPLICASET name: tenantCluster tags: - key: "environment" value: "production" replicationSpecs: - zoneName: Zone 1 regionConfigs: priority: 7 - electableSpecs: instanceSize: M10 nodeCount: 3 providerName: AWS regionName: US_EAST_1
Multiple Cloud Service Providers Example
The following example shows an AtlasDeployment custom resource
specification configured to span multiple cloud service providers:
apiVersion: atlas.mongodb.com/v1 kind: AtlasDeployment metadata: name: my-atlas-cluster spec: projectRef: name: my-project deploymentSpec: clusterType: REPLICASET name: tenantCluster tags: - key: "environment" value: "production" replicationSpecs: - regionConfigs: - electableSpecs: instanceSize: M10 nodeCount: 3 providerName: AWS regionName: US_EAST_1 priority: 7 - electableSpecs: instanceSize: M10 nodeCount: 2 providerName: AZURE regionName: US_EAST_2 priority: 6 - electableSpecs: instanceSize: M10 nodeCount: 2 providerName: GCP regionName: CENTRAL_US priority: 5
Search Index Example
The following example shows an AtlasDeployment custom resource
specification configured to create a search index for the collection
listingsAndReviews and grades:
apiVersion: atlas.mongodb.com/v1 kind: AtlasDeployment metadata: name: my-atlas-cluster namespace: mongodb-atlas-system spec: deploymentSpec: backupEnabled: true clusterType: REPLICASET name: Test-cluster-M10 replicationSpecs: - regionConfigs: - backingProviderName: AWS electableSpecs: instanceSize: M10 nodeCount: 3 priority: 7 providerName: AWS regionName: US_EAST_1 zoneName: Zone 1 searchIndexes: - DBName: sample_training collectionName: grades name: test-vector-search-index type: vectorSearch vectorSearch: fields: - numDimensions: 1000 path: student_id similarity: euclidean type: vector - DBName: sample_airbnb collectionName: listingsAndReviews name: my-index search: mappings: dynamic: true searchConfigurationRef: name: atlassearchindexconfig-sample namespace: mongodb-atlas-system type: search terminationProtectionEnabled: false projectRef: name: my-project namespace: mongodb-atlas-system
Search Nodes Example
The following example shows an AtlasDeployment custom resource
specification configured to create search nodes:
apiVersion: atlas.mongodb.com/v1 kind: AtlasDeployment metadata: name: my-atlas-cluster namespace: mongodb-atlas-system spec: deploymentSpec: backupEnabled: true clusterType: REPLICASET name: Test-cluster-M10 replicationSpecs: - regionConfigs: - backingProviderName: AWS electableSpecs: instanceSize: M10 nodeCount: 3 priority: 7 providerName: AWS regionName: US_EAST_1 zoneName: Zone 1 searchNodes: - instanceSize: S20_HIGHCPU_NVME nodeCount: 2
Parameters
This section describes some of the key AtlasDeployment custom resource
parameters available.
For a full list of available parameters for clusters, see the Atlas Clusters API.
For a full list of available parameters for Flex clusters, see the Atlas Flex Clusters API.
See Notes on Transition To Flex Clusters for full information on changes.
To customize your specifications, refer to these descriptions, the available examples, and the API documentation.
spec.backupRefType: object
Optional
List that contains the details for the
AtlasBackupScheduleCustom Resource that you want to apply. You can specify one backup schedule per cluster.
spec.backupRef.nameType: string
Optional
metadata.namevalue within theAtlasBackupScheduleCustom Resource for the backup schedule that you want to apply. You can specify only one backup schedule per cluster, but you can use the same backup schedule for multiple clusters.If you omit this parameter, Atlas doesn't apply your backup configuration to this cluster.
spec.backupRef.namespaceType: string
Optional
String that indicates the namespace that contains the
AtlasBackupScheduleCustom Resource for the backup schedule that you want to apply.
spec.configServerManagementModeType: string
Optional
Default:
ATLAS_MANAGEDConfiguration that defines the Server Management Mode for creating or updating a sharded cluster. The possible values are:
ATLAS_MANAGED: Atlas may automatically switch the cluster's config server type for optimal performance and savings.FIXED_TO_DEDICATED: The cluster always uses a dedicated config server.
Learn more about MongoDB Sharded Cluster Config Servers.
spec.connectionSecret.nameType: string
Conditional
Name of the opaque secret that contains the organization ID and API keys that Atlas Kubernetes Operator uses to connect to Atlas. If unspecified, Atlas Kubernetes Operator falls back to either:
The
spec.connectionSecretRef.nameparameter of the parentatlasProjectThe default
globalsecret, ifspec.connectionSecretRef.nameis undefined for the parentatlasProject
This parameter is mandatory for independent CRDs.
spec.deploymentSpecType: array
Conditional
List that contains the cluster parameters from the API. For a full list of available parameters, see the Atlas Clusters API.
Important
You must specify
spec.deploymentSpecorspec.flexSpecin your configuration.See Notes on Transition To Flex Clusters for full information on changes.
spec.deploymentSpec.nameType: string
Conditional
String that identifies the name of the cluster. The name must contain only letters, numbers, and dashes and can't be modified after deployment creation.
spec.deploymentSpec.clusterTypeType: string
Conditional
Human-readable label that identifies cluster type to create.
When should you use this parameter?
ConditionNecessityRequired
You are deploying Global Clusters.
Required
You are deploying non-Global replica sets and sharded clusters.
Optional
Atlas accepts:
ValueCluster TypeREPLICASET
replica set
SHARDED
sharded cluster
GEOSHARDED
spec.deploymentSpec.customZoneMappingType: array
Required
List that contains Global Cluster parameters that map zones to geographic regions. For a full list of available parameters, see the Atlas Global Clusters API.
spec.deploymentSpec.customZoneMapping.locationType: string
Required
Code that represents a location that maps to a zone in your Global Cluster.
spec.deploymentSpec.customZoneMapping.zoneType: string
Required
Human-readable label that identifies the zone in your Global Cluster.
spec.deploymentSpec.diskSizeGBType: number
Optional
Capacity, in gigabytes, that indicates the host's root volume. Increase this number to add capacity, up to a maximum possible value of
4096(4 TB). You must specify a positive number for this value.You can't set this value for clusters with local NVMe SSDs.
Note
If you enable auto-scaling for
diskGBin any region, you can't edit this option. To learn more, seespec.deploymentSpec.replicationSpecs.regionConfigs.autoScaling.diskGB.enabled.The minimum disk size for dedicated clusters is 10 GB for AWS and Google Cloud. If you specify this setting with a lower disk size, Atlas defaults to the minimum disk size value.
If your database deployment includes Azure nodes, this value must correspond to an existing Azure disk type (8, 16, 32, 64, 128, 256, 512, 1024, 2048, or 4096).
Atlas calculates storage charges differently depending on whether you choose the default value or a custom value.
Atlas has disk capacity limits on single replica sets, scaling up to 4 TB for higher cluster tiers. To expand the total cluster storage beyond default limits, you can enable extended storage in the Project Settings. To accommodate further scaling in the future, we recommend that you enable sharding for long-term expansion.
If your database deployment spans cloud service providers, this value defaults to the minimum default of the providers involved.
To learn more, see Storage Capacity.
spec.deploymentSpec.encryptionAtRestProviderType: string
Optional
Cloud service provider that manages the customer key for this cluster. You must set this value to enable encryption at rest using customer-managed keys for this cluster, which provides an additional layer of encryption. To learn more, see Encrypt Data Using a Key Management Service.
Atlas accepts the following values:
ValueCloud ProviderAWS
Amazon AWS
GCP
Google Cloud
AZURE
Microsoft Azure
NONE
No provider; the cluster doesn't encrypt data using customer-managed keys.
spec.deploymentSpec.managedNamespacesType: array
Required
List that contains information to create a managed namespace in a specified Global Cluster to create. For a full list of available parameters, see the Atlas Global Clusters API.
spec.deploymentSpec.managedNamespaces.collectionType: string
Required
Human-readable label of the collection to manage in this Global Cluster.
spec.deploymentSpec.managedNamespaces.dbType: string
Required
Human-readable label of the database to manage in this Global Cluster.
spec.deploymentSpec.managedNamespaces.isCustomShardKeyHashedType: boolean
Optional
Flag that indicates whether to hash the custom shard key for the specified collection. This parameter defaults to
false.Set to
trueto enable a custom shard key for the collection.Set to
falseto disable a custom shard key for the collection. If diabled, MongoDB uses ranged sharding.
To learn more, see Hashed Shard Keys.
spec.deploymentSpec.managedNamespaces.isCustomShardKeyUniqueType: boolean
Optional
Flag that indicates whether the custom shard key for the specified collection is unique. This parameter defaults to
false.Set to
trueto enable a unique custom shard key for the collection.Set to
falseto disable a unique custom shard key for the collection.
spec.deploymentSpec.managedNamespaces.numInitialChunksType: integer
Optional
Minimum number of chunks to initially create when sharding an empty collection with a hashed shard key.
To learn more, see Shard a Global Collection.
spec.deploymentSpec.managedNamespaces.presplitHashedZonesType: boolean
Optional
Flag that indicates whether MongoDB Cloud should create and distribute initial chunks for an empty or non-existing collection. This parameter defaults to
false.Set to
trueto have MongoDB Cloud create and distribute initial chunks for an empty or non-existing collection.Set to
falseto not have MongoDB Cloud create and distribute initial chunks for an empty or non-existing collection..
spec.deploymentSpec.mongoDBMajorVersionType: string
Optional
Version of the cluster to deploy. Atlas supports the following MongoDB versions for
M10+clusters:5.0
6.0
7.0
8.0
The following conditions produce the following results:
ConditionResultYou omit this parameter and you omit the
spec.deploymentSpec.versionReleaseSystemparameter.Atlas deploys a cluster that runs MongoDB 7.0.
You omit this parameter and you set the
spec.deploymentSpec.versionReleaseSystemparameter toLTS.Atlas deploys a cluster that runs MongoDB 7.0.
Atlas deprecated
M2andM5clusters and Serverless instances. To learn more, see Migration to Flex Clusters. Set thespec.deploymentSpec.replicationSpecs.regionConfigs.electableSpecs.instanceSizeparameter toM0,M2, orM5.You must deploy MongoDB 7.0 or later.
You specify this parameter.
Atlas always deploys the cluster with the latest stable patch release of the specified version.
You set the
spec.deploymentSpec.versionReleaseSystemparameter toCONTINUOUS.You must omit this parameter.
spec.deploymentSpec.pitEnabledType: boolean
Conditional
Note
Atlas deprecated
M2andM5clusters and Serverless instances. In the near future, Atlas will automatically migrate allM2andM5clusters to Flex clusters. For Serverless instances, Atlas will determine whether to migrate instances to Free clusters, Flex clusters, or Dedicated clusters according to your usage, then migrate your Serverless instances automatically.To preserve backwards compatibility of the APIs for a period of time, Atlas will continue to allow for these migrated clusters to be managed through the same APIs (old and new APIs), including when using Atlas Kubernetes Operator. The backwards compatibility of APIs will remain in place until January 2026, when the old APIs will be removed and only APIs related to Flex clusters will remain in place.
Support for private endpoints on Serverless instances will end in March 2025. You must update your Atlas Kubernetes Operator configurations to remove private endpoints by March 2025. You must remove all remaining
M2,M5, and Serverless instance features from your Atlas Kubernetes Operator configurations before January 2026.If your workloads require Private Endpoints or Continuous Backup, switch to Atlas Dedicated Clusters. To learn more, see Migration to Flex Clusters and the Atlas Flex Migration Guide.
Configuration that enables continuous cloud backup. To enable continuous cloud backup, you must specify
truefor this setting.
spec.deploymentSpec.replicationSpecsType: array of objects
Conditional
List that contains the configurations for your cluster regions. Use this parameter for multi-region clusters. You must set either
spec.deploymentSpec.replicationSpecs.regionConfigs.regionNameorspec.deploymentSpec.replicationSpecs.When should you use this parameter?
ConditionNecessityValuesYou are deploying Global Clusters.
Required
Each object in the array represents a zone where Atlas deploys your cluster's nodes.
You are deploying non-Global replica sets and sharded clusters.
Optional
This array has one object representing where Atlas deploys your cluster's nodes.
If you specify this parameter, you must also specify
spec.deploymentSpec.clusterTypeandspec.deploymentSpec.replicationSpecs.numShards.
spec.deploymentSpec.replicationSpecs.numShardsType: integer
Conditional
Positive integer that specifies the number of shards to deploy for a sharded cluster.
If you use the
spec.deploymentSpec.replicationSpecsparameter, you must set this parameter.Atlas accepts
1through50, inclusive. The default value is1.If you specify a value of
1and you setspec.deploymentSpec.clusterTypetoSHARDED, Atlas deploys a single-shard sharded cluster.If you specify
1and you setspec.deploymentSpec.clusterTypetoREPLICASET, Atlas deploys a replica set.Don't create a sharded cluster with a single shard for production environments. Single-shard sharded clusters don't provide the same benefits as multi-shard configurations.
Warning
When you use a sharded cluster, MongoDB requires that your applications connect to a
mongosinstance to ensure that your applications interact with the shards and other components of the sharded cluster properly. If you migrate from a replica set to a sharded cluster, your applications must restart to enable the connection to the cluster'smongos. As a result, the Atlas Admin API prevents you from migrating a replica set directly to a sharded cluster with more than one shard. After you successfully migrate your replica set to a single shard cluster and reset your application connections, you can add additional shards to the cluster.
spec.deploymentSpec.replicationSpecs.regionConfigsType: array
Required
Hardware specifications for nodes set for a given region. Each
regionConfigsobject describes the region's priority in elections and the number and type of MongoDB nodes that Atlas deploys to the region.Each
regionConfigsobject must have either ananalyticsSpecsobject,electableSpecsobject, orreadOnlySpecsobject.M0,M2, orM5clusters require onlyelectableSpecs.Dedicated clusters can specify any of these specifications, but must have at least one
electableSpecsobject within areplicationSpec.Every hardware specification must use the same
instanceSize.
spec.deploymentSpec.replicationSpecs.regionConfigs.analyticsSpecsType: object
Optional
Hardware specifications for analytics nodes needed in the region. Analytics nodes handle analytic data such as reporting queries from BI Connector for Atlas. Analytics nodes are read-only and can never become the primary.
If you don't specify this parameter, Atlas deploys no analytics to this region.
spec.deploymentSpec.replicationSpecs.regionConfigs.autoScaling.diskGB.enabledType: boolean
Optional
Flag that indicates whether this database deployment enables disk auto-scaling. This parameter defaults to
true.Set to
trueto enable disk auto-scaling.Set to
falseto disable disk auto-scaling.
The maximum amount of RAM for the selected cluster tier and the oplog size can limit storage auto-scaling. To learn more, see Customize Your Storage.
spec.deploymentSpec.replicationSpecs.regionConfigs.autoScaling.compute.enabledType: boolean
Optional
Flag that indicates whether instance size auto-scaling is enabled. This parameter defaults to
false.Set to
trueto enable instance size auto-caling. If enabled, you must specify a value forspec.deploymentSpec.replicationSpecs.regionConfigs.autoScaling.compute.maxInstanceSize.Set to
falseto disable instance size auto-scaling.
spec.deploymentSpec.replicationSpecs.regionConfigs.autoScaling.compute.maxInstanceSizeType: string
Conditional
String that indicates the maximum instance size to which your database deployment can automatically scale (such as
M40). You must specify this parameter if you setspec.deploymentSpec.replicationSpecs.regionConfigs.autoScaling.compute.enabledtotrue.Note
If you set a maximum instance size smaller than the database deployment's current instance size with auto-scaling enabled, Atlas automatically scales the current instance size to the maximum value you specify.
For example, if the database deployment's current instance size is
M40and you set the maximum instance size toM30, Atlas automatically scales the current instance size toM30.If Atlas changes the current instance size and you don't change the
spec.deploymentSpec.replicationSpecs.regionConfigs.electableSpecs.instanceSizein Atlas Kubernetes Operator to match the new instance size, Atlas Kubernetes Operator displays a warning in the logs but doesn't prevent auto-scaling.
spec.deploymentSpec.replicationSpecs.regionConfigs.autoScaling.compute.minInstanceSizeType: string
Conditional
String that indicates the minimum instance size to which your database deployment can automatically scale (such as
M10). You must specify this parameter if you setspec.deploymentSpec.replicationSpecs.regionConfigs.autoScaling.compute.enabledtotrue.Note
If you set a minimum instance size larger than the database deployment's current instance size with auto-scaling enabled, Atlas automatically scales the current instance size to the minimum value you specify.
For example, if the database deployment's current instance size is
M10and you set the minimum instance size toM30, Atlas automatically scales the current instance size toM30.If Atlas changes the current instance size and you don't change the
spec.deploymentSpec.replicationSpecs.regionConfigs.electableSpecs.instanceSizein Atlas Kubernetes Operator to match the new instance size, Atlas Kubernetes Operator displays a warning in the logs but doesn't prevent auto-scaling.
spec.deploymentSpec.replicationSpecs.regionConfigs.electableSpecsType: object
Optional
Hardware specifications for electable nodes in the region. Electable nodes can become the primary and can enable local reads.
If you don't specify this option, Atlas deploys no electable nodes to the region.
spec.deploymentSpec.replicationSpecs.regionConfigs.electableSpecs.instanceSizeType: string
Conditional
Hardware specification for the instance sizes in this region. Each instance size has a default storage and memory capacity. The instance size you select applies to all the data-bearing hosts in your instance size. To learn more, see the AWS, GCP, and Azure custom storage sizes.
If you deploy a sharded cluster, or global cluster, you must choose an instance size of
M30or greater.If you change the instance size name after you deploy your cluster, Atlas changes the database deployment to the instance size you specify unless it falls outside the range you specify in
spec.deploymentSpec.replicationSpecs.regionConfigs.autoScaling.compute.minInstanceSizeandspec.deploymentSpec.replicationSpecs.regionConfigs.autoScaling.compute.maxInstanceSizewith auto-scaling enabled. To learn more, seespec.deploymentSpec.replicationSpecs.regionConfigs.autoScaling.compute.minInstanceSizeandspec.deploymentSpec.replicationSpecs.regionConfigs.autoScaling.compute.maxInstanceSize.Note
If you have auto-scaling enabled for the compute field, you can't edit this option. To learn more, see
spec.deploymentSpec.replicationSpecs.regionConfigs.autoScaling.compute.enabled.Note
You can change this setting to upgrade an
M0or Flex cluster to anM10+cluster. However, you can't use this setting to upgrade anM0or a Flex cluster to another free or Flex cluster
spec.deploymentSpec.replicationSpecs.regionConfigs.electableSpecs.nodeCountType: integer
Conditional
Number of electable nodes for Atlas to deploy to the region. Electable nodes can become the primary and can enable local reads.
The combined
electableSpecs.nodeCountacross allreplicationSpecs.regionConfigsobjects must total3,5, or7.You can't create electable nodes if
spec.deploymentSpec.replicationSpecs.regionConfigs.priorityis0.
spec.deploymentSpec.replicationSpecs.regionConfigs.priorityType: integer
Required
Precedence is given to this region when a primary election occurs.
If your
regionConfigshas onlyreadOnlySpecs,analyticsSpecs, or both, set this value to0.If you have multiple
regionConfigsobjects (your cluster is multi-region or multi-cloud), they must have priorities in descending order. The highest priority is7.Example
Set your highest priority region to
7, your second-highest priority to6, and your third-priority region to5. If you have no electable nodes, set this value to0.If your region has set
electableSpecs.nodeCountto1or higher, it must have a priority of exactly one less than another region in thereplicationSpecs.regionConfigsarray unless it is the primary. The highest-priority region must have a priority of7. The lowest possible priority is1.The priority
7region identifies the Preferred Region of the cluster. Atlas places the primary node in the Preferred Region. Priorities1through7are exclusive: you can't assign a given priority to more than one region per cluster.Example
If you have three regions, their priorities would be
7,6, and5respectively. If you added two more regions for supporting electable nodes, the priorities of those regions would be4and3respectively.
spec.deploymentSpec.replicationSpecs.regionConfigs.providerNameType: string
Conditional
Cloud service provider on which Atlas provisions the hosts.
AWS
Amazon AWS
GCP
Google Cloud Platform
AZURE
Microsoft Azure
spec.deploymentSpec.replicationSpecs.regionConfigs.regionNameType: string
Conditional
Physical location of your MongoDB cluster. The region you choose can affect network latency for clients accessing your databases.
For a complete list of region name values, refer to the cloud provider reference pages:
For multi-region clusters, see
spec.deploymentSpec.replicationSpecs. You must set eitherspec.deploymentSpec.replicationSpecs.regionConfigs.regionNameorspec.deploymentSpec.replicationSpecs.
spec.deploymentSpec.replicationSpecs.regionConfigs.readOnlySpecsType: object
Optional
Hardware specifications for read-only nodes in the region. Read-only nodes can never become the primary member, but can enable local reads.
If you don't specify this parameter, Atlas deploys no read-only nodes to the region.
spec.deploymentSpec.replicationSpecs.zoneNameType: string
Optional
Human-readable label that identifies the zone in a Global Cluster. Provide this value only if you set
spec.deploymentSpec.clusterTypetoGEOSHARDED.
spec.deploymentSpec.searchIndexesType: array
Optional
An array of
SearchIndexobjects with fields that describe the search index. EachSearchIndexobject contains the following fields:FieldTypeDescriptionnamestring
Human-readable label that identifies this index. Must be unique for a deployment.
DBNamestring
Human-readable label that identifies the existing database that contains the collection with one or more Atlas Search indexes.
IMPORTANT: The database that you specify must already exist. If you don't have an existing database, create one.
collectionNamestring
Human-readable label that identifies the collection that contains one or more Atlas Search indexes.
typestring
Type of the index. Atlas accepts the following values:
searchvectorSearch
searchobject
You must include this object if
typeissearch. Otherwise, omit it.vectorSearchobject
You must include this object if
typeisvectorSearch. Otherwise, omit it.
spec.deploymentSpec.searchIndexes.searchType: object
Optional
FieldTypeDescriptionsynonymsarray
Rule sets that map words to their synonyms in this index
mappingsobject
Index specifications for the collection's fields
Required
searchConfigurationRefobject
A name/namespace reference to the AtlasSearchIndexConfig custom resource, described below.
Required
spec.deploymentSpec.searchIndexes.search.synonymsType: array
Optional
An array of
Synonymobjects with fields that describe rule sets that map words to their synonyms in this index. EachSynonymobject contains the following fields:FieldTypeDescriptionnamestring
Human-readable label that identifies the synonym definition. Each name must be unique within the same index definition
Required
analyzerstring
Specific pre-defined method chosen to apply to the synonyms to be searched. Possible values are:
lucene.standard
lucene.standard
lucene.simple
lucene.whitespace
lucene.keyword
lucene.arabic
lucene.armenian
lucene.basque
lucene.bengali
lucene.brazilian
lucene.bulgarian
lucene.catalan
lucene.chinese
lucene.cjk
lucene.czech
lucene.danish
lucene.dutch
lucene.english
lucene.finnish
lucene.french
lucene.galician
lucene.german
lucene.greek
lucene.hindi
lucene.hungarian
lucene.indonesian
lucene.irish
lucene.italian
lucene.japanese
lucene.korean
lucene.kuromoji
lucene.latvian
lucene.lithuanian
lucene.morfologik
lucene.nori
lucene.norwegian
lucene.persian
lucene.portuguese
lucene.romanian
lucene.russian
lucene.smartcn
lucene.sorani
lucene.spanish
lucene.swedish
lucene.thai
lucene.turkish
lucene.ukrainian
Required
sourceobject
Data set that stores the mapping one or more words map to one or more synonyms of those words
Required
spec.deploymentSpec.searchIndexes.search.synonyms.sourceType: object
Required
FieldTypeDescriptioncollectionstring
Human-readable label that identifies the MongoDB collection that stores words and their applicable synonyms
Required
spec.deploymentSpec.searchIndexes.search.mappingsType: object
Required
An object with Index specifications for the collection's fields:
dynamicbooleanFlag that indicates whether the index uses dynamic or static mappings. Required if mappings.fields is omitted.fieldsJSON/YAML
One or more field specifications for the Atlas Search index. Required if mappings.dynamic is omitted or set to false.
spec.deploymentSpec.searchIndexes.vectorSearchType: object
Optional
FieldTypeDescriptionfieldsJSON/YAML
Array of JSON objects. See examples https://dochub.mongodb.org/core/avs-vector-type
Required
spec.deploymentSpec.searchNodesType: array
Optional
An array of search nodes configurations. Each element contains two fields:
FieldTypeDescriptionnodeCountinteger
Number of search nodes in the cluster. Atlas accepts values 2 through 32, inclusive. The default number is
2.instanceSizestring
Hardware specification for the search node instance sizes. Atlas accepts one of the following:
S20_HIGHCPU_NVMES30_HIGHCPU_NVMES40_HIGHCPU_NVMES50_HIGHCPU_NVMES60_HIGHCPU_NVMES70_HIGHCPU_NVMES80_HIGHCPU_NVMES30_LOWCPU_NVMES40_LOWCPU_NVMES50_LOWCPU_NVMES60_LOWCPU_NVMES80_LOWCPU_NVMES90_LOWCPU_NVMES100_LOWCPU_NVME
The default instance size is
S20_HIGHCPU_NVME.
spec.deploymentSpec.tagsType: array
Optional
List that contains tags (key-value pairs) to better understand, organize, and identify your database deployments. To learn more, see Tags on Clusters.
spec.deploymentSpec.terminationProtectionEnabledType: boolean
Indicates whether termination protection is enabled or disabled for your cluster. If set to
true, Atlas won't delete the cluster. If set tofalse, Atlas will delete the cluster. The default isfalse.
spec.deploymentSpec.versionReleaseSystemType: string
Conditional
Release cadence that Atlas uses for this cluster. Atlas accepts:
CONTINUOUS: Atlas creates your cluster using the most recent MongoDB release. Atlas automatically updates your cluster to the latest major and rapid MongoDB releases as they become available.LTS: Atlas creates your cluster using the latest patch release of the MongoDB version that you specify in thespec.deploymentSpec.mongoDBMajorVersionparameter. Atlas automatically updates your cluster to subsequent patch releases of this MongoDB version. Atlas doesn't update your cluster to newer rapid or major MongoDB releases as they become available.If omitted, defaults to
LTS.If you set this parameter to
CONTINUOUS, you must omit thespec.deploymentSpec.mongoDBMajorVersionparameter.
spec.externalProjectRef.idType: string
Conditional
ID of the project to which the deployment belongs. You must specify the project ID of an existing Atlas Project. This parameter is required for deployments who belong to projects managed by either:
A different instance of Atlas Kubernetes Operator
Tooling other than Atlas Kubernetes Operator
For deployments who belong to projects managed by the same instance of Atlas Kubernetes Operator, use
spec.projectRef.nameif you do not usespec.externalProjectRef.id.
spec.flexSpecType: array
Conditional
Note
See Notes on Transition To Flex Clusters for full information on changes.
List that contains the Flex cluster parameters from the API. For a full list of available parameters, see the Atlas Flex Clusters API.
Important
You must specify
spec.deploymentSpecorspec.flexSpecin your configuration.
spec.flexSpec.tagsType: array
Optional
List that contains tags (key-value pairs) to better understand, organize, and identify your database deployments. To learn more, see Tags on Clusters.
spec.flexSpec.terminationProtectionEnabledType: boolean
Indicates whether termination protection is enabled or disabled for your Flex cluster. If set to
true, Atlas won't delete the cluster. If set tofalse, Atlas will delete the cluster. The default isfalse.
spec.flexSpec.providerSettings.backingProviderNameType: string
The name of the cloud provider for your Flex cluster.
providerSettingsinclude the configuration that specifies the settings for the provisioned hosts on which MongoDB runs.Atlas accepts one of the following values:
AWSAZUREGCP
spec.flexSpec.providerSettings.regionNameType: string
Physical location of your MongoDB Flex cluster. The region you choose can affect network latency for clients accessing your databases.
For a complete list of region name values, refer to the cloud provider reference pages:
spec.processArgsType: object
Optional
Object that contains the additional configuration options for your cluster.
spec.processArgs.defaultReadConcernType: string
Optional
String that indicates the default level of acknowledgment requested from MongoDB for read operations set for this cluster.
MongoDB 5.0 clusters default to local.
spec.processArgs.defaultWriteConcernType: string
Optional
String that indicates the default level of acknowledgment requested from MongoDB for write operations set for this cluster.
MongoDB versions 5.0 and later clusters default to majority.
spec.processArgs.failIndexKeyTooLongType: boolean
Optional
Flag that indicates whether to fail the operation and return an error when you insert or update documents where all indexed entries exceed 1024 bytes. If you set this to
false,mongodwrites documents that exceed this limit, but doesn't index them.This option corresponds to the
param.failIndexKeyTooLongmongodparameter.
spec.processArgs.javascriptEnabledType: boolean
Optional
Flag that indicates whether the cluster allows execution of operations that perform server-side executions of JavaScript.
This option corresponds to modifying the
security.javascriptEnabledconfiguration file option for eachmongodandmongosin the cluster.
spec.processArgs.minimumEnabledTlsProtocolType: integer
Optional
String that indicates the minimum TLS version that the cluster accepts for incoming connections. Clusters using TLS 1.0 or 1.1 should consider setting TLS 1.2 as the minimum TLS protocol version.
To learn more, see What versions of TLS does Atlas support?.
This option corresponds to the
net.ssl.disabledProtocolsmongodconfiguration file option.
spec.processArgs.noTableScanType: boolean
Optional
Flag that indicates whether the cluster disables executing any query that requires a collection scan to return results.
This option corresponds to the
notablescanmongodparameter.
spec.processArgs.oplogSizeMBType: integer
Optional
Number that indicates the storage limit of a cluster's oplog expressed in megabytes. A value of
nullindicates that the cluster uses the default oplog size that Atlas calculates.This option corresponds to the
replication.oplogSizeMBmongodconfiguration file option.
spec.processArgs.sampleRefreshIntervalBIConnectorType: integer
Optional
Number that indicates the documents per database to sample when gathering schema information.
This parameter corresponds to the sampleSize mongosqld option.
spec.processArgs.sampleSizeBIConnectorType: integer
Optional
Number that indicates the interval in seconds at which the mongosqld process re-samples data to create its relational schema.
This parameter corresponds to the sampleRefreshIntervalSecs mongosqld option.
spec.projectRef.nameType: string
Conditional
Name of the project to which the deployment belongs. You must specify an existing
AtlasProjectCustom Resource. This parameter applies only to deployments that belong to projects managed by the same instance Atlas Kubernetes Operator.For deployments that belong to projects managed by either:
a different instance of Atlas Kubernetes Operator
tooling other than Atlas Kubernetes Operator
use
spec.externalProjectRef.id.
spec.serverlessSpecType: array
Conditional
Note
See Notes on Transition To Flex Clusters for full information on changes.
List that contains the Serverless instance parameters from the API. For a full list of available parameters, see the Atlas Flex Clusters API.
Important
You must specify
spec.deploymentSpecorspec.flexSpecin your configuration.
spec.upgradeToDedicatedType: boolean
Optional
Flag that, when set to
true, triggers an in-place upgrade from a Flex cluster to a Dedicated cluster.If omitted, it defaults to
false. For a full walkthrough of the migration process, see Migrate a Flex cluster to a Dedicated cluster.Important
You must also provide the full configuration for the target dedicated cluster in the
spec.deploymentSpecblock. This operation is one-way and irreversible.
spec.serverlessSpec.privateEndpointsType: array
Optional
Note
Atlas deprecated
M2andM5clusters and Serverless instances. In the near future, Atlas will automatically migrate allM2andM5clusters to Flex clusters. For Serverless instances, Atlas will determine whether to migrate instances to Free clusters, Flex clusters, or Dedicated clusters according to your usage, then migrate your Serverless instances automatically.To preserve backwards compatibility of the APIs for a period of time, Atlas will continue to allow for these migrated clusters to be managed through the same APIs (old and new APIs), including when using Atlas Kubernetes Operator. The backwards compatibility of APIs will remain in place until January 2026, when the old APIs will be removed and only APIs related to Flex clusters will remain in place.
Support for private endpoints on Serverless instances will end in March 2025. You must update your Atlas Kubernetes Operator configurations to remove private endpoints by March 2025. You must remove all remaining
M2,M5, and Serverless instance features from your Atlas Kubernetes Operator configurations before January 2026.If your workloads require Private Endpoints or Continuous Backup, switch to Atlas Dedicated Clusters. To learn more, see Migration to Flex Clusters and the Atlas Flex Migration Guide.
Deprecated. Remove this parameter if it exists. List that contains the private endpoint configurations for the Serverless instance.
spec.serverlessSpec.providerSettingsType: Object
Conditional
Note
See Notes on Transition To Flex Clusters for full information on changes.
Configuration that specifies the settings for the provisioned hosts on which MongoDB runs. The available options are specific to the cloud service provider. To learn more, see the AWS, GCP, and Azure Serverless instance configuration options.
If you want to create or update a Serverless instance, you must specify this setting.
Important
The following settings are deprecated and will be removed in a future release:
spec.serverlessSpec.providerSettings.DiskIOPSspec.serverlessSpec.providerSettings.DiskTypeNamespec.serverlessSpec.providerSettings.EncryptEBSVolumespec.serverlessSpec.providerSettings.InstanceSizeNamespec.serverlessSpec.providerSettings.VolumeTypespec.serverlessSpec.providerSettings.AutoScaling
Providing values for any of these settings has no effect.
spec.serverlessSpec.providerSettings.providerNameType: string
Conditional
Note
See Notes on Transition To Flex Clusters for full information on changes.
Cloud service provider on which Atlas provisions the host for a Serverless instance.
Atlas accepts the following values:
AWS
Amazon AWS
GCP
Google Cloud Platform
AZURE
Microsoft Azure
spec.serverlessSpec.providerSettings.regionNameType: string
Conditional
Note
See Notes on Transition To Flex Clusters for full information on changes.
Physical location of your MongoDB Serverless instance. The region you choose can affect network latency for clients accessing your databases.
For a complete list of region name values, refer to the cloud provider reference pages:
spec.serverlessSpec.tagsNote
See Notes on Transition To Flex Clusters for full information on changes.
Type: array
Optional
List that contains tags (key-value pairs) to better understand, organize, and identify your database deployments. To learn more, see Tags on Clusters.
status.connectionStringsType: array
Required
List that contains the connection URLs for accessing the cluster. This parameter appears after you create or update a cluster.
Note
.. include:: /includes/fact-ak8so-connection-strings.rst
For the configuration parameters available for a cluster from the API, see the Atlas Clusters API.
Note
The following parameters are deprecated in the Atlas API and Atlas Kubernetes Operator does not support them:
replicationSpecreplicationFactor