title: How to use environment/secret variable in Helm?
body: <p>In my helm chart, I have a few files that need credentials to be inputted
  For example</p>
  <pre><code>&lt;Resource
      name=&quot;jdbc/test&quot;
      auth=&quot;Container&quot;
      driverClassName=&quot;com.microsoft.sqlserver.jdbc.SQLServerDriver&quot;
      url=&quot;jdbc:sqlserver://{{ .Values.DB.host }}:{{ .Values.DB.port }};selectMethod=direct;DatabaseName={{ .Values.DB.name }};User={{ Values.DB.username }};Password={{ .Values.DB.password }}&quot;
      /&gt;
  </code></pre>
  <p>I created a secret</p>
  <pre><code>Name: databaseinfo
     Data:
       username
       password
  </code></pre>
  <p>I then create environment variables to retrieve those secrets in my deployment.yaml:</p>
  <pre><code>env:
     - name: DBPassword
        valueFrom:
        secretKeyRef:
          key: password
          name: databaseinfo
     - name: DBUser
         valueFrom:
         secretKeyRef:
           key: username
           name: databaseinfo 
  </code></pre>
  <p>In my values.yaml or this other file, I need to be able to reference to this secret/environment variable. I tried the following but it does not work:
  values.yaml</p>
  <pre><code>DB:
    username: $env.DBUser
    password: $env.DBPassword
  </code></pre>