Skip to content

Conversation

@sina-grz
Copy link

@sina-grz sina-grz commented Sep 7, 2025

Summary

I previously described the problems and possible solutions in this issue:
#416
mongodb/mongodb-kubernetes-operator#1737

This branch implements the second proposed solution: Context-Aware Default Templates.
The goal is to avoid unnecessary resource waste by providing separate defaults for arbiters vs. data members while keeping customization consistent.

Proof of Work

Implementation:

  • Pass an isArbiter boolean to the build function
  • Apply arbiter-optimized defaults when isArbiter=true:
    • No PVC
    • Minimal resources
  • Maintain current behavior for data members
  • Keep spec.statefulSet for member customization only

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?

@sina-grz sina-grz requested a review from a team as a code owner September 7, 2025 09:45
@vinilage
Copy link
Collaborator

Thank you very much @sina-grz for the contribution. We will review the PR and get back to you.

@codeowners-service-app
Copy link

codeowners-service-app bot commented Dec 3, 2025

Assigned Julien-Ben for team kubernetes-hosted because fealebenpae is out of office.
Assigned viveksinghggits for team kubernetes-hosted because lucian-tosa is out of office.

@PeterC89
Copy link

PeterC89 commented Dec 8, 2025

IMO it would be nice if it were possible to define a separate spec for arbiters.
For example, we have a need to run an arbiter on a specific node, which can't be done under the current setup, or via the option proposed in this PR.
Sadly it's not a feature I can contribute to as I'm not a Go developer 😢

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants