pgbouncer admin console with the latest crunchydata + kubectl

151 views
Skip to first unread message

David Angel

unread,
Mar 14, 2023, 1:29:20 PM3/14/23
to Postgres Operator
Does anyone know how to connect to the admin console with the latest crunchydata.
Or any way to run the pgbouncer admin commands

This is critical diagnostic info we must all have when something goes wrong.
 > show stats
 > show clients
 > show pools
 > show lists

The demos and examples I find online are for PGO 4

See Admin Console
https://www.pgbouncer.org/usage.html

  1. psql does not exist on the pgbouncer pod
  2. creating a port-forward to a pod having psql gives "not allowed"
  3. assuming we are supposed to use "_crunchypgbouncer"



alias k='kubectl'
 
# Create port-forward
PG_CLUSTER_PRIMARY_POD=$(k get pod -l="postgres-operator.crunchydata.com/role=pgbouncer" -o name)
k port-forward "$(k get pod -l="postgres-operator.crunchydata.com/role=pgbouncer" -o name)" 5432:5432

# Try to connect 
pgbouncer_password=$(k get secret -l="postgres-operator.crunchydata.com/role=pgbouncer" -o jsonpath={.items[].data.pgbouncer-password} | base64 -d)
PGSSLMODE=require PGPASSWORD="$pgbouncer_password" psql -h localhost -U _crunchypgbouncer -d pgbouncer

RESULT
psql: error: connection to server at "localhost" (::1), port 5432 failed: FATAL:  not allowed

Tony Landreth

unread,
May 23, 2023, 11:53:21 AM5/23/23
to Postgres Operator, David Angel
Hi David,

Thank you for reaching out! We have added a story to our backlog to look at strategies for exposing PgBouncer diagnostic information (e.g. via the admin console, etc.).

In the meantime, any other details about your specific use case would be much appreciated. For example, any insight into how you plan to use any diagnostic information from PgBouncer - e.g. as part of your overall monitor/metrics stack - would be great.

We are interested in exploring various ways of collecting & exposing pertinent PgBouncer metrics, so any insight into your specific use case would be much appreciated.

Thanks,
Tony
Reply all
Reply to author
Forward
0 new messages