<p>I installed mongodb using Helm in my Kubernetes cluster.
<a href="https://github.com/kubernetes/charts/tree/master/stable/mongodb" rel="nofollow noreferrer">https://github.com/kubernetes/charts/tree/master/stable/mongodb</a></p>

<p>It works fine and lets me connect to the db. But I cannot do any operation once I log into the mongo server. Here is the error I get when I try to see the collections.</p>

<pre><code>    &gt; show collections;
2018-04-19T18:03:59.818+0000 E QUERY    [js] Error: listCollections failed: {
    "ok" : 0,
    "errmsg" : "not authorized on test to execute command { listCollections: 1.0, filter: {}, $db: \"test\" }",
    "code" : 13,
    "codeName" : "Unauthorized"
} :
_getErrorWithCode@src/mongo/shell/utils.js:25:13
DB.prototype._getCollectionInfosCommand@src/mongo/shell/db.js:942:1
DB.prototype.getCollectionInfos@src/mongo/shell/db.js:954:19
DB.prototype.getCollectionNames@src/mongo/shell/db.js:965:16
shellHelper.show@src/mongo/shell/utils.js:836:9
shellHelper@src/mongo/shell/utils.js:733:15
@(shellhelp2):1:1
</code></pre>

<p>I am logging in as the root user using </p>

<pre><code>mongo -p password
</code></pre>

<p>I don't know why even the root user has no authorization to do anything.</p>

<p>I found the issue. By default, MongoDB uses the admin DB to authenticate but in the helm chart, the authentication DB is the same as the DB that you create with it. So If I create a DB called test, the authentication DB will also be test</p>
