What is the recommended approach to managing multiple rabbitmq clusters located in different namespaces in a Kubernetes cluster?
Specifically, is it advisable to install a cluster-operator in each namespace?
The recommended approach is to deploy one cluster operator for all the rabbitmq clusters in every namespace. A single instance for all namespaces is the default and by far the most popular deployment model. Each RabbitMQ cluster remains namespace scoped; it's only the operator itself that by default is cluster scoped.
If you must have multiple operators, then each one should be scoped to one or more namespaces by setting OPERATOR_SCOPE_NAMESPACE . This would ensure that only one operator instance reconciles RabbitMQ clusters in a given namespace. Note that this would reduce the scope of the cluster operator from cluster to namespace. This can be done by editing the deployment or the cluster yaml file as shown below.
kubectl -n rabbitmq-system edit deployment rabbitmq-cluster-operator
env:
- name: OPERATOR_SCOPE_NAMESPACE
value: "target-namespace-1,target-namespace-2
Having multiple operators for the same namespace is not tested, recommended or supported.