When I deploy postgres like the following snippet everything works:
.
.
.
env:
- name: POSTGRES_USER
value: a
.
.
.
But when I deploy it by configMap or secret for example:
env:
- name: POSTGRES_USER
valueFrom:
secretKeyRef:
name: postgres
key: username
when I execute psql -U it returns: psql: error: could not connect to server: FATAL: role "a" does not exist
I checked environment POSTGRES_USER and this variable is set to a