mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-18 06:28:50 +02:00
introduce extra pooler secret for mounting auth_file
This commit is contained in:
@@ -1 +0,0 @@
|
||||
"$PGUSER" "$PGPASSWORD"
|
||||
@@ -15,19 +15,5 @@ else
|
||||
fi
|
||||
|
||||
envsubst < /etc/pgbouncer/pgbouncer.ini.tmpl > /etc/pgbouncer/pgbouncer.ini
|
||||
envsubst < /etc/pgbouncer/auth_file.txt.tmpl > /etc/pgbouncer/auth_file.txt
|
||||
|
||||
# --- Append Infrastructure Roles ---
|
||||
if [ -n "${INFRASTRUCTURE_ROLES}" ]; then
|
||||
# Use a loop to read each line from the multi-line variable
|
||||
echo "${INFRASTRUCTURE_ROLES}" | while IFS= read -r line; do
|
||||
# Skip empty lines
|
||||
[ -z "${line}" ] && continue
|
||||
|
||||
# Append formatted "user" "password" pair to the auth file
|
||||
# This assumes each line of $INFRASTRUCTURE_ROLES is "user password"
|
||||
echo "${line}" | awk '{printf "\"%s\" \"%s\"\n", $1, $2}' >> /etc/pgbouncer/auth_file.txt
|
||||
done
|
||||
fi
|
||||
|
||||
exec /bin/pgbouncer /etc/pgbouncer/pgbouncer.ini
|
||||
|
||||
@@ -9,8 +9,9 @@ pool_mode = $CONNECTION_POOLER_MODE
|
||||
listen_port = $CONNECTION_POOLER_PORT
|
||||
listen_addr = *
|
||||
admin_users = $PGUSER
|
||||
stats_users = $INFRASTRUCTURE_ROLES
|
||||
auth_dbname = postgres
|
||||
auth_file = /etc/pgbouncer/auth_file.txt
|
||||
auth_file = /etc/pgbouncer/userlist.txt
|
||||
auth_query = SELECT * FROM $PGSCHEMA.user_lookup($1)
|
||||
auth_type = md5
|
||||
logfile = /var/log/pgbouncer/pgbouncer.log
|
||||
|
||||
Reference in New Issue
Block a user