From b038191aae406f729e4d6f1b8fd598de742e3e4b Mon Sep 17 00:00:00 2001 From: Florian Herrengt Date: Fri, 26 Jul 2024 15:08:33 +0100 Subject: [PATCH] configure pgbouncer --- databases/pgbouncer.yaml | 45 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/databases/pgbouncer.yaml b/databases/pgbouncer.yaml index 71315ab..bdba795 100644 --- a/databases/pgbouncer.yaml +++ b/databases/pgbouncer.yaml @@ -44,6 +44,51 @@ spec: - name: PGBOUNCER_DATABASE value: nocodelytics_production --- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: pgbouncer-exporter + namespace: databases +spec: + replicas: 1 + selector: + matchLabels: + app: pgbouncer-exporter + template: + metadata: + labels: + app: pgbouncer-exporter + annotations: + prometheus.io/scrape: "true" + prometheus.io/port: "9127" + spec: + containers: + - name: pgbouncer-exporter + image: prometheuscommunity/pgbouncer-exporter:latest + ports: + - containerPort: 9127 + args: + - --pgBouncer.connectionString=postgres://postgres:$(POSTGRES_PASSWORD)@pgbouncer.databases:5432/pgbouncer?sslmode=disable + - --web.listen-address=:9127 + env: + - name: POSTGRES_PASSWORD + valueFrom: + secretKeyRef: + name: secrets + key: POSTGRES_PASSWORD + - name: PGBOUNCER_DEFAULT_POOL_SIZE + value: "20" + - name: PGBOUNCER_MAX_CLIENT_CONN + value: "500" + - name: PGBOUNCER_SERVER_IDLE_TIMEOUT + value: "60" + - name: PGBOUNCER_POOL_MODE + value: transaction + - name: PGBOUNCER_RESERVE_POOL_SIZE + value: "10" + - name: PGBOUNCER_RESERVE_POOL_TIMEOUT + value: "5" +--- apiVersion: v1 kind: Service metadata: