Several operators (clusters) in the same NameSpace

I’ve created 4 percona clusters in the same project-prod namespace. Each cluster has it’s own operator deployment with env configured:

  • command:
  • percona-server-mongodb-operator
    env:
  • name: WATCH_NAMESPACE
    valueFrom:
    fieldRef:
    apiVersion: v1
    fieldPath: metadata.namespace
  • name: OPERATOR_NAME
    value: project-prod-app2-percona-server-mongodb-operator
  • name: RESYNC_PERIOD
    value: 5s
  • name: LOG_VERBOSE
    value: “false”

The name of the clusters are:
project-prod-app1-pmongo
project-prod-app2-pmongo
project-prod-app3-pmongo
project-prod-app4-pmongo

listing log of any operator pod show me the output like below:
{“level”:“info”,“ts”:1582279817.2636805,“logger”:" controller_psmdb",“msg”:“Reconciling PerconaServerMongoDB”,“Request.Namespace”:“project-prod”,“Request.Name”:“project-prod-app1-pmongo”}
{“level”:“info”,“ts”:1582279819.05461,“logger”:“co ntroller_psmdb”,“msg”:“Reconciling PerconaServerMongoDB”,“Request.Namespace”:“project-prod”,“Request.Name”:“project-prod-app2-pmongo”}
{“level”:“info”,“ts”:1582279819.5460775,“logger”:" controller_psmdb",“msg”:“Reconciling PerconaServerMongoDB”,“Request.Namespace”:“project-prod”,“Request.Name”:“project-prod-app3-pmongo”}
{“level”:“info”,“ts”:1582279819.6458652,“logger”:" controller_psmdb",“msg”:“Reconciling PerconaServerMongoDB”,“Request.Namespace”:“project-prod”,“Request.Name”:“project-prod-app4-pmongo”}
{“level”:“info”,“ts”:1582279822.7419932,“logger”:" controller_psmdb",“msg”:“Reconciling PerconaServerMongoDB”,“Request.Namespace”:“project-prod”,“Request.Name”:“project-prod-app1-pmongo”}
{“level”:“info”,“ts”:1582279824.5462406,“logger”:" controller_psmdb",“msg”:“Reconciling PerconaServerMongoDB”,“Request.Namespace”:“project-prod”,“Request.Name”:“project-prod-app2-pmongo”}
{“level”:“info”,“ts”:1582279825.0096009,“logger”:" controller_psmdb",“msg”:“Reconciling PerconaServerMongoDB”,“Request.Namespace”:“project-prod”,“Request.Name”:“project-prod-app3-pmongo”}
{“level”:“info”,“ts”:1582279825.1085865,“logger”:" controller_psmdb",“msg”:“Reconciling PerconaServerMongoDB”,“Request.Namespace”:“project-prod”,“Request.Name”:“project-prod-app4-pmongo”}
{“level”:“info”,“ts”:1582279828.2157617,“logger”:" controller_psmdb",“msg”:“Reconciling PerconaServerMongoDB”,“Request.Namespace”:“project-prod”,“Request.Name”:“project-prod-app1-pmongo”}
{“level”:“info”,“ts”:1582279830.0097914,“logger”:" controller_psmdb",“msg”:“Reconciling PerconaServerMongoDB”,“Request.Namespace”:“project-prod”,“Request.Name”:“project-prod-app2-pmongo”}
{“level”:“info”,“ts”:1582279830.5440874,“logger”:" controller_psmdb",“msg”:“Reconciling PerconaServerMongoDB”,“Request.Namespace”:“project-prod”,“Request.Name”:“project-prod-app3-pmongo”}
{“level”:“info”,“ts”:1582279830.6457026,“logger”:" controller_psmdb",“msg”:“Reconciling PerconaServerMongoDB”,“Request.Namespace”:“project-prod”,“Request.Name”:“project-prod-app4-pmongo”}
{“level”:“info”,“ts”:1582279833.6988077,“logger”:" controller_psmdb",“msg”:“Reconciling PerconaServerMongoDB”,“Request.Namespace”:“project-prod”,“Request.Name”:“project-prod-app1-pmongo”}
{“level”:“info”,“ts”:1582279835.544197,“logger”:“c ontroller_psmdb”,“msg”:“Reconciling PerconaServerMongoDB”,“Request.Namespace”:“project-prod”,“Request.Name”:“project-prod-app2-pmongo”}
{“level”:“info”,“ts”:1582279836.0527575,“logger”:" controller_psmdb",“msg”:“Reconciling PerconaServerMongoDB”,“Request.Namespace”:“project-prod”,“Request.Name”:“project-prod-app3-pmongo”}
{“level”:“info”,“ts”:1582279836.203333,“logger”:“c ontroller_psmdb”,“msg”:“Reconciling PerconaServerMongoDB”,“Request.Namespace”:“project-prod”,“Request.Name”:“project-prod-app4-pmongo”}

every operator reconciles every cluster in the namespace… is it a bad decision to run multiple clusters in the same NameSpace? I’m confused about this log and afraid of doing something wrong. Docs has no line restricting running multiple percona operators in the same NameSpace as well as no lines allowing to do it.

logs are expected.

is something works wrong?

No, everything works OK. just want to be sure seeing other clusters name in the operator log is OK. It is just confusing.

PS: the issue that lead me to the operator log was the update from 1.2 to 1.3. Dont know why but the DNS names got mismatched.

DNS name project-prod-app1-pmongo-rs-0.project-prod-app1-pmongo-rs.project-prod.svc.cluster.local resolve to x.x.x.x.
the mongod container in the pod project-prod-app1-pmongo-rs-0 had IP: y.y.y.y.
i’v reverted back to 1.2 and it got fixed in a few hours by itself. Deleting the operator and cluster pods did not speed the fix up.