Open Kaurin opened 3 weeks ago
Only DATABASE_URL
is supported at the moment.
I have worked around this by using an init container to generate the DATABASE_URL_FILE
file.
The example provided below is for the bjw-s common library. Variable names and secret naming schema comes from cloudnative-pg
This is... quite a workaround. Support for native env vars would be very much appreciated!
initContainers:
a-config:
image:
repository: busybox
tag: latest
env:
PGHOST:
valueFrom:
secretKeyRef:
name: miniflux-database-app
key: host
PGDATABASE:
valueFrom:
secretKeyRef:
name: miniflux-database-app
key: dbname
PGUSER:
valueFrom:
secretKeyRef:
name: miniflux-database-app
key: user
PGPASSWORD:
valueFrom:
secretKeyRef:
name: miniflux-database-app
key: password
PGPORT:
valueFrom:
secretKeyRef:
name: miniflux-database-app
key: port
command:
[
"sh",
"-c",
'umask 0177 && echo "host=$PGHOST port=$PGPORT user=$PGUSER password=$PGPASSWORD dbname=$PGDATABASE sslrootcert=/libpq/tls.crt sslmode=verify-full > /libpq-config/cloudnative-pg.txt',
]
Hi,
pq library respects environment variables from libpq, however, these are blocked from being interpreted by this particular code intercept specific to minifux which results in:
It would be nice to let users use natively supported environment variables. My use-case certainly demands it (cloudnative-postgres in kubernetes)