Skip to content

Commit

Permalink
feat: add pgbouncer.authType value
Browse files Browse the repository at this point in the history
Signed-off-by: Mathew Wicks <thesuperzapper@users.noreply.github.com>
  • Loading branch information
thesuperzapper committed Jan 10, 2022
1 parent 5c2ac6a commit e3186bf
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
15 changes: 14 additions & 1 deletion charts/airflow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1086,10 +1086,22 @@ redis:

> 🟨 __Note__ 🟨
>
> If `pgbouncer.enabled=true` (the default), we will deploy [PgBouncer](https://www.pgbouncer.org/) to pool connections to your external database
> By default default, we deploy a [PgBouncer](https://www.pgbouncer.org/) instance to pool connections to your external Postgres database.
>
> If using Azure PostgreSQL, you must set `pgbouncer.authType = scram-sha-256` and `pgbouncer.serverSSL.mode = verify-ca`.
Example values for an external Postgres database, with an existing `airflow_cluster1` database:
```yaml
pgbouncer:
enabled: true

# WARNING: you must set "scram-sha-256" if using Azure PostgreSQL (single server mode)
authType: md5

serverSSL:
# WARNING: you must set "verify-ca" if using Azure PostgreSQL
mode: prefer

postgresql:
enabled: false

Expand Down Expand Up @@ -1688,6 +1700,7 @@ Parameter | Description | Default
`pgbouncer.podDisruptionBudget.*` | configs for the PodDisruptionBudget of the pgbouncer | `<see values.yaml>`
`pgbouncer.livenessProbe.*` | configs for the pgbouncer Pods' liveness probe | `<see values.yaml>`
`pgbouncer.terminationGracePeriodSeconds` | the maximum number of seconds to wait for queries upon pod termination, before force killing | `120`
`pgbouncer.authType` | sets pgbouncer config: `auth_type` | `md5`
`pgbouncer.maxClientConnections` | sets pgbouncer config: `max_client_conn` | `100`
`pgbouncer.poolSize` | sets pgbouncer config: `default_pool_size` | `20`
`pgbouncer.logDisconnections` | sets pgbouncer config: `log_disconnections` | `0`
Expand Down
2 changes: 1 addition & 1 deletion charts/airflow/templates/pgbouncer/_helpers/pgbouncer.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ignore_startup_parameters = extra_float_digits
listen_port = 6432
listen_addr = *

auth_type = md5
auth_type = {{ .Values.pgbouncer.authType }}
auth_file = /home/pgbouncer/users.txt

log_disconnections = {{ .Values.pgbouncer.logDisconnections }}
Expand Down
4 changes: 4 additions & 0 deletions charts/airflow/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1445,6 +1445,10 @@ pgbouncer:
##
terminationGracePeriodSeconds: 120

## sets pgbouncer config: `auth_type`
##
authType: md5

## sets pgbouncer config: `max_client_conn`
##
maxClientConnections: 100
Expand Down

0 comments on commit e3186bf

Please sign in to comment.