Skip to content

Running multiple MongoDBCommunity resources across different namespaces: single operator vs multiple operators #769

@iilrgmv

Description

@iilrgmv

Description
Hi,

I’m currently working on a Kubernetes setup where we need to deploy multiple independent MongoDB replica sets, each one managed as a MongoDBCommunity resource, and isolated per application using different namespaces.

We are using the MongoDB Community Operator, and I would like to better understand the recommended and supported way to handle this scenario.

Current situation

  • We have the MongoDBCommunity CRD installed cluster-wide.

  • We have deployed one MongoDB Community Operator using Helm.

  • We want to create multiple MongoDBCommunity resources, for example:

  • MongoDBCommunity in namespace app-a

  • MongoDBCommunity in namespace app-b

  • Each resource represents a separate replica set, used by a different application.

  • We do not want those MongoDB instances to interact with each other.

However, we’ve observed that:

  • MongoDBCommunity resources created outside the operator’s namespace are not reconciled
  • The CR appears “Active”, but:
  • .status.phase is not populated
  • no StatefulSets / Pods are created

This suggests that the operator may be watching only a single namespace, or that additional configuration is required.

Questios

  1. Is it supported to manage multiple MongoDBCommunity resources across different namespaces using a single operator instance?

If yes:

  • How should the operator be configured to watch multiple namespaces (or all namespaces)?
  • Is there a recommended Helm value or operator flag for this (WATCH_NAMESPACE, --watch-namespace, etc.)?
  1. If a single operator watching multiple namespaces is not recommended:
    Is it supported to deploy multiple instances of the MongoDB Community Operator, each scoped to a specific namespace?

Are there any caveats regarding:

  • CRD ownership
  • leader election
  • resource conflicts
  1. What is the recommended best practice for this use case:
  • Multiple applications
  • Multiple namespaces
  • One MongoDB replica set per application
  • Strong isolation, but minimal operational overhead

Thanks in advance!

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