Skip to content

KUBE-182: Make agent version follow Ops Manager version#1395

Open
nammn wants to merge 6 commits into
masterfrom
change-default-agent
Open

KUBE-182: Make agent version follow Ops Manager version#1395
nammn wants to merge 6 commits into
masterfrom
change-default-agent

Conversation

@nammn

@nammn nammn commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

Development contexts should use an agent version compatible with the selected Ops Manager version without requiring per-context pins. This change resolves the agent version dynamically from the Ops Manager mapping in release.json based on each variant's CUSTOM_OM_VERSION, removes hardcoded agent pins from the om70/om80 context files, and keeps the agent rebuild task aware of dynamically selected versions by reading latestOpsManagerAgentMapping directly from release.json.

For OM variants, the new resolve-agent-version.sh resolves a version different from the default, so the new code path is exercised by CI:

Variant CUSTOM_OM_VERSION Resolved agent Default agentVersion
om70 7.0.23 107.0.23.8833-1 108.0.12.8846-1
om80 8.0.25 108.0.25.9029-1 108.0.12.8846-1

Variants that don't set CUSTOM_OM_VERSION (e.g. community operator contexts like e2e_mdb_community, e2e_mco_tests) fall back to the default agentVersion (108.0.12.8846-1) via the fallback path in resolve-agent-version.sh.

Proof of Work

  • e2e: Evergreen patch 6a5ddd62adc46f0007169f6d — OM variants green (no failures):
    • e2e_om80_kind_ubi_large
    • e2e_om80_kind_ubi
    • e2e_multi_cluster_om_appdb
    • Both OM variants resolve agent versions via the new resolve-agent-version.sh, confirming the dynamic resolution path is validated without any manual default bump.

Checklist

  • Have you linked a jira ticket and/or is the ticket in the title?
  • Have you checked whether your jira ticket required DOCSP changes?
  • Have you added changelog file?

@nammn nammn added the skip-changelog Use this label in Pull Request to not require new changelog entry file label Jul 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ (this preview might not be accurate if the PR is not rebased on current master branch)

MCK 1.10.0 Release Notes

New Features

  • MongoDBOpsManager, AppDB: The mongodb-agent-monitoring sidecar container has been merged into the main
    mongodb-agent container. Both automation and monitoring now run as a single process in a single container. The
    spec.appDB.monitoringAgent field is now deprecated and has no effect; Monitoring Agent options for the AppDB —
    including log level and rotation — are configured via spec.applicationDatabase.agent and
    spec.applicationDatabase.agent.monitoringAgent, the same fields used by MongoDB resources. Enabling AppDB
    monitoring still results in rolling restarts of AppDB pods.
  • MongoDBSearch: Added support to show cluster level status of Search, Managed LoadBalancer and MetricsForwarder in the MongoDBSearch resource's status.clusters field.
  • MongoDBSearch: Added support to configure the node affinity of the MongoDB Search (mongot) pods using the MongoDBSearch CR fields spec.clusters[].nodeAffinity or spec.clusters[].shardOverrides[].nodeAffinity.

Bug Fixes

  • MongoDBUser: Fixed a bug where the connection string Secret created in the central cluster did not carry a controller owner reference to the MongoDBUser CR. The missing reference prevented Kubernetes garbage collection from cleaning up the Secret when the MongoDBUser was deleted.
  • MongoDBUser: Fixed a bug where the ownership guard on the connection string Secret was always satisfied regardless of the actual owner, allowing the operator to silently overwrite a Secret controlled by a different resource.
  • Fixed a bug where all MongoDBCommunity deployment telemetry rows incorrectly reported IsRunningEnterpriseImage = true. The field was being evaluated against the operator-level enterprise image rather than the image configured in each CR's spec, causing a misleading ~100% enterprise rate for the Community deployment type.
  • IsRunningEnterpriseImage for Community deployments is now derived from the mongod container image override in spec.statefulSet.spec.template.spec.containers, if present. When no override is set, the field correctly defaults to false, reflecting that Community CRs use the community MongoDB server image by default.
  • MongoDBOpsManager, AppDB: Fix for spec.applicationDatabase.agent.monitoringAgent.logRotate field not being
    handled properly. Additionally, added defaults for
    spec.applicationDatabase.agent.monitoringAgent.logRotate.sizeThresholdMB to 1000 and
    spec.applicationDatabase.agent.monitoringAgent.logRotate.timeThresholdHrs to 24, which are same defaults Ops Manager
    would set.
  • MongoDBSearch: The default JVM heap size (half of the memory request) is now capped at 30GB, following the mongot sizing guidance. Heap sizes above ~30GB prevent the JVM from using compressed object pointers and degrade performance. User-provided heap flags are not affected, if more than 30GB heap is required, we recommend using jvmFlags.

Comment thread scripts/release/agent/agents_to_rebuild.py Outdated
@nammn nammn changed the title Make agent version follow Ops Manager version KUBE-182: Make agent version follow Ops Manager version Jul 20, 2026
for entry in release_data.get("latestOpsManagerAgentMapping", []):
for major, info in entry.items():
agent_tools = ops_manager_versions.get(info["opsManagerVersion"])
if agent_tools:

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this code was too complex, since we now use om_version and get its agent we can just get release.json and build their agents.

Realistically, we might not even need the whole file in the near future

@nammn
nammn force-pushed the change-default-agent branch from e527097 to 4f6393d Compare July 20, 2026 11:23
@nammn
nammn marked this pull request as ready for review July 20, 2026 11:26
@nammn
nammn requested a review from a team as a code owner July 20, 2026 11:26
@nammn
nammn requested review from MaciejKaras and lucian-tosa July 20, 2026 11:26

@MaciejKaras MaciejKaras left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! This make total sense and I like how this is now more verbose. Those context file versions were problematic to me multiple times as well 👍

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

Labels

skip-changelog Use this label in Pull Request to not require new changelog entry file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants