Skip to content

Commit

Permalink
Update pgbouncer doc quickstart and concepts/pgbouncer
Browse files Browse the repository at this point in the history
Signed-off-by: MobarakHsn <[email protected]>
  • Loading branch information
MobarakHsn committed Oct 12, 2023
1 parent 0c16ba2 commit 58169df
Showing 1 changed file with 3 additions and 28 deletions.
31 changes: 3 additions & 28 deletions docs/guides/pgbouncer/concepts/pgbouncer.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,28 +33,17 @@ metadata:
name: pgbouncer-server
namespace: demo
spec:
version: "1.17.0"
version: "1.18.0"
replicas: 2
databases:
- alias: "postgres"
databaseName: "postgres"
databaseRef:
name: "quick-postgres"
namespace: demo
authSecretRef:
name: "one-specific-user"
- alias: "tmpdb"
databaseName: "mydb"
databaseRef:
name: "quick-postgres"
namespace: demo
connectionPool:
maxClientConnections: 20
reservePoolSize: 5
adminUsers:
- admin
userListSecretRef:
name: db-user-pass
monitor:
agent: prometheus.io/operator
prometheus:
Expand All @@ -68,7 +57,7 @@ spec:
`spec.version` is a required field that specifies the name of the [PgBouncerVersion](/docs/guides/pgbouncer/concepts/catalog.md) crd where the docker images are specified. Currently, when you install KubeDB, it creates the following `PgBouncerVersion` resources,

- `1.17.0`
- `1.18.0`

### spec.replicas

Expand All @@ -81,15 +70,10 @@ spec:
- `spec.databases.alias`: specifies an alias for the target database located in a postgres server specified by an appbinding.
- `spec.databases.databaseName`: specifies the name of the target database.
- `spec.databases.databaseRef`: specifies the name and namespace of the AppBinding that contains the path to a PostgreSQL server where the target database can be found.
- `spec.databases.databaseSecretRef` (optional): points to a secret that contains the credentials (username and password) of an existing user of this database. It is used to bind a single user to this specific database connection..

ConnectionPool is used to configure pgbouncer connection-pool. All the fields here are accompanied by default values and can be left unspecified if no customisation is required by the user.

- `spec.connectionPool.listenPort`: specifies the port on which pgbouncer should listen to connect with clients. The default is 5432.

- `spec.connectionPool.listenAddress`: specifies the adress from which pgbouncer should allow client connection from. The default is `*` (all addresses).

- `spec.connectionPool.adminUsers`: specifies the values of admin_users. Comma seperated names of admin users are listed here.
- `spec.connectionPool.port`: specifies the port on which pgbouncer should listen to connect with clients. The default is 5432.

- `spec.connectionPool.poolMode`: specifies the value of pool_mode. Specifies when a server connection can be reused by other clients.

Expand Down Expand Up @@ -151,17 +135,8 @@ ConnectionPool is used to configure pgbouncer connection-pool. All the fields he

- `spec.connectionPool.authType`: specifies how to authenticate users. PgBouncer supports several authentication methods including pam, md5, scram-sha-256, trust , or any. However hba, and cert are not supported.

- `spec.connectionPool.authUser`: looks up any user not specified in auth_file from pg_shadow.
Default: not set.

- `spec.connectionPool.IgnoreStartupParameters`: specifies comma-separated startup parameters that pgbouncer knows are handled by admin and it can ignore them.

### spec.userListSecretRef:

UserList field is used to specify a secret that contains the list of authorised users along with their passwords. Basically this secret is created from the standard pgbouncer userlist file.

- `spec.userList.userListSecretRef.name`: specifies the name of the secret containing userlist. Has to be created in the same namespace as the PgBouncer crd.

### spec.monitor

PgBouncer managed by KubeDB can be monitored with builtin-Prometheus and Prometheus operator out-of-the-box. To learn more,
Expand Down

0 comments on commit 58169df

Please sign in to comment.