Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating AtlasDeployment with advancedDeploymentSpec fails with diskGB #588

Closed
sunchill06 opened this issue Jul 4, 2022 · 3 comments
Closed

Comments

@sunchill06
Copy link

sunchill06 commented Jul 4, 2022

What did you do to encounter the bug?
Steps to reproduce the behavior:

cat <<EOF | kubectl apply -f -
apiVersion: atlas.mongodb.com/v1
kind: AtlasDeployment
metadata:
  name: new-cluster-1
spec:
  projectRef:
    name: test-project
  advancedDeploymentSpec:
      backupEnabled: true
      diskSizeGB: 80
      mongoDBMajorVersion: "4.4"
      pitEnabled: false
      replicationSpecs:
      - numShards: 3
        regionConfigs:
        - electableSpecs:
            instanceSize: M40
            nodeCount: 3
          autoScaling:
            compute:
              enabled: true
              maxInstanceSize: M60
              minInstanceSize: M40
              scaleDownEnabled: true
            diskGB:
              enabled: true
          providerName: GCP
          regionName: WESTERN_EUROPE
EOF
error: error validating "STDIN": error validating data: ValidationError(AtlasDeployment.spec.advancedDeploymentSpec.replicationSpecs[0].regionConfigs[0].autoScaling): unknown field "diskGB" in com.mongodb.atlas.v1.AtlasDeployment.spec.advancedDeploymentSpec.replicationSpecs.regionConfigs.autoScaling; if you choose to ignore these errors, turn validation off with --validate=falsehelm ls
NAME                  	NAMESPACE	REVISION	UPDATED                                	STATUS  	CHART                       	APP VERSION
mongodb-atlas-operator	mongodb  	22      	2022-07-04 12:08:47.672815367 +0000 UTC	deployed	mongodb-atlas-operator-1.1.0	1.1.0 

However in the atlas documentation I can see
Screenshot 2022-07-04 at 16 40 37

What did you expect?
I was expecting the spec to run just fine. Following works fine though.

cat <<EOF | kubectl apply -f -
apiVersion: atlas.mongodb.com/v1
kind: AtlasDeployment
metadata:
  name: new-cluster-1
spec:
  projectRef:
    name: test-project
  advancedDeploymentSpec:
      backupEnabled: true
      diskSizeGB: 80
      mongoDBMajorVersion: "4.4"
      pitEnabled: false
      replicationSpecs:
      - numShards: 3
        regionConfigs:
        - electableSpecs:
            instanceSize: M40
            nodeCount: 3
          autoScaling:
            compute:
              enabled: true
              maxInstanceSize: M60
              minInstanceSize: M40
              scaleDownEnabled: true
            diskGBEnabled: true
          providerName: GCP
          regionName: WESTERN_EUROPE
EOF
atlasdeployment.atlas.mongodb.com/new-cluster-1 created

What happened instead?
Error as mentioned earlier.

Screenshots
If applicable, add screenshots to help explain your problem.

Operator Information

  • Operator Version - v1.1.0

Kubernetes Cluster Information

  • Distribution
  • Version
  • Image Registry location (quay, or an internal registry)

Additional context
Add any other context about the problem here.

If possible, please include:

  • kubectl describe output
  • yaml definitions for your objects
  • log files for the operator and database pods
@sunchill06
Copy link
Author

sunchill06 commented Jul 5, 2022

Following works fine though. Expect the Operator's advance cluster option also sends the request to v1.5 of the Atlas API?

curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" --digest \
     --header "Content-Type: application/json" \
     --include \
     --request POST "https://cloud.mongodb.com/api/atlas/v1.5/groups/{GROUP}/clusters?pretty=true" \
     --data '{
         "clusterType": "REPLICASET",
         "name": "tenantCluster",
         "replicationSpecs": [
           {
             "regionConfigs": [
               {
                 "electableSpecs": {
                   "instanceSize": "M5"
                 },
                 "autoScaling": {
                    "diskGB": {
                       "enabled": true
                    },
                    "compute": {
                       "enabled": false,
                       "scaleDownEnabled": false
                    }
                 },
                 "providerName": "TENANT",
                 "backingProviderName" : "AWS",
                 "regionName": "US_EAST_1"
               }
             ]
           }
         ]
       }'

Sugar-pack added a commit that referenced this issue Jul 5, 2022
Add new AdvancedAutoScalingSpec struct for AdvancedDeploymentSpec
Change existed field to the new struct
@fabritsius
Copy link
Contributor

Thank you @sunchill06 🙏

This does seem like a bug and we are already working on the fix.

Sugar-pack added a commit that referenced this issue Jul 5, 2022
Add new AdvancedAutoScalingSpec struct for AdvancedDeploymentSpec
Change existed field to the new struct
Sugar-pack added a commit that referenced this issue Jul 8, 2022
* Change diskGB field in advancedDeploymentSpec (#588)

Add new AdvancedAutoScalingSpec struct for AdvancedDeploymentSpec
Change existed field to the new struct
Remove unnecessary field from AdvancedAutoScalingSpec
@Sugar-pack
Copy link
Contributor

Hi @sunchill06, this bug has been fixed.
And this fix will be included in the next release. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants