diff --git a/charts/atlas-deployment/templates/atlas-deployment.yaml b/charts/atlas-deployment/templates/atlas-deployment.yaml index d4b3b2f5..3b88572c 100644 --- a/charts/atlas-deployment/templates/atlas-deployment.yaml +++ b/charts/atlas-deployment/templates/atlas-deployment.yaml @@ -22,72 +22,8 @@ spec: name: {{ include "atlas-deployment.projectfullname" $ }} {{- if .deploymentSpec }} deploymentSpec: - name: {{ .deploymentSpec.name }} - providerSettings: - {{- with .deploymentSpec.providerSettings -}} - {{- $provider := .providerName -}} - {{- range $key, $val := . }} - {{ if or (ne $key "backingProviderName") (and (eq $key "backingProviderName") (eq $provider "TENANT" )) }} - {{- $key | indent 2 }}: {{ $val }} - {{- end }} - {{- end }} + {{- toYaml .deploymentSpec | nindent 4 }} {{- end }} - {{- if .deploymentSpec.autoScaling }} - autoScaling: - {{- with .autoScaling }} - {{- toYaml . | nindent 4 }} - {{- end }} - {{- end }} - {{- if .autoIndexingEnabled }} - autoIndexingEnabled: false - {{- end }} - {{- if .deploymentSpec.biConnector }} - biConnector: - enabled: {{ .deploymentSpec.biConnector.enabled }} - readPreference: {{ .deploymentSpec.biConnector.readPreference }} - {{- end }} - {{- if .deploymentSpec.clusterType }} - clusterType: {{ .deploymentSpec.clusterType }} - {{- end }} - {{- if .deploymentSpec.diskSizeGB }} - diskSizeGB: {{ .deploymentSpec.diskSizeGB }} - {{- end }} - {{- if .deploymentSpec.encryptionAtRestProvider }} - encryptionAtRestProvider: {{ .deploymentSpec.encryptionAtRestProvider }} - {{- end }} - {{- if .deploymentSpec.labels }} - labels: - {{- with .deploymentSpec.labels }} - {{- toYaml . | nindent 4 }} - {{- end }} - {{- end }} - {{- if .deploymentSpec.mongoDBMajorVersion }} - mongoDBMajorVersion: {{ .deploymentSpec.mongoDBMajorVersion }} - {{- end }} - {{- if .deploymentSpec.numShards }} - numShards: {{ .deploymentSpec.numShards }} - {{- end }} - {{- if .deploymentSpec.paused }} - paused: {{ .deploymentSpec.paused }} - {{- end }} - {{- if .deploymentSpec.pitEnabled }} - pitEnabled: {{ .deploymentSpec.pitEnabled }} - {{- end }} - {{- if .deploymentSpec.providerBackupEnabled }} - providerBackupEnabled: {{ .deploymentSpec.providerBackupEnabled }} - {{- end }} - {{- if .deploymentSpec.replicationSpecs }} - replicationSpecs: - {{- with .deploymentSpec.replicationSpecs }} - {{- toYaml . | nindent 4 }} - {{- end }} - {{- end }} - {{- end }} - {{- if .advancedDeploymentSpec }} - advancedDeploymentSpec: - {{- toYaml .advancedDeploymentSpec | nindent 4}} - {{- end }} - {{- if .serverlessSpec }} serverlessSpec: {{- toYaml .serverlessSpec | nindent 4}} {{- end }} @@ -122,4 +58,3 @@ spec: - name: "NAMESPACE" value: "{{ $.Release.Namespace }}" {{- end }} -{{- end }} diff --git a/charts/atlas-deployment/values.yaml b/charts/atlas-deployment/values.yaml index 5f3e37d3..b6ee5089 100644 --- a/charts/atlas-deployment/values.yaml +++ b/charts/atlas-deployment/values.yaml @@ -36,49 +36,67 @@ project: - ipAddress: "0.0.0.0" comment: "REMOVE ME" -# include either deploymentSpec or advancedDeploymentSpec -# see https://docs.atlas.mongodb.com/reference/api/cluster-advanced/create-one-cluster-advanced/ for +# include either deploymentSpec or serverlessSpec +# see https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Clusters/operation/createCluster for # options for creating advanced clusters. + deployments: - deploymentSpec: name: cluster-name + clusterType: REPLICASET annotations: {} # mongodb.com/atlas-resource-policy: keep - providerSettings: - instanceSizeName: M2 - providerName: TENANT - backingProviderName: AWS - regionName: US_EAST_1 + replicationSpecs: + - zoneName: Zone 1 + regionConfigs: + - electableSpecs: + instanceSize: M2 + nodeCount: 1 + providerName: TENANT + backingProviderName: "AWS" + regionName: US_EAST_1 + priority: 7 -# Additional clusterSpec values -# Optional section. for more information visit -# https://docs.atlas.mongodb.com/reference/api/clusters-create-one/ -# # -# autoScaling: -# autoIndexingEnabled: false -# compute: -# enabled: false -# maxInstanceSize: 'M40' -# minInstanceSize: 'M10' -# scaleDownEnabled: false -# diskGBEnabled: false -# biConnector: -# enabled: false -# readPreference: 'primary' -# clusterType: 'REPLICASET' -# diskSizeGB: '50' -# encryptionAtRestProvider: 'AWS' -# labels: -# mongoDBMajorVersion: '4.4' -# numShards: 2 -# paused: false -# pitEnabled: false -# providerBackupEnabled: false +# More advanced, multiregional, multitenant cluster +# deploymentSpec: +# clusterType: GEOSHARDED +# name: advanced-deployment # replicationSpecs: +# - numShards: 1 +# zoneName: Zone1 +# regionConfigs: +# - electableSpecs: +# instanceSize: M10 +# nodeCount: 3 +# providerName: AZURE +# backingProviderName: AZURE +# regionName: EUROPE_NORTH +# priority: 7 -# Configure a Serverless Instance -# https://www.mongodb.com/docs/atlas/reference/api/serverless/create-one-serverless-instance/ +# - numShards: 1 +# zoneName: Zone2 +# regionConfigs: +# - electableSpecs: +# instanceSize: M10 +# nodeCount: 3 +# providerName: AWS +# backingProviderName: AWS +# regionName: US_EAST_1 +# priority: 7 + +# - numShards: 1 +# zoneName: Zone3 +# regionConfigs: +# - electableSpecs: +# instanceSize: M10 +# nodeCount: 3 +# providerName: GCP +# backingProviderName: GCP +# regionName: EASTERN_US +# priority: 7 +# Configure a Serverless Instance +# https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Serverless-Instances/operation/createServerlessInstance # - serverlessSpec: # name: serverless-instance # providerSettings: @@ -86,20 +104,6 @@ deployments: # backingProviderName: AWS # regionName: US_EAST_1 -# Configure an Advanced Cluster -# https://www.mongodb.com/docs/atlas/reference/api/cluster-advanced/create-one-cluster-advanced/ - -# - advancedDeploymentSpec: -# clusterType: REPLICASET -# name: advanced-cluster -# replicationSpecs: -# - regionConfigs: -# - electableSpecs: -# instanceSize: M5 -# providerName: TENANT -# backingProviderName: AWS -# regionName: US_EAST_1 - users: - username: admin-user databaseName: admin diff --git a/charts/atlas-operator-crds/templates/atlas.mongodb.com_atlasdeployments.yaml b/charts/atlas-operator-crds/templates/atlas.mongodb.com_atlasdeployments.yaml index 9cd360fc..d6d67dd5 100644 --- a/charts/atlas-operator-crds/templates/atlas.mongodb.com_atlasdeployments.yaml +++ b/charts/atlas-operator-crds/templates/atlas.mongodb.com_atlasdeployments.yaml @@ -40,15 +40,30 @@ spec: Only one of DeploymentSpec, AdvancedDeploymentSpec and ServerlessSpec should be defined properties: - advancedDeploymentSpec: + backupRef: + description: Backup schedule for the AtlasDeployment + properties: + name: + description: Name is the name of the Kubernetes Resource + type: string + namespace: + description: Namespace is the namespace of the Kubernetes Resource + type: string + required: + - name + type: object + deploymentSpec: description: Configuration for the advanced (v1.5) deployment API - https://www.mongodb.com/docs/atlas/reference/api/clusters-advanced/ + https://www.mongodb.com/docs/atlas/reference/api/clusters/ properties: backupEnabled: + description: Applicable only for M10+ deployments. Flag that indicates + if the deployment uses Cloud Backups for backups. type: boolean biConnector: - description: BiConnectorSpec specifies BI Connector for Atlas - configuration on this deployment + description: Configuration of BI Connector for Atlas on this deployment. + The MongoDB Connector for Business Intelligence for Atlas (BI + Connector) is only available for M10 and larger deployments. properties: enabled: description: Flag that indicates whether or not BI Connector @@ -62,6 +77,13 @@ spec: type: string type: object clusterType: + description: Type of the deployment that you want to create. The + parameter is required if replicationSpecs are set or if Global + Deployments are deployed. + enum: + - REPLICASET + - SHARDED + - GEOSHARDED type: string customZoneMapping: items: @@ -76,10 +98,26 @@ spec: type: object type: array diskSizeGB: + description: Capacity, in gigabytes, of the host's root volume. + Increase this number to add capacity, up to a maximum possible + value of 4096 (i.e., 4 TB). This value must be a positive integer. + The parameter is required if replicationSpecs are configured. + maximum: 4096 + minimum: 0 type: integer encryptionAtRestProvider: + description: Cloud service provider that offers Encryption at + Rest. + enum: + - AWS + - GCP + - AZURE + - NONE type: string labels: + description: Collection of key-value pairs that tag and categorize + the deployment. Each key and value has a maximum length of 255 + characters. items: description: LabelSpec contains key-value pairs that tag and categorize the Cluster/DBUser @@ -119,6 +157,7 @@ spec: type: object type: array mongoDBMajorVersion: + description: Version of the deployment to deploy. type: string mongoDBVersion: type: string @@ -129,27 +168,66 @@ spec: pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ type: string paused: + description: Flag that indicates whether the deployment should + be paused. type: boolean pitEnabled: + description: Flag that indicates the deployment uses continuous + cloud backups. type: boolean replicationSpecs: + description: Configuration for deployment regions. items: properties: numShards: + description: Positive integer that specifies the number + of shards to deploy in each specified zone. If you set + this value to 1 and clusterType is SHARDED, MongoDB Cloud + deploys a single-shard sharded cluster. 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 type: integer regionConfigs: + description: Hardware specifications for nodes set for a + given region. Each regionConfigs object describes the + region's priority in elections and the number and type + of MongoDB nodes that MongoDB Cloud deploys to the region. + Each regionConfigs object must have either an analyticsSpecs + object, electableSpecs object, or readOnlySpecs object. + Tenant clusters only require electableSpecs. Dedicated + clusters can specify any of these specifications, but + must have at least one electableSpecs object within a + replicationSpec. Every hardware specification must use + the same instanceSize. items: properties: analyticsSpecs: properties: diskIOPS: + description: Disk IOPS setting for AWS storage. + Set only if you selected AWS as your cloud service + provider. format: int64 type: integer ebsVolumeType: + description: Disk IOPS setting for AWS storage. + Set only if you selected AWS as your cloud service + provider. + enum: + - STANDARD + - PROVISIONED type: string instanceSize: + description: 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 type: string nodeCount: + description: Number of nodes of the given type + for MongoDB Cloud to deploy to the region. type: integer type: object autoScaling: @@ -195,40 +273,99 @@ spec: type: object type: object backingProviderName: + description: 'Cloud service provider on which the + host for a multi-tenant deployment is provisioned. + This setting only works when "providerName" : "TENANT" + and "providerSetting.instanceSizeName" : M2 or M5. + Otherwise it should be equal to "providerName" value' + enum: + - AWS + - GCP + - AZURE type: string electableSpecs: properties: diskIOPS: + description: Disk IOPS setting for AWS storage. + Set only if you selected AWS as your cloud service + provider. format: int64 type: integer ebsVolumeType: + description: Disk IOPS setting for AWS storage. + Set only if you selected AWS as your cloud service + provider. + enum: + - STANDARD + - PROVISIONED type: string instanceSize: + description: 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 type: string nodeCount: + description: Number of nodes of the given type + for MongoDB Cloud to deploy to the region. type: integer type: object priority: + description: Precedence is given to this region when + a primary election occurs. If your regionConfigs + has only readOnlySpecs, analyticsSpecs, or both, + set this value to 0. If you have multiple regionConfigs + objects (your cluster is multi-region or multi-cloud), + they must have priorities in descending order. The + highest priority is 7 type: integer providerName: + enum: + - AWS + - GCP + - AZURE + - TENANT + - SERVERLESS type: string readOnlySpecs: properties: diskIOPS: + description: Disk IOPS setting for AWS storage. + Set only if you selected AWS as your cloud service + provider. format: int64 type: integer ebsVolumeType: + description: Disk IOPS setting for AWS storage. + Set only if you selected AWS as your cloud service + provider. + enum: + - STANDARD + - PROVISIONED type: string instanceSize: + description: 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 type: string nodeCount: + description: Number of nodes of the given type + for MongoDB Cloud to deploy to the region. type: integer type: object regionName: + description: Physical location of your MongoDB deployment. + The region you choose can affect network latency + for clients accessing your databases. type: string type: object type: array zoneName: + description: Human-readable label that identifies the zone + in a Global Cluster. type: string type: object type: array @@ -259,372 +396,6 @@ spec: versionReleaseSystem: type: string type: object - backupRef: - description: Backup schedule for the AtlasDeployment - properties: - name: - description: Name is the name of the Kubernetes Resource - type: string - namespace: - description: Namespace is the namespace of the Kubernetes Resource - type: string - required: - - name - type: object - deploymentSpec: - description: Configuration for the normal (v1) deployment API https://www.mongodb.com/docs/atlas/reference/api/clusters/ - properties: - autoScaling: - description: Collection of settings that configures auto-scaling - information for the deployment. If you specify the autoScaling - object, you must also specify the providerSettings.autoScaling - object. - properties: - autoIndexingEnabled: - description: 'Deprecated: This flag is not supported anymore. - Flag that indicates whether autopilot mode for Performance - Advisor is enabled. The default is false.' - type: boolean - compute: - description: Collection of settings that configure how a deployment - might scale its deployment tier and whether the deployment - can scale down. - properties: - enabled: - description: Flag that indicates whether deployment tier - auto-scaling is enabled. The default is false. - type: boolean - maxInstanceSize: - description: 'Maximum instance size to which your deployment - can automatically scale (such as M40). Atlas requires - this parameter if "autoScaling.compute.enabled" : true.' - type: string - minInstanceSize: - description: 'Minimum instance size to which your deployment - can automatically scale (such as M10). Atlas requires - this parameter if "autoScaling.compute.scaleDownEnabled" - : true.' - type: string - scaleDownEnabled: - description: 'Flag that indicates whether the deployment - tier may scale down. Atlas requires this parameter if - "autoScaling.compute.enabled" : true.' - type: boolean - type: object - diskGBEnabled: - description: Flag that indicates whether disk auto-scaling - is enabled. The default is true. - type: boolean - type: object - biConnector: - description: Configuration of BI Connector for Atlas on this deployment. - The MongoDB Connector for Business Intelligence for Atlas (BI - Connector) is only available for M10 and larger deployments. - properties: - enabled: - description: Flag that indicates whether or not BI Connector - for Atlas is enabled on the deployment. - type: boolean - readPreference: - description: Source from which the BI Connector for Atlas - reads data. Each BI Connector for Atlas read preference - contains a distinct combination of readPreference and readPreferenceTags - options. - type: string - type: object - clusterType: - description: Type of the deployment that you want to create. The - parameter is required if replicationSpecs are set or if Global - Deployments are deployed. - enum: - - REPLICASET - - SHARDED - - GEOSHARDED - type: string - customZoneMapping: - items: - properties: - location: - type: string - zone: - type: string - required: - - location - - zone - type: object - type: array - diskSizeGB: - description: Capacity, in gigabytes, of the host's root volume. - Increase this number to add capacity, up to a maximum possible - value of 4096 (i.e., 4 TB). This value must be a positive integer. - The parameter is required if replicationSpecs are configured. - maximum: 4096 - minimum: 0 - type: integer - encryptionAtRestProvider: - description: Cloud service provider that offers Encryption at - Rest. - enum: - - AWS - - GCP - - AZURE - - NONE - type: string - labels: - description: Collection of key-value pairs that tag and categorize - the deployment. Each key and value has a maximum length of 255 - characters. - items: - description: LabelSpec contains key-value pairs that tag and - categorize the Cluster/DBUser - properties: - key: - maxLength: 255 - type: string - value: - type: string - required: - - key - - value - type: object - type: array - managedNamespaces: - items: - description: ManagedNamespace represents the information about - managed namespace configuration. - properties: - collection: - type: string - customShardKey: - type: string - db: - type: string - isCustomShardKeyHashed: - type: boolean - isShardKeyUnique: - type: boolean - numInitialChunks: - type: integer - presplitHashedZones: - type: boolean - required: - - collection - - db - type: object - type: array - mongoDBMajorVersion: - description: Version of the deployment to deploy. - type: string - name: - description: Name of the deployment as it appears in Atlas. After - Atlas creates the deployment, you can't change its name. Can - only contain ASCII letters, numbers, and hyphens. - pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ - type: string - numShards: - description: Positive integer that specifies the number of shards - to deploy for a sharded deployment. The parameter is required - if replicationSpecs are configured - maximum: 50 - minimum: 1 - type: integer - paused: - description: Flag that indicates whether the deployment should - be paused. - type: boolean - pitEnabled: - description: Flag that indicates the deployment uses continuous - cloud backups. - type: boolean - providerBackupEnabled: - description: Applicable only for M10+ deployments. Flag that indicates - if the deployment uses Cloud Backups for backups. - type: boolean - providerSettings: - description: Configuration for the provisioned hosts on which - MongoDB runs. The available options are specific to the cloud - service provider. - properties: - autoScaling: - description: Range of instance sizes to which your deployment - can scale. - properties: - autoIndexingEnabled: - description: 'Deprecated: This flag is not supported anymore. - Flag that indicates whether autopilot mode for Performance - Advisor is enabled. The default is false.' - type: boolean - compute: - description: Collection of settings that configure how - a deployment might scale its deployment tier and whether - the deployment can scale down. - properties: - enabled: - description: Flag that indicates whether deployment - tier auto-scaling is enabled. The default is false. - type: boolean - maxInstanceSize: - description: 'Maximum instance size to which your - deployment can automatically scale (such as M40). - Atlas requires this parameter if "autoScaling.compute.enabled" - : true.' - type: string - minInstanceSize: - description: 'Minimum instance size to which your - deployment can automatically scale (such as M10). - Atlas requires this parameter if "autoScaling.compute.scaleDownEnabled" - : true.' - type: string - scaleDownEnabled: - description: 'Flag that indicates whether the deployment - tier may scale down. Atlas requires this parameter - if "autoScaling.compute.enabled" : true.' - type: boolean - type: object - diskGBEnabled: - description: Flag that indicates whether disk auto-scaling - is enabled. The default is true. - type: boolean - type: object - backingProviderName: - description: 'Cloud service provider on which the host for - a multi-tenant deployment is provisioned. This setting only - works when "providerSetting.providerName" : "TENANT" and - "providerSetting.instanceSizeName" : M2 or M5.' - enum: - - AWS - - GCP - - AZURE - type: string - diskIOPS: - description: Disk IOPS setting for AWS storage. Set only if - you selected AWS as your cloud service provider. - format: int64 - type: integer - diskTypeName: - description: Type of disk if you selected Azure as your cloud - service provider. - type: string - encryptEBSVolume: - description: Flag that indicates whether the Amazon EBS encryption - feature encrypts the host's root volume for both data at - rest within the volume and for data moving between the volume - and the deployment. - type: boolean - instanceSizeName: - description: Atlas provides different deployment tiers, each - with a default storage capacity and RAM size. The deployment - you select is used for all the data-bearing hosts in your - deployment tier. - type: string - providerName: - description: Cloud service provider on which Atlas provisions - the hosts. - enum: - - AWS - - GCP - - AZURE - - TENANT - - SERVERLESS - type: string - regionName: - description: Physical location of your MongoDB deployment. - The region you choose can affect network latency for clients - accessing your databases. - type: string - volumeType: - description: Disk IOPS setting for AWS storage. Set only if - you selected AWS as your cloud service provider. - enum: - - STANDARD - - PROVISIONED - type: string - required: - - providerName - type: object - replicationSpecs: - description: Configuration for deployment regions. - items: - description: ReplicationSpec represents a configuration for - deployment regions - properties: - numShards: - description: Number of shards to deploy in each specified - zone. The default value is 1. - format: int64 - type: integer - regionsConfig: - additionalProperties: - description: RegionsConfig describes the region’s priority - in elections and the number and type of MongoDB nodes - Atlas deploys to the region. - properties: - analyticsNodes: - description: The number of analytics nodes for Atlas - to deploy to the region. Analytics nodes are useful - for handling analytic data such as reporting queries - from BI Connector for Atlas. Analytics nodes are - read-only, and can never become the primary. If - you do not specify this option, no analytics nodes - are deployed to the region. - format: int64 - type: integer - electableNodes: - description: Number of electable nodes for Atlas to - deploy to the region. Electable nodes can become - the primary and can facilitate local reads. - format: int64 - type: integer - priority: - description: Election priority of the region. For - regions with only replicationSpecs[n].regionsConfig..readOnlyNodes, - set this value to 0. - format: int64 - type: integer - readOnlyNodes: - description: Number of read-only nodes for Atlas to - deploy to the region. Read-only nodes can never - become the primary, but can facilitate local-reads. - format: int64 - type: integer - type: object - description: Configuration for a region. Each regionsConfig - object describes the region's priority in elections and - the number and type of MongoDB nodes that Atlas deploys - to the region. - type: object - zoneName: - description: Name for the zone in a Global Deployment. Don't - provide this value if deploymentType is not GEOSHARDED. - type: string - type: object - type: array - tags: - description: Key-value pairs for resource tagging. - items: - description: TagSpec holds a key-value pair for resource tagging - on this deployment. - properties: - key: - maxLength: 255 - minLength: 1 - pattern: ^[a-zA-Z0-9][a-zA-Z0-9 @_.+`;`-]*$ - type: string - value: - maxLength: 255 - minLength: 1 - pattern: ^[a-zA-Z0-9][a-zA-Z0-9@_.+`;`-]*$ - type: string - required: - - key - - value - type: object - maxItems: 50 - type: array - required: - - name - - providerSettings - type: object processArgs: description: ProcessArgs allows to modify Advanced Configuration Options properties: