<p>I am not sure if I'm interpreting the output from my container correctly, but I am seeing the following output from sequelize in the logs:</p>

<pre><code>Nates-MacBook-Pro:k8s natereed$ docker logs 1a3e6141d050
...
(node:36) UnhandledPromiseRejectionWarning: SequelizeConnectionError: password authentication failed for user 
"postgres
"
</code></pre>

<p>It <em>appears</em> there is an extra newline character in the username, which should be "postgres". The database is configured with the environment variable $POSTGRESS_USERNAME (yes, I know it is mispelled, it is from another author).</p>

<pre><code>src/config/config.ts:    "username": process.env.POSTGRESS_USERNAME
</code></pre>

<p>I shelled into the running container and checked that the environment variables are correctly set:</p>

<pre><code>root@backend-feed-75c4f97d6-9tp2f:/usr/src/app# echo $POSTGRESS_USERNAME
postgres
root@backend-feed-75c4f97d6-9tp2f:/usr/src/app# echo $POSTGRESS_PASSWORD
...
root@backend-feed-75c4f97d6-9tp2f:/usr/src/app# echo $POSTGRESS_DB      
mydb

...
</code></pre>

<p>To create the secret and then apply, I ran:</p>

<pre><code>echo "postgres" | openssl base64
(edit env-secret.yaml)
kubectl apply -f env-secret.yaml 
</code></pre>

<p>The contents of the secret:</p>

<pre><code>apiVersion: v1
kind: Secret
metadata:
  name: env-secret
type: Opaque
data:
  POSTGRESS_USERNAME: cG9zdGdyZXMK
  POSTGRESS_PASSWORD: ...
</code></pre>

<p>Is this not the correct way to create the k8s secret?</p>

Nate Reed
<p>The simple option:</p>

<pre><code>apiVersion: v1
kind: Secret
metadata:
  name: env-secret
type: Opaque
stringData:
  POSTGRESS_USERNAME: myapp
  POSTGRESS_PASSWORD: supersecret
</code></pre>

<p><code>stringData</code> takes plain strings instead of base-64 encoded <code>[]byte</code>s.</p>
