Only userAdmin got created when I injected Telegraf into Cluster Pod

Hello there,

I am injecting a Sumologic-Telegraf side car into Percona Mongodb Cluster to collect metrics. During the pod initialization, mongod container was created first, Telegraf container creation was kicked in after mongod container was started. As observed, then the pod status keeps flapping.

mongo-2-rs-0                             2/2     Running            13         44m
mongo-2-rs-0                             1/2     Error              13         44m
mongo-2-rs-0                             1/2     CrashLoopBackOff   13         45m

As investigated, there is only one user: userAdmin, was created. I manually created user: clusterMonitor, then the pod runs into normal mode. it seems the kick-in time of side car defined in annotations should be controlled. With the given annotations, I haven’t find a solution. If you can shed a light on this problem, it will be appreciated.

rs:PRIMARY> db.createUser(
...   {
...     user: 'clusterMonitor',
...     pwd: 'xxxxxxx',
...     roles: [ { role: 'userAdminAnyDatabase', db: 'admin' } ]
...   }
... );
Successfully added user: {
	"user" : "clusterMonitor",
	"roles" : [
			"role" : "userAdminAnyDatabase",
			"db" : "admin"

The helm chart is from

    annotations: sumologic-prometheus "true" "9273" |+
          servers = ["mongodb://clusterMonitor:xxxxxxxx@"]
          gather_perdb_stats = true
          gather_col_stats = true
1 Like

By now, the problem is not resolved yet. But we decided not to adopt this approach because it duplicates the metrics as telegraf agent runs on each pod.

1 Like