Closed zelig81 closed 1 year ago
Hi @zelig81. I think there is an issue with documentation. If you don't specify any clusters to export, AtlasDeployment
resources will be generated for all existing clusters for this project. Could you please also provide a version of the Atlas CLI?
Hi @zelig81.
atlas --version
atlascli version: 1.4.0
git version: homebrew-release
Go version: go1.19.3
os: darwin
arch: arm64
compiler: gc
Hi @igor-karpukhin, thank you for the answer.
About output of atlas
cli, I open an issue in the relevant repo
So generally your answer helped my needs regarding mongodb-atlas-kubernetes
and this issue can be closed here.
I'm reopening this one, as the DiskSizeGB issue is not fixed on the operator side yet
Ouch - sorry
@igor-karpukhin in that case - DiskSizeGB is not the only issue of operator side. I got it while generating k8s manifest via atlas
cli from free tier DB. Additional issues are readonly fields (like bi reporting / tenant something and additional something that Ialready don't recall) that operator asks to fix
This issue has gone 30 days without any activity and meets the project’s definition of 'stale'. This will be auto-closed if there is no new activity over the next 60 days. If the issue is still relevant and active, you can simply comment with a 'bump' to keep it open. Thanks for keeping our repository healthy!
What did you do to encounter the bug? Steps to reproduce the behavior:
diskSizeGB
issue (see in the end of the issue description) )What did you expect?
atlas kubernetes config generate --targetNamespace atlas --projectId <project-id>
when there is deployed a serverless deployment: I expect to get k8s manifests of project only (without serverless DB)atlas kubernetes config generate --targetNamespace atlas --projectId <project-id> --clusterName <cluster-id>
: I expect to get k8s manifests that I can deploy from scratch (as disaster recovery)What happened instead? 1 . result of command - failure
Error: cluster not found: ServerlessInstance0(63cf7301530d116214820fc4)
.metadata.creationTimestamp
and.status
Operator Information
Kubernetes Cluster Information
Additional context Add any other context about the problem here.
output of atlas cli
```yaml --- apiVersion: atlas.mongodb.com/v1 kind: AtlasProject metadata: creationTimestamp: null name: poc2 namespace: atlas spec: alertConfigurations: - enabled: true eventTypeName: REPLICATION_OPLOG_WINDOW_RUNNING_OUT metricThreshold: threshold: "" notifications: - delayMin: 0 emailEnabled: true intervalMin: 60 roles: - GROUP_OWNER smsEnabled: false typeName: GROUP threshold: operator: LESS_THAN threshold: "1.000000" units: HOURS - enabled: true eventTypeName: NO_PRIMARY metricThreshold: threshold: "" notifications: - delayMin: 15 emailEnabled: true intervalMin: 60 roles: - GROUP_OWNER smsEnabled: false typeName: GROUP threshold: {} - enabled: true eventTypeName: CLUSTER_MONGOS_IS_MISSING metricThreshold: threshold: "" notifications: - delayMin: 15 emailEnabled: true intervalMin: 60 roles: - GROUP_OWNER smsEnabled: false typeName: GROUP threshold: {} - enabled: true eventTypeName: OUTSIDE_METRIC_THRESHOLD metricThreshold: metricName: CONNECTIONS_PERCENT mode: AVERAGE operator: GREATER_THAN threshold: "80.000000" units: RAW notifications: - delayMin: 0 emailEnabled: true intervalMin: 60 roles: - GROUP_OWNER smsEnabled: false typeName: GROUP threshold: {} - enabled: true eventTypeName: OUTSIDE_METRIC_THRESHOLD metricThreshold: metricName: DISK_PARTITION_SPACE_USED_DATA mode: AVERAGE operator: GREATER_THAN threshold: "90.000000" units: RAW notifications: - delayMin: 0 emailEnabled: true intervalMin: 60 roles: - GROUP_OWNER smsEnabled: false typeName: GROUP threshold: {} - enabled: true eventTypeName: OUTSIDE_METRIC_THRESHOLD metricThreshold: metricName: QUERY_TARGETING_SCANNED_OBJECTS_PER_RETURNED mode: AVERAGE operator: GREATER_THAN threshold: "1000.000000" units: RAW notifications: - delayMin: 10 emailEnabled: true intervalMin: 60 roles: - GROUP_OWNER smsEnabled: false typeName: GROUP threshold: {} - enabled: true eventTypeName: CREDIT_CARD_ABOUT_TO_EXPIRE metricThreshold: threshold: "" notifications: - delayMin: 0 emailEnabled: true intervalMin: 1440 roles: - GROUP_OWNER smsEnabled: false typeName: GROUP threshold: {} - enabled: true eventTypeName: OUTSIDE_METRIC_THRESHOLD metricThreshold: metricName: NORMALIZED_SYSTEM_CPU_USER mode: AVERAGE operator: GREATER_THAN threshold: "95.000000" units: RAW notifications: - delayMin: 0 emailEnabled: true intervalMin: 60 roles: - GROUP_OWNER smsEnabled: false typeName: GROUP threshold: {} - enabled: true eventTypeName: HOST_HAS_INDEX_SUGGESTIONS metricThreshold: threshold: "" notifications: - delayMin: 10 emailEnabled: true intervalMin: 60 roles: - GROUP_OWNER smsEnabled: false typeName: GROUP threshold: {} - enabled: true eventTypeName: HOST_MONGOT_CRASHING_OOM metricThreshold: threshold: "" notifications: - delayMin: 0 emailEnabled: true intervalMin: 60 roles: - GROUP_OWNER smsEnabled: false typeName: GROUP threshold: {} - enabled: true eventTypeName: OUTSIDE_SERVERLESS_METRIC_THRESHOLD metricThreshold: metricName: SERVERLESS_CONNECTIONS_PERCENT mode: AVERAGE operator: GREATER_THAN threshold: "80.000000" units: RAW notifications: - delayMin: 0 emailEnabled: true intervalMin: 60 roles: - GROUP_OWNER smsEnabled: false typeName: GROUP threshold: {} - enabled: true eventTypeName: OUTSIDE_SERVERLESS_METRIC_THRESHOLD metricThreshold: metricName: SERVERLESS_DATA_SIZE_TOTAL mode: AVERAGE operator: GREATER_THAN threshold: "0.750000" units: TERABYTES notifications: - delayMin: 0 emailEnabled: true intervalMin: 60 roles: - GROUP_OWNER smsEnabled: false typeName: GROUP threshold: {} - enabled: true eventTypeName: OUTSIDE_SERVERLESS_METRIC_THRESHOLD metricThreshold: metricName: SERVERLESS_TOTAL_READ_UNITS mode: AVERAGE operator: GREATER_THAN threshold: "0.250000" units: MILLION_RPU notifications: - delayMin: 30 emailEnabled: true intervalMin: 720 roles: - GROUP_OWNER smsEnabled: false typeName: GROUP threshold: {} - enabled: true eventTypeName: OUTSIDE_SERVERLESS_METRIC_THRESHOLD metricThreshold: metricName: SERVERLESS_TOTAL_READ_UNITS mode: AVERAGE operator: GREATER_THAN threshold: "1.000000" units: MILLION_RPU notifications: - delayMin: 5 emailEnabled: true intervalMin: 120 roles: - GROUP_OWNER smsEnabled: false typeName: GROUP threshold: {} - enabled: true eventTypeName: HOST_NOT_ENOUGH_DISK_SPACE metricThreshold: threshold: "" notifications: - delayMin: 0 emailEnabled: true intervalMin: 60 roles: - GROUP_OWNER smsEnabled: false typeName: GROUP threshold: {} - enabled: true eventTypeName: OUTSIDE_METRIC_THRESHOLD metricThreshold: metricName: SEARCH_MAX_NUMBER_OF_LUCENE_DOCS mode: AVERAGE operator: GREATER_THAN threshold: "1.000000" units: BILLION notifications: - delayMin: 0 emailEnabled: true intervalMin: 60 roles: - GROUP_OWNER smsEnabled: false typeName: GROUP threshold: {} - enabled: true eventTypeName: JOINED_GROUP metricThreshold: threshold: "" notifications: - delayMin: 0 emailEnabled: true intervalMin: 60 smsEnabled: false typeName: GROUP threshold: {} auditing: auditAuthorizationSuccess: false enabled: false connectionSecretRef: name: "" encryptionAtRest: awsKms: enabled: false valid: false azureKeyVault: enabled: false googleCloudKms: enabled: false maintenanceWindow: {} name: poc2 projectIpAccessList: - cidrBlock: 0.0.0.0/0 settings: isCollectDatabaseSpecificsStatisticsEnabled: true isDataExplorerEnabled: true isPerformanceAdvisorEnabled: true isRealtimePerformancePanelEnabled: true isSchemaAdvisorEnabled: true status: conditions: [] --- apiVersion: v1 data: orgId: "" privateApiKey: "" publicApiKey: "" kind: Secret metadata: creationTimestamp: null labels: atlas.mongodb.com/type: credentials name: poc2-credentials namespace: atlas --- apiVersion: atlas.mongodb.com/v1 kind: AtlasDeployment metadata: creationTimestamp: null name: cluster0 namespace: atlas spec: advancedDeploymentSpec: backupEnabled: true biConnector: enabled: false readPreference: secondary clusterType: REPLICASET encryptionAtRestProvider: NONE name: Cluster0 paused: false pitEnabled: false replicationSpecs: - numShards: 1 regionConfigs: - analyticsSpecs: instanceSize: M10 nodeCount: 0 autoScaling: compute: enabled: false scaleDownEnabled: false diskGB: enabled: true electableSpecs: instanceSize: M10 nodeCount: 3 priority: 7 providerName: GCP readOnlySpecs: instanceSize: M10 nodeCount: 0 regionName: CENTRAL_US zoneName: Zone 1 rootCertType: ISRGROOTX1 versionReleaseSystem: LTS backupRef: name: cluster0-backupschedule namespace: atlas processArgs: javascriptEnabled: true minimumEnabledTlsProtocol: TLS1_2 noTableScan: false projectRef: name: poc2 namespace: atlas status: conditions: [] --- apiVersion: atlas.mongodb.com/v1 kind: AtlasBackupSchedule metadata: creationTimestamp: null name: cluster0-backupschedule namespace: atlas spec: export: exportBucketId: "" frequencyType: "" policy: name: cluster0-backuppolicy namespace: atlas referenceHourOfDay: 8 referenceMinuteOfHour: 26 restoreWindowDays: 7 status: {} --- apiVersion: atlas.mongodb.com/v1 kind: AtlasBackupPolicy metadata: creationTimestamp: null name: cluster0-backuppolicy namespace: atlas spec: items: - frequencyInterval: 6 frequencyType: hourly retentionUnit: days retentionValue: 2 - frequencyInterval: 1 frequencyType: daily retentionUnit: days retentionValue: 7 - frequencyInterval: 6 frequencyType: weekly retentionUnit: weeks retentionValue: 4 - frequencyInterval: 40 frequencyType: monthly retentionUnit: months retentionValue: 12 status: {} --- ```expected output of atlas cli (look for commented out strings)
```yaml --- apiVersion: atlas.mongodb.com/v1 kind: AtlasProject metadata: # creationTimestamp: null name: poc2 namespace: atlas annotations: # at least it will be good to have it commented in the output of `atlas kubernetes generate ...` output in order not to remove accidentally a project mongodb.com/atlas-resource-policy: "keep" spec: alertConfigurations: - enabled: true eventTypeName: REPLICATION_OPLOG_WINDOW_RUNNING_OUT metricThreshold: threshold: "" notifications: - delayMin: 0 emailEnabled: true intervalMin: 60 roles: - GROUP_OWNER smsEnabled: false typeName: GROUP threshold: operator: LESS_THAN threshold: "1.000000" units: HOURS - enabled: true eventTypeName: NO_PRIMARY metricThreshold: threshold: "" notifications: - delayMin: 15 emailEnabled: true intervalMin: 60 roles: - GROUP_OWNER smsEnabled: false typeName: GROUP threshold: {} - enabled: true eventTypeName: CLUSTER_MONGOS_IS_MISSING metricThreshold: threshold: "" notifications: - delayMin: 15 emailEnabled: true intervalMin: 60 roles: - GROUP_OWNER smsEnabled: false typeName: GROUP threshold: {} - enabled: true eventTypeName: OUTSIDE_METRIC_THRESHOLD metricThreshold: metricName: CONNECTIONS_PERCENT mode: AVERAGE operator: GREATER_THAN threshold: "80.000000" units: RAW notifications: - delayMin: 0 emailEnabled: true intervalMin: 60 roles: - GROUP_OWNER smsEnabled: false typeName: GROUP threshold: {} - enabled: true eventTypeName: OUTSIDE_METRIC_THRESHOLD metricThreshold: metricName: DISK_PARTITION_SPACE_USED_DATA mode: AVERAGE operator: GREATER_THAN threshold: "90.000000" units: RAW notifications: - delayMin: 0 emailEnabled: true intervalMin: 60 roles: - GROUP_OWNER smsEnabled: false typeName: GROUP threshold: {} - enabled: true eventTypeName: OUTSIDE_METRIC_THRESHOLD metricThreshold: metricName: QUERY_TARGETING_SCANNED_OBJECTS_PER_RETURNED mode: AVERAGE operator: GREATER_THAN threshold: "1000.000000" units: RAW notifications: - delayMin: 10 emailEnabled: true intervalMin: 60 roles: - GROUP_OWNER smsEnabled: false typeName: GROUP threshold: {} - enabled: true eventTypeName: CREDIT_CARD_ABOUT_TO_EXPIRE metricThreshold: threshold: "" notifications: - delayMin: 0 emailEnabled: true intervalMin: 1440 roles: - GROUP_OWNER smsEnabled: false typeName: GROUP threshold: {} - enabled: true eventTypeName: OUTSIDE_METRIC_THRESHOLD metricThreshold: metricName: NORMALIZED_SYSTEM_CPU_USER mode: AVERAGE operator: GREATER_THAN threshold: "95.000000" units: RAW notifications: - delayMin: 0 emailEnabled: true intervalMin: 60 roles: - GROUP_OWNER smsEnabled: false typeName: GROUP threshold: {} - enabled: true eventTypeName: HOST_HAS_INDEX_SUGGESTIONS metricThreshold: threshold: "" notifications: - delayMin: 10 emailEnabled: true intervalMin: 60 roles: - GROUP_OWNER smsEnabled: false typeName: GROUP threshold: {} - enabled: true eventTypeName: HOST_MONGOT_CRASHING_OOM metricThreshold: threshold: "" notifications: - delayMin: 0 emailEnabled: true intervalMin: 60 roles: - GROUP_OWNER smsEnabled: false typeName: GROUP threshold: {} - enabled: true eventTypeName: OUTSIDE_SERVERLESS_METRIC_THRESHOLD metricThreshold: metricName: SERVERLESS_CONNECTIONS_PERCENT mode: AVERAGE operator: GREATER_THAN threshold: "80.000000" units: RAW notifications: - delayMin: 0 emailEnabled: true intervalMin: 60 roles: - GROUP_OWNER smsEnabled: false typeName: GROUP threshold: {} - enabled: true eventTypeName: OUTSIDE_SERVERLESS_METRIC_THRESHOLD metricThreshold: metricName: SERVERLESS_DATA_SIZE_TOTAL mode: AVERAGE operator: GREATER_THAN threshold: "0.750000" units: TERABYTES notifications: - delayMin: 0 emailEnabled: true intervalMin: 60 roles: - GROUP_OWNER smsEnabled: false typeName: GROUP threshold: {} - enabled: true eventTypeName: OUTSIDE_SERVERLESS_METRIC_THRESHOLD metricThreshold: metricName: SERVERLESS_TOTAL_READ_UNITS mode: AVERAGE operator: GREATER_THAN threshold: "0.250000" units: MILLION_RPU notifications: - delayMin: 30 emailEnabled: true intervalMin: 720 roles: - GROUP_OWNER smsEnabled: false typeName: GROUP threshold: {} - enabled: true eventTypeName: OUTSIDE_SERVERLESS_METRIC_THRESHOLD metricThreshold: metricName: SERVERLESS_TOTAL_READ_UNITS mode: AVERAGE operator: GREATER_THAN threshold: "1.000000" units: MILLION_RPU notifications: - delayMin: 5 emailEnabled: true intervalMin: 120 roles: - GROUP_OWNER smsEnabled: false typeName: GROUP threshold: {} - enabled: true eventTypeName: HOST_NOT_ENOUGH_DISK_SPACE metricThreshold: threshold: "" notifications: - delayMin: 0 emailEnabled: true intervalMin: 60 roles: - GROUP_OWNER smsEnabled: false typeName: GROUP threshold: {} - enabled: true eventTypeName: OUTSIDE_METRIC_THRESHOLD metricThreshold: metricName: SEARCH_MAX_NUMBER_OF_LUCENE_DOCS mode: AVERAGE operator: GREATER_THAN threshold: "1.000000" units: BILLION notifications: - delayMin: 0 emailEnabled: true intervalMin: 60 roles: - GROUP_OWNER smsEnabled: false typeName: GROUP threshold: {} - enabled: true eventTypeName: JOINED_GROUP metricThreshold: threshold: "" notifications: - delayMin: 0 emailEnabled: true intervalMin: 60 smsEnabled: false typeName: GROUP threshold: {} # auditing: # auditAuthorizationSuccess: false # enabled: false connectionSecretRef: name: "mongodb-atlas-operator-api-key" # my changes # encryptionAtRest: # awsKms: # enabled: false # valid: false # azureKeyVault: # enabled: false # googleCloudKms: # enabled: false # maintenanceWindow: {} name: poc2 projectIpAccessList: - cidrBlock: 0.0.0.0/0 settings: isCollectDatabaseSpecificsStatisticsEnabled: true isDataExplorerEnabled: true isPerformanceAdvisorEnabled: true isRealtimePerformancePanelEnabled: true isSchemaAdvisorEnabled: true # status: # conditions: [] --- apiVersion: v1 data: orgId: "" privateApiKey: "" publicApiKey: "" kind: Secret metadata: # creationTimestamp: null labels: atlas.mongodb.com/type: credentials name: poc2-credentials namespace: atlas --- apiVersion: atlas.mongodb.com/v1 kind: AtlasDeployment metadata: # creationTimestamp: null name: cluster0 namespace: atlas annotations: # at least it will be good to have it commented in the output of `atlas kubernetes generate ...` output in order not to remove accidentally a project mongodb.com/atlas-resource-policy: "keep" spec: advancedDeploymentSpec: backupEnabled: true # biConnector: # enabled: false # readPreference: secondary clusterType: REPLICASET # encryptionAtRestProvider: NONE name: Cluster0 # paused: false # pitEnabled: false replicationSpecs: - numShards: 1 regionConfigs: - analyticsSpecs: instanceSize: M10 nodeCount: 0 autoScaling: compute: enabled: false scaleDownEnabled: false diskGB: enabled: true electableSpecs: instanceSize: M10 nodeCount: 3 priority: 7 providerName: GCP readOnlySpecs: instanceSize: M10 nodeCount: 0 regionName: CENTRAL_US zoneName: Zone 1 rootCertType: ISRGROOTX1 versionReleaseSystem: LTS backupRef: name: cluster0-backupschedule namespace: atlas processArgs: javascriptEnabled: true minimumEnabledTlsProtocol: TLS1_2 noTableScan: false projectRef: name: poc2 namespace: atlas # status: # conditions: [] --- apiVersion: atlas.mongodb.com/v1 kind: AtlasBackupSchedule metadata: # creationTimestamp: null name: cluster0-backupschedule namespace: atlas spec: export: exportBucketId: "" frequencyType: "MONTHLY" policy: name: cluster0-backuppolicy namespace: atlas referenceHourOfDay: 8 referenceMinuteOfHour: 26 restoreWindowDays: 7 # status: {} --- apiVersion: atlas.mongodb.com/v1 kind: AtlasBackupPolicy metadata: # creationTimestamp: null name: cluster0-backuppolicy namespace: atlas spec: items: - frequencyInterval: 6 frequencyType: hourly retentionUnit: days retentionValue: 2 - frequencyInterval: 1 frequencyType: daily retentionUnit: days retentionValue: 7 - frequencyInterval: 6 frequencyType: weekly retentionUnit: weeks retentionValue: 4 - frequencyInterval: 40 frequencyType: monthly retentionUnit: months retentionValue: 12 # status: {} --- ```error of diskSizeGB
`{"level":"INFO","time":"2023-01-24T07:47:05.189Z","msg":"Status update","atlasdeployment":"atlas/cluster0","lastCondition":{"type":"DeploymentReady","status":"False","lastTransitionTime":null,"reason":"InternalError","message":"json: cannot unmarshal number 0.5 into Go struct field AdvancedDeploymentSpec.diskSizeGB of type int"}}`error of cidrBlock and ipAddress together
`{"level":"INFO","time":"2023-01-24T08:26:29.867Z","msg":"Status update","atlasproject":"atlas/poc2","lastCondition":{"type":"IPAccessListReady","status":"False","lastTransitionTime":null,"reason":"ProjectIPAccessListInvalid","message":"only one of the 'awsSecurityGroup', 'cidrBlock' or 'ipAddress' is required be specified"}}`error of backup schedule with unsupported value
`The AtlasBackupSchedule "cluster0-backupschedule" is invalid: spec.export.frequencyType: Unsupported value: "": supported values: "MONTHLY"`