<p>Got a helm chart with an environment variable being imported from a kubernetes secret:</p>
<pre><code>env:
  MONGO_URI:
   name: mongo-secret
   type: secret
   key: mongodb-uri
</code></pre>
<p>But when I try rendering the template, I get the following error:</p>
<pre><code>error calling required: HELM_ERR_START
Attempted to reference unknown object mongo-secret. Either create it or add it to externalReferences HELM_ERR_END
</code></pre>
<p>But the secret exists:</p>
<pre><code>$ kubectl get secrets

NAME                                                   TYPE                 DATA       AGE
mongo-secret                                           Opaque               1           1d
</code></pre>
<p>Am I missing something? How do I fix this error?</p>

ritratt
<p>I had to add the secret to <code>externalReferences</code> just as the error asked me to. Here is how I added it to the chart:</p>
<pre><code>externalReferences:
  mongo-secret: 'mongo-secret'
</code></pre>
