<p>I am deploying airflow into Kubernetes using: <a href="https://github.com/helm/charts/tree/master/stable/airflow" rel="nofollow noreferrer">https://github.com/helm/charts/tree/master/stable/airflow</a></p>
<p>I am trying to connect my external PostgreSQL database by modifying the values.yml:</p>
<pre class="lang-yml prettyprint-override"><code>externalDatabase:
  ## the type of external database: {mysql,postgres}
  ##
  type: postgres

  ## the host of the external database
  ##
  host: &lt;HOST&gt;

  ## the port of the external database
  ##
  port: 5432

  ## the database/scheme to use within the the external database
  ##
  database: airflow

  ## the user of the external database
  ##
  user: &lt;USER&gt;

  ## the name of a pre-created secret containing the external database password
  ##
  passwordSecret: &quot;&quot;

  ## the key within `externalDatabase.passwordSecret` containing the password string
  ##
  passwordSecretKey: &quot;&quot;

  ## the connection properties for external database, e.g. &quot;?sslmode=require&quot;
  properties: &quot;?sslmode=require&quot;
</code></pre>
<p>But it is requesting <code>passwordSecret</code>and <code>passwordSecretKey</code>.</p>
<p>How I can create passwordSecret secret in Kubernetes?</p>
<p><code>passwordSecretKey</code> is the password for the airflow user?</p>

<p>The easiest way is to follow the steps <a href="https://kubernetes.io/docs/concepts/configuration/secret/#creating-a-secret" rel="nofollow noreferrer">here</a>.</p>
<p>Create a yaml file called mysecretcreator.yaml</p>
<pre><code>apiVersion: v1
kind: Secret
metadata:
  name: mysecret
type: Opaque
data:
  username: YWRtaW4=
  password: MWYyZDFlMmU2N2Rm
</code></pre>
<p>And then run <code>kubectl apply -f mysecretcreator.yaml</code></p>
<p>Once the secret has been created, add the following to the custom-values.yaml</p>
<pre><code>  ## the name of a pre-created secret containing the external database password
  ##
  passwordSecret: &quot;mysecret&quot;
</code></pre>
