Skip to content

remove the agent matrix work #267

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

Draft
wants to merge 33 commits into
base: master
Choose a base branch
from
Draft

remove the agent matrix work #267

wants to merge 33 commits into from

Conversation

nammn
Copy link
Collaborator

@nammn nammn commented Jul 15, 2025

Summary

Database:

from:

+------------------------------------------------------------+
|                        Pod: rs1                            |
+------------------------------------------------------------+
| Container 1: mongodb-agent (operator suffixed)             |
|   - entry: agent-launcher.sh                               |
|   - livenessProbe                                          |
|   - readinessProbe                                         |
+------------------------------------------------------------+
| Container 2: mongodb-enterprise-database                   |
|   - mongod                                                 |
|   - mongosh                                                |
+------------------------------------------------------------+

to:

+------------------------------------------------------------+
|                        Pod: rs1                            |
+------------------------------------------------------------+
| Container 1: mongodb-agent (not operator suffixed)         |
|   - entry: agent-launcher-shim.sh                          |
|   - dummy-livenessProbe                                    |
|   - dummy-readinessProbe                                   |
+------------------------------------------------------------+
| Container 2: utilities-holder (name tbd)                   |
|   - readinessProbe                                         |
|   - livenessProbe                                          |
|   - agent-launcher.sh                                      |
+------------------------------------------------------------+
| Container 3: mongodb-enterprise-database                   |
|   - mongod                                                 |
|   - mongosh                                                |
+------------------------------------------------------------+

AppDB:

from:

+------------------------------------------------------------+
|                        Pod: rs1                            |
+------------------------------------------------------------+
| Container 1: mongodb-agent (operator suffixed)             |
|   - entry: agent/mongodb-agent                             |
|   - agent-launcher.sh                                      |
|   - livenessProbe                                          |
|   - readinessProbe                                         |
+------------------------------------------------------------+
| Container 2: mongodb-enterprise-database                   |
|   - mongod                                                 |
|   - mongosh                                                |
+------------------------------------------------------------+

to:

+------------------------------------------------------------+
|                        Pod: rs1                            |
+------------------------------------------------------------+
| Container 1: mongodb-agent (not operator suffixed)         |
|   - entry: /usr/local/bin/setup-agent-files.sh &&          |
|            agent/mongodb-agent                             |
|   - agent-launcher-shim.sh (unused)                        |
|   - dummy-livenessProbe                                    |
|   - dummy-readinessProbe                                   |
+------------------------------------------------------------+
| Container 2: utilities-holder (name tbd)                   |
|   - readinessProbe                                         |
|   - livenessProbe                                          |
+------------------------------------------------------------+
| Container 3: mongodb-enterprise-database                   |
|   - mongod                                                 |
|   - mongosh                                                |
+------------------------------------------------------------+

Summary Changes

This pull request introduces significant changes to the MongoDB Kubernetes operator, focusing on refactoring, architecture updates, and bug fixes. The changes include removing unused dependencies, improving the handling of static and non-static architectures, and enhancing test coverage. Below is a categorized summary of the most important changes:

Refactoring and Code Simplification

  • No operator suffixed agent returned by the operator for the agent
  • Consolidated logic for handling static and non-static architectures in the buildDatabaseStatefulSetConfigurationFunction by introducing shared and architecture-specific modifications. [1] [2]
  • Renamed InitDatabaseNonStaticImage to InitDatabaseImage in DatabaseStatefulSetOptions for clarity.

Static and Non-Static Architecture Handling

  • Introduced separate functions (buildStaticArchitecturePodTemplateSpec and buildNonStaticArchitecturePodTemplateSpec) to handle static and non-static architectures, improving modularity and maintainability.
  • Updated the AppDbStatefulSet function to include opts.InitAppDBImage when defining init containers, ensuring proper handling of both architectures.

Enhancements to StatefulSet and Pod Templates

  • Added a new container (automationUtilitiesPodTemplateFunc) to the appDbPodSpec for managing utility scripts and hooks, along with corresponding volume mounts. [1] [2]
  • Adjusted the AutomationAgentCommand to include additional startup parameters for better configuration.

Proof of Work

  • passing ci
  • new e2e test: TBA

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 checked for release_note changes?

Reminder (Please remove this when merging)

  • Please try to Approve or Reject Changes the PR, keep PRs in review as short as possible
  • Our Short Guide for PRs: Link
  • Remember the following Communication Standards - use comment prefixes for clarity:
    • blocking: Must be addressed before approval.
    • follow-up: Can be addressed in a later PR or ticket.
    • q: Clarifying question.
    • nit: Non-blocking suggestions.
    • note: Side-note, non-actionable. Example: Praise
    • --> no prefix is considered a question

@nammn nammn force-pushed the remove-agent-matrix branch from d76eda3 to 08c2c49 Compare July 16, 2025 09:25
@nammn nammn added the wip label Jul 16, 2025
@nammn nammn changed the title refactor - agent matrix work wip - refactor - agent matrix work Jul 16, 2025
@nammn nammn changed the title wip - refactor - agent matrix work remove the magent matrix work Jul 23, 2025
@nammn nammn changed the title remove the magent matrix work remove the agent matrix work Jul 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant