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

AtlasDeployment with serverlessSpec gives NOT_SERVERLESS_TENANT_CLUSTER error after Flex cluster has been created #2105

Open
LennartKoot opened this issue Feb 7, 2025 · 2 comments

Comments

@LennartKoot
Copy link

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

  • Deploy an AtlasDeployment with a serverlessSpec definition.
  • Wait for the creation of the Atlas Cluster, this will create a Flex cluster.
  • Check the status of the AtlasDeployment, this has now an error in the DeploymentReady status and it's status False.

What did you expect?
With the deprecation of the serverlessSpec I expected to see a Flex cluster being created, but Atlas should provide backwards compatibility where you can still manage these Flex clusters while using the serverlessSpec definition, as per the docs:

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, 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.

What happened instead?
The status of the AtlasDeployment of type DeploymentReady has a status of False with the following error reported:

status:
  conditions:
    - lastTransitionTime: '2025-02-07T09:46:11Z'
      status: 'False'
      type: Ready
    - lastTransitionTime: '2025-02-07T09:46:11Z'
      status: 'True'
      type: ResourceVersionIsValid
    - lastTransitionTime: '2025-02-07T09:46:11Z'
      status: 'True'
      type: ValidationSucceeded
    - lastTransitionTime: '2025-02-07T09:46:11Z'
      message: >-
        unable to retrieve list of serverless private endpoints from Atlas:
        https://cloud.mongodb.com/api/atlas/v2/groups/REDACTED/privateEndpoint/serverless/instance/REDACTED/endpoint
        GET: HTTP 400 Bad Request (Error code: "NOT_SERVERLESS_TENANT_CLUSTER")
        Detail: The specified cluster REDACTED in group
        REDACTED is not a serverless tenant cluster. Reason: Bad
        Request. Params: [REDACTED REDACTED]
      reason: ServerlessPrivateEndpointFailed
      status: 'False'
      type: DeploymentReady

Operator Information

  • 2.7.0

Kubernetes Cluster Information

  • AWS EKS v1.30.8-eks-2d5f260

Additional context
Example AtlasDeployment used:

apiVersion: atlas.mongodb.com/v1
kind: AtlasDeployment
metadata:
  name: atlas
spec:
  projectRef:
    name: mongodb-atlas-project
    namespace: mongodb-atlas
  serverlessSpec:
    name: my-mongo-cluster
    providerSettings:
      providerName: SERVERLESS
      backingProviderName: AWS
      regionName: EU_WEST_1

kubectl describe output:

Name:         atlas
Namespace:    REDACTED
Labels:       <none>
Annotations:  argocd.argoproj.io/tracking-id: REDACTED:atlas.mongodb.com/AtlasDeployment:REDACTED/atlas
              mongodb.com/atlas-resource-policy: delete
API Version:  atlas.mongodb.com/v1
Kind:         AtlasDeployment
Metadata:
  Creation Timestamp:  2025-02-07T09:46:11Z
  Finalizers:
    mongodbatlas/finalizer
  Generation:        1
  Resource Version:  289438282
  UID:               a6764544-d541-4533-b449-255c1100a648
Spec:
  Project Ref:
    Name:       mongodb-atlas-project
    Namespace:  mongodb-atlas
  Serverless Spec:
    Name:  REDACTED
    Provider Settings:
      Backing Provider Name:  AWS
      Provider Name:          SERVERLESS
      Region Name:            EU_WEST_1
    Tags:
      Key:                           application
      Value:                         REDACTED
    Termination Protection Enabled:  false
Status:
  Conditions:
    Last Transition Time:  2025-02-07T09:46:11Z
    Status:                False
    Type:                  Ready
    Last Transition Time:  2025-02-07T09:46:11Z
    Status:                True
    Type:                  ResourceVersionIsValid
    Last Transition Time:  2025-02-07T09:46:11Z
    Status:                True
    Type:                  ValidationSucceeded
    Last Transition Time:  2025-02-07T09:46:11Z
    Message:               unable to retrieve list of serverless private endpoints from Atlas: https://cloud.mongodb.com/api/atlas/v2/groups/REDACTED/privateEndpoint/serverless/instance/REDACTED/endpoint GET: HTTP 400 Bad Request (Error code: "NOT_SERVERLESS_TENANT_CLUSTER") Detail: The specified cluster REDACTED in group REDACTED is not a serverless tenant cluster. Reason: Bad Request. Params: [REDACTED REDACTED]
    Reason:                ServerlessPrivateEndpointFailed
    Status:                False
    Type:                  DeploymentReady
  Mongo DB Version:        8.0.4
  Observed Generation:     1
  State Name:              CREATING
Events:
  Type     Reason                       Age                    From             Message
  ----     ------                       ----                   ----             -------
  Normal   DeploymentCreating           37m (x5 over 38m)      AtlasDeployment  deployment is provisioning
  Warning  DeprecationWarning           4m38s (x258 over 49m)  AtlasDeployment  WARNING: Serverless is deprecated. See https://dochub.mongodb.org/core/atlas-flex-migration for details.
@s-urbaniak
Copy link
Collaborator

Hi, we are very sorry for the inconvenience, could you please try creating a flex cluster instead, as described at https://www.mongodb.com/docs/atlas/operator/upcoming/atlasdeployment-custom-resource/#flex-cluster-example?

In the meantime, we are investigating why the API shimming is not working as intended for serverless deployment types - but if you do the above, it’s not needed - it’s really only critical once deployments are automigrated to flex and we fully expect to have resolved this by then.

@LennartKoot
Copy link
Author

Thanks for the response. Directly creating / managing the Flex cluster using the flexSpec does work as intended. We have created a workaround in our deployment strategy to apply the serverlessSpec variant for existing deployments that need to be auto migrated while our new deployments use the new flexSpec and this solves the problem for us as long as this issue is fixed before auto migration happens. Glad to hear you fully expect that to happen!

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

No branches or pull requests

2 participants