<p>I am relativly new to Kubernetes and I have the following problem: We use Grafana in our Kubernetes Cluster, but currently the way our <code>template.yaml</code> file is built does not allow to use a secret form a password.</p>
<pre><code>  - apiVersion: v1
    kind: ConfigMap
    metadata:
      labels:
        app: ${APP}
      name: &quot;${APP}-ldap-file&quot;
    data:
      ldap.toml: |-
        [[servers]]
        ....
        # Search user bind dn
        bind_dn = &quot;uid=tu0213,cn=users,o=company,c=de&quot;
        bind_password = ${BIND_PASSWORD}

parameters:
  - name: BIND_PASSWORD
</code></pre>
<p>Just using the password this way works fine, but it´s in plain text in a <code>params</code> file in our CI/CD Pipeline.</p>
<p>I a different repository I fould this:</p>
<pre><code>  spec:
    containers:
    - name: nginx-auth-ldap
      image: ${REGISTRY}/${NAMESPACE}/nginx-auth-ldap:6
      imagePullPolicy: Always
      env: 
        - name: LDAP_BIND_DN
          valueFrom:
            secretKeyRef:
              name: ldap-bind-dn
              key: dn
</code></pre>
<p>Is this <code>valueFrom</code> approach also possible in my usecase?</p>

Data Mastery
<p>You can use a secret like that but you have to split the data into separate keys like this:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: Secret
metadata:
  labels:
    app: ${APP}
  name: &quot;${APP}-ldap-file&quot;
stringData:
  dn: &quot;uid=tu0213,cn=users,o=company,c=de&quot;
</code></pre>
