Skip to content

[Bug]: How to detect which fields need to be set for AtlasDeployments created prior to 2.4.1 to reach ready after upgrading to 2.5.0 #3142

@lucasslima

Description

@lucasslima

Is there an existing issue for this?

  • I have searched the existing issues

AKO Version

v2.5.0

Distribution

Kubernetes

Kubernetes Version

v1.33.0

Current Behavior

Hi,

We have a number of AtlasDeployment resources created in mongodb-atlas-operator versions prior to 2.4.1. We recently tried to upgrade it to latest versions, and we apparently fell in the situation mentioned in the documentation for 2.5.0 on-wards:

Explicitly define your desired configuration details in order to avoid implicitly using default Atlas configuration values. In some cases, inheriting Atlas defaults may result in a reconciliation loop which can prevent your custom resource from achieving a READY state. For example, explicitly defining your desired autoscaling behavior in your AtlasDeployment custom resource, as shown in the included example, ensures that a static instance size in your custom resource is not being repeatedly applied to an Atlas deployment which has autoscaling enabled.

There are many AtlasDeployments that never reach the READY state when upgrading it to any version after 2.5.0. We would like to know what how we could detect the fields that are causing the eternal reconciliation loop so we can set then in our resources.

Custom Resources to reproduce the issue

apiVersion: atlas.mongodb.com/v1
kind: AtlasDeployment
metadata:
  annotations:
    meta.helm.sh/release-name: customers-profile-system-sit-resources
    meta.helm.sh/release-namespace: customers-profile-system-sit
    mongodb.com/atlas-resource-policy: keep
  finalizers:
  - mongodbatlas/finalizer
  generation: 7
  labels:
    ...
  name: customers-profile-system-sit
  namespace: customers-profile-system-sit
spec:
  backupRef:
    name: customers-profile-system-sit
    namespace: customers-profile-system-sit
  deploymentSpec:
    backupEnabled: true
    clusterType: REPLICASET
    mongoDBMajorVersion: "8.0"
    name: customers-profile-system-sit
    pitEnabled: false
    replicationSpecs:
    - regionConfigs:
      - autoScaling:
          compute:
            enabled: false
        backingProviderName: GCP
        electableSpecs:
          instanceSize: M30
          nodeCount: 3
        priority: 7
        providerName: GCP
        regionName: EASTERN_US
    terminationProtectionEnabled: false
  projectRef:
    name: enterprise-sit
    namespace: mongodb-operator

Steps To Reproduce

  1. Resource was created with versions prior to 2.4.1
  2. Upgrading the operator to 2.5.0 causes the resource to be in a constant Reconcile loop, never reaching Ready = True

Logs

Atlas Activity Log

This is what the Atlas interface logged in the Activity tab:

Image

It showed that multiple times.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions