<p>I am able to run helm, postgresql chart without any dependencies by using the below command</p>

<p><code>helm install --name my-release \
  --set postgresqlPassword=secretpassword,postgresqlDatabase=my-database \
    stable/postgresql</code></p>

<p>But, when i run with a requirements.yaml file  i am running out issues. Below is the snippet</p>

<p><code>dependencies:
- name: postgresql
  repository: https://charts.bitnami.com/bitnami
  version: 3.7.1
</code>
i have added the env variable in deployment.yaml file 
<code>spec:
      containers:
        - name: {{ .Chart.Name }}
          image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
          imagePullPolicy: {{ .Values.image.pullPolicy }}
          env:
          - name: POSTGRES_HOST
            value: {{ template "postgresql.fullname" . }}
          - name: POSTGRES_PORT
            value: "5432"
          - name: POSTGRES_USERNAME
            value: {{ default "" .Values.postgresql.postgresqlUsername | quote }}
          - name: POSTGRES_PASSWORD
            value: {{ default "" .Values.postgresql.postgresqlPassword | quote }}
          - name: POSTGRES_DATABASE
            value: {{ default "" .Values.postgresql.postgresqlDatabase | quote }}
          ports:
            - containerPort: {{ .Values.service.internalPort }}</code></p>

<p>Added the values according to environmental variables declared in deployment.yaml file</p>

<p><code>postgresql:
  POSTGRES_DATABASE: ******
  POSTGRES_USERNAME: postgres
  POSTGRES_PASSWORD: password</code></p>

<p>When i use helm install command 
<code>helm install &lt;chart-name&gt;/ --name *** --set postgresqlDatabase=*****,postgresqlPassword=password</code></p>

<p>i am getting the following error as
<code>Caused by: org.postgresql.util.PSQLException: FATAL: password authentication failed for user "postgres"
    at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:473) ~[postgresql-42.2.2.jar!/:42.2.2]
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:205) ~[postgresql-42.2.2.jar!/:42.2.2]
    at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49) ~[postgresql-42.2.2.jar!/:42.2.2]
    at org.postgresql.jdbc.PgConnection.&lt;init&gt;(PgConnection.java:195) ~[postgresql-42.2.2.jar!/:42.2.2]
    at org.postgresql.Driver.makeConnection(Driver.java:452) ~[postgresql-42.2.2.jar!/:42.2.2]
    at org.postgresql.Driver.connect(Driver.java:254) ~[postgresql-42.2.2.jar!/:42.2.2]
    at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:117) ~[HikariCP-2.7.8.jar!/:na]
    at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:123) ~[HikariCP-2.7.8.jar!/:na]
    at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:365) ~[HikariCP-2.7.8.jar!/:na]
    at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:194) ~[HikariCP-2.7.8.jar!/:na]
    at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:460) ~[HikariCP-2.7.8.jar!/:na]
    at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:534) ~[HikariCP-2.7.8.jar!/:na]
    at com.zaxxer.hikari.pool.HikariPool.&lt;init&gt;(HikariPool.java:115) ~[HikariCP-2.7.8.jar!/:na]
    at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112) ~[HikariCP-2.7.8.jar!/:na]
    at org.flywaydb.core.internal.util.jdbc.JdbcUtils.openConnection(JdbcUtils.java:51) ~[flyway-core-5.0.7.jar!/:na]
    ... 91 common frames omitted
</code>
I am not sure how to assign the password for dependency postgresql. Is there a way to connect with postgres database. </p>

klee
<p>What you are missing is something to set the password for the postgres instance that is embedded in your chart within in your values file, such as with an entry in the values like:</p>

<pre><code>postgresql:
   postgresPassword: secretpassword 
</code></pre>

<p>Notice that this uses the camelcase name and not the all-uppercase as you are using. This will do the equivalent of setting the password via <code>--set postgresql.postgresqlPassword=secretpassword</code>. The value will be used by the bitnami postgresql chart to <a href="https://github.com/helm/charts/blob/master/stable/postgresql/templates/secrets.yaml#L13" rel="nofollow noreferrer">record its password within a secret.</a> I'd suggest obtaining the password from that secret, though you could reference it directly in your Deployment as you are with <code>.Values.postgresql.postgresqlPassword</code>.</p>

<p>Either way you need to ensure you really do set it, either in the values with its name and not a uppercase name or as a parameter - I'd suggest putting a default in the values and you can override with a parameter.</p>

<p>To use the secret to get the password in the Deployment instead of <code>.Values.postgresql.postgresqlPassword</code> you would set the environment variable value with:</p>

<pre><code>      valueFrom:
        secretKeyRef:
          name: {{ .Release.Name }}-postgresql
          key: postgres-password
</code></pre>

<p>Here <code>{{ .Release.Name }}-postgresql</code> <a href="https://github.com/helm/charts/blob/master/stable/postgresql/templates/secrets.yaml#L5" rel="nofollow noreferrer">should match the secret name that the postgresql chart uses</a>.</p>

<p>(If an example helps the activiti runtime bundle chart <a href="https://github.com/Activiti/example-runtime-bundle/blob/76b686eea94de2a6a6b199da503a7ea01818e9fc/charts/example-runtime-bundle/requirements.yaml#L2" rel="nofollow noreferrer">uses postgres as a dependency</a> (it gives it an alias) and it <a href="https://github.com/Activiti/example-runtime-bundle/blob/76b686eea94de2a6a6b199da503a7ea01818e9fc/charts/example-runtime-bundle/values.yaml#L26" rel="nofollow noreferrer">sets the postgres password in the values</a>. It then retrieves the password and uses it in the deployment indirectly by <a href="https://github.com/Activiti/example-runtime-bundle/blob/76b686eea94de2a6a6b199da503a7ea01818e9fc/charts/example-runtime-bundle/templates/deployment.yaml#L66" rel="nofollow noreferrer">reading the password from the secret that the postgres chart automatically creates</a>, which can be referenced using the release name because the postgres chart names the secret using the template full name. This is based on the postgresql chart from the <a href="https://github.com/helm/charts/tree/master/stable/postgresql" rel="nofollow noreferrer">official kubernetes charts</a> but as mentioned the bitnami chart creates a secret from a <code>postgresqlPassword</code> <a href="https://github.com/helm/charts/blob/master/stable/postgresql/templates/secrets.yaml#L13" rel="nofollow noreferrer">entry in the same way</a>)</p>
