Percona MongoDB operator - No users created from my-cluster-name-secrets secret while deploying 3 node replica set


I have deployed a mongoDB cluster on Kubernetes using the Operator

kind: PerconaServerMongoDB
  name: mongocluster
  crVersion: 1.16.0
  image: perconalab/percona-server-mongodb-operator:main-mongod6.0
  allowUnsafeConfigurations: true
    apply: disabled
    schedule: "0 2 * * *"
  # secrets:
  #   users: minimal-cluster
    users: my-cluster-name-secrets

The pods are running fine and I have exposed them as LoadBalancer Service

mongocluster-rs0     ClusterIP      None           <none>            27017/TCP         25m
mongocluster-rs0-0   LoadBalancer   27017:30927/TCP   25m
mongocluster-rs0-1   LoadBalancer   27017:31089/TCP   25m
mongocluster-rs0-2   LoadBalancer   27017:31433/TCP   25m

However I see none of the users are created,

"mongodb://,," -u databaseAdmin --tls=false

Authentication Fails .

For example

"","extraInfo":{},"error":"UserNotFound: Could not find user \"clusterMonitor\" for db \"admin\""}}
{"t":{"$date":"2024-01-31T16:27:39.595+00:00"},"s":"I",  "c":"-",        "id":20883,   "ctx":"conn157","msg":"Interrupted operation as its client disconnected","attr":{"opId":2918}}

Same for any userIDs like databaseAdmin and clusterAdmin

Any pointers will really help.


On Further inspection, the replica set is not initialized as well.

"t":{"$date":"2024-02-01T08:20:26.347+00:00"},"s":"I",  "c":"ACCESS",   "id":20436,   "ctx":"conn37","msg":"Checking authorization failed","attr":{"error":{"code":13,"codeName":"Unauthorized","errmsg":"not authorized on admin to execute command { getLog: \"startupWarnings\", lsid: { id: UUID(\"6fdf2b75-cf54-481c-b07a-68682bad6636\") }, $db: \"admin\" }"}}}
{"t":{"$date":"2024-02-01T08:20:26.387+00:00"},"s":"I",  "c":"-",        "id":4939300, "ctx":"monitoring-keys-for-HMAC","msg":"Failed to refresh key cache","attr":{"error":"NotYetInitialized: Cannot use non-local read concern until replica set is finished initializing.","nextWakeupMillis":5200}}

This issue is resolved. I tried to configure a specific clusterServiceDNSSuffix where I didn’t put svc. it should have been svc.. correcting it sorted the issue.