Skip to content

Commit b43b22d

Browse files
authored
Call me pooler, not pool (zalando#883)
* rename pooler parts and add example to manifest * update codegen * fix manifest and add more details to docs * reflect renaming also in e2e tests
1 parent e6eb10d commit b43b22d

35 files changed

+651
-633
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ pipelines with no access to Kubernetes directly.
1717

1818
* Rolling updates on Postgres cluster changes
1919
* Volume resize without Pod restarts
20+
* Database connection pooler
2021
* Cloning Postgres clusters
21-
* Logical Backups to S3 Bucket
22+
* Logical backups to S3 Bucket
2223
* Standby cluster from S3 WAL archive
2324
* Configurable for non-cloud environments
2425
* UI to create and edit Postgres cluster manifests

charts/postgres-operator/crds/operatorconfigurations.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -318,44 +318,44 @@ spec:
318318
pattern: '^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$'
319319
scalyr_server_url:
320320
type: string
321-
connection_pool:
321+
connection_pooler:
322322
type: object
323323
properties:
324-
connection_pool_schema:
324+
connection_pooler_schema:
325325
type: string
326326
#default: "pooler"
327-
connection_pool_user:
327+
connection_pooler_user:
328328
type: string
329329
#default: "pooler"
330-
connection_pool_image:
330+
connection_pooler_image:
331331
type: string
332332
#default: "registry.opensource.zalan.do/acid/pgbouncer"
333-
connection_pool_max_db_connections:
333+
connection_pooler_max_db_connections:
334334
type: integer
335335
#default: 60
336-
connection_pool_mode:
336+
connection_pooler_mode:
337337
type: string
338338
enum:
339339
- "session"
340340
- "transaction"
341341
#default: "transaction"
342-
connection_pool_number_of_instances:
342+
connection_pooler_number_of_instances:
343343
type: integer
344344
minimum: 2
345345
#default: 2
346-
connection_pool_default_cpu_limit:
346+
connection_pooler_default_cpu_limit:
347347
type: string
348348
pattern: '^(\d+m|\d+(\.\d{1,3})?)$'
349349
#default: "1"
350-
connection_pool_default_cpu_request:
350+
connection_pooler_default_cpu_request:
351351
type: string
352352
pattern: '^(\d+m|\d+(\.\d{1,3})?)$'
353353
#default: "500m"
354-
connection_pool_default_memory_limit:
354+
connection_pooler_default_memory_limit:
355355
type: string
356356
pattern: '^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$'
357357
#default: "100Mi"
358-
connection_pool_default_memory_request:
358+
connection_pooler_default_memory_request:
359359
type: string
360360
pattern: '^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$'
361361
#default: "100Mi"

charts/postgres-operator/crds/postgresqls.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ spec:
106106
uid:
107107
format: uuid
108108
type: string
109-
connectionPool:
109+
connectionPooler:
110110
type: object
111111
properties:
112112
dockerImage:
@@ -162,7 +162,7 @@ spec:
162162
# Note: usernames specified here as database owners must be declared in the users key of the spec key.
163163
dockerImage:
164164
type: string
165-
enableConnectionPool:
165+
enableConnectionPooler:
166166
type: boolean
167167
enableLogicalBackup:
168168
type: boolean

charts/postgres-operator/templates/configmap.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ data:
2020
{{ toYaml .Values.configDebug | indent 2 }}
2121
{{ toYaml .Values.configLoggingRestApi | indent 2 }}
2222
{{ toYaml .Values.configTeamsApi | indent 2 }}
23-
{{ toYaml .Values.configConnectionPool | indent 2 }}
23+
{{ toYaml .Values.configConnectionPooler | indent 2 }}
2424
{{- end }}

charts/postgres-operator/templates/operatorconfiguration.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ configuration:
3434
{{ toYaml .Values.configLoggingRestApi | indent 4 }}
3535
scalyr:
3636
{{ toYaml .Values.configScalyr | indent 4 }}
37-
connection_pool:
38-
{{ toYaml .Values.configConnectionPool | indent 4 }}
37+
connection_pooler:
38+
{{ toYaml .Values.configConnectionPooler | indent 4 }}
3939
{{- end }}

charts/postgres-operator/values-crd.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -267,24 +267,24 @@ configScalyr:
267267
# Memory request value for the Scalyr sidecar
268268
scalyr_memory_request: 50Mi
269269

270-
configConnectionPool:
270+
configConnectionPooler:
271271
# db schema to install lookup function into
272-
connection_pool_schema: "pooler"
272+
connection_pooler_schema: "pooler"
273273
# db user for pooler to use
274-
connection_pool_user: "pooler"
274+
connection_pooler_user: "pooler"
275275
# docker image
276-
connection_pool_image: "registry.opensource.zalan.do/acid/pgbouncer"
276+
connection_pooler_image: "registry.opensource.zalan.do/acid/pgbouncer"
277277
# max db connections the pooler should hold
278-
connection_pool_max_db_connections: 60
278+
connection_pooler_max_db_connections: 60
279279
# default pooling mode
280-
connection_pool_mode: "transaction"
280+
connection_pooler_mode: "transaction"
281281
# number of pooler instances
282-
connection_pool_number_of_instances: 2
282+
connection_pooler_number_of_instances: 2
283283
# default resources
284-
connection_pool_default_cpu_request: 500m
285-
connection_pool_default_memory_request: 100Mi
286-
connection_pool_default_cpu_limit: "1"
287-
connection_pool_default_memory_limit: 100Mi
284+
connection_pooler_default_cpu_request: 500m
285+
connection_pooler_default_memory_request: 100Mi
286+
connection_pooler_default_cpu_limit: "1"
287+
connection_pooler_default_memory_limit: 100Mi
288288

289289
rbac:
290290
# Specifies whether RBAC resources should be created

charts/postgres-operator/values.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -244,24 +244,24 @@ configTeamsApi:
244244
# teams_api_url: http://fake-teams-api.default.svc.cluster.local
245245

246246
# configure connection pooler deployment created by the operator
247-
configConnectionPool:
247+
configConnectionPooler:
248248
# db schema to install lookup function into
249-
connection_pool_schema: "pooler"
249+
connection_pooler_schema: "pooler"
250250
# db user for pooler to use
251-
connection_pool_user: "pooler"
251+
connection_pooler_user: "pooler"
252252
# docker image
253-
connection_pool_image: "registry.opensource.zalan.do/acid/pgbouncer"
253+
connection_pooler_image: "registry.opensource.zalan.do/acid/pgbouncer"
254254
# max db connections the pooler should hold
255-
connection_pool_max_db_connections: 60
255+
connection_pooler_max_db_connections: 60
256256
# default pooling mode
257-
connection_pool_mode: "transaction"
257+
connection_pooler_mode: "transaction"
258258
# number of pooler instances
259-
connection_pool_number_of_instances: 2
259+
connection_pooler_number_of_instances: 2
260260
# default resources
261-
connection_pool_default_cpu_request: 500m
262-
connection_pool_default_memory_request: 100Mi
263-
connection_pool_default_cpu_limit: "1"
264-
connection_pool_default_memory_limit: 100Mi
261+
connection_pooler_default_cpu_request: 500m
262+
connection_pooler_default_memory_request: 100Mi
263+
connection_pooler_default_cpu_limit: "1"
264+
connection_pooler_default_memory_limit: 100Mi
265265

266266
rbac:
267267
# Specifies whether RBAC resources should be created

docs/reference/cluster_manifest.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,10 @@ These parameters are grouped directly under the `spec` key in the manifest.
140140
is `false`, then no volume will be mounted no matter how operator was
141141
configured (so you can override the operator configuration). Optional.
142142

143-
* **enableConnectionPool**
144-
Tells the operator to create a connection pool with a database. If this
145-
field is true, a connection pool deployment will be created even if
146-
`connectionPool` section is empty. Optional, not set by default.
143+
* **enableConnectionPooler**
144+
Tells the operator to create a connection pooler with a database. If this
145+
field is true, a connection pooler deployment will be created even if
146+
`connectionPooler` section is empty. Optional, not set by default.
147147

148148
* **enableLogicalBackup**
149149
Determines if the logical backup of this cluster should be taken and uploaded
@@ -365,34 +365,34 @@ CPU and memory limits for the sidecar container.
365365
memory limits for the sidecar container. Optional, overrides the
366366
`default_memory_limits` operator configuration parameter. Optional.
367367

368-
## Connection pool
368+
## Connection pooler
369369

370-
Parameters are grouped under the `connectionPool` top-level key and specify
371-
configuration for connection pool. If this section is not empty, a connection
372-
pool will be created for a database even if `enableConnectionPool` is not
370+
Parameters are grouped under the `connectionPooler` top-level key and specify
371+
configuration for connection pooler. If this section is not empty, a connection
372+
pooler will be created for a database even if `enableConnectionPooler` is not
373373
present.
374374

375375
* **numberOfInstances**
376-
How many instances of connection pool to create.
376+
How many instances of connection pooler to create.
377377

378378
* **schema**
379379
Schema to create for credentials lookup function.
380380

381381
* **user**
382-
User to create for connection pool to be able to connect to a database.
382+
User to create for connection pooler to be able to connect to a database.
383383

384384
* **dockerImage**
385-
Which docker image to use for connection pool deployment.
385+
Which docker image to use for connection pooler deployment.
386386

387387
* **maxDBConnections**
388388
How many connections the pooler can max hold. This value is divided among the
389389
pooler pods.
390390

391391
* **mode**
392-
In which mode to run connection pool, transaction or session.
392+
In which mode to run connection pooler, transaction or session.
393393

394394
* **resources**
395-
Resource configuration for connection pool deployment.
395+
Resource configuration for connection pooler deployment.
396396

397397
## Custom TLS certificates
398398

docs/reference/operator_parameters.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -597,39 +597,39 @@ scalyr sidecar. In the CRD-based configuration they are grouped under the
597597
* **scalyr_memory_limit**
598598
Memory limit value for the Scalyr sidecar. The default is `500Mi`.
599599

600-
## Connection pool configuration
600+
## Connection pooler configuration
601601

602-
Parameters are grouped under the `connection_pool` top-level key and specify
603-
default configuration for connection pool, if a postgres manifest requests it
602+
Parameters are grouped under the `connection_pooler` top-level key and specify
603+
default configuration for connection pooler, if a postgres manifest requests it
604604
but do not specify some of the parameters. All of them are optional with the
605605
operator being able to provide some reasonable defaults.
606606

607-
* **connection_pool_number_of_instances**
608-
How many instances of connection pool to create. Default is 2 which is also
607+
* **connection_pooler_number_of_instances**
608+
How many instances of connection pooler to create. Default is 2 which is also
609609
the required minimum.
610610

611-
* **connection_pool_schema**
611+
* **connection_pooler_schema**
612612
Schema to create for credentials lookup function. Default is `pooler`.
613613

614-
* **connection_pool_user**
615-
User to create for connection pool to be able to connect to a database.
614+
* **connection_pooler_user**
615+
User to create for connection pooler to be able to connect to a database.
616616
Default is `pooler`.
617617

618-
* **connection_pool_image**
619-
Docker image to use for connection pool deployment.
618+
* **connection_pooler_image**
619+
Docker image to use for connection pooler deployment.
620620
Default: "registry.opensource.zalan.do/acid/pgbouncer"
621621

622-
* **connection_pool_max_db_connections**
622+
* **connection_pooler_max_db_connections**
623623
How many connections the pooler can max hold. This value is divided among the
624624
pooler pods. Default is 60 which will make up 30 connections per pod for the
625625
default setup with two instances.
626626

627-
* **connection_pool_mode**
628-
Default pool mode, `session` or `transaction`. Default is `transaction`.
627+
* **connection_pooler_mode**
628+
Default pooler mode, `session` or `transaction`. Default is `transaction`.
629629

630-
* **connection_pool_default_cpu_request**
631-
**connection_pool_default_memory_reques**
632-
**connection_pool_default_cpu_limit**
633-
**connection_pool_default_memory_limit**
634-
Default resource configuration for connection pool deployment. The internal
630+
* **connection_pooler_default_cpu_request**
631+
**connection_pooler_default_memory_reques**
632+
**connection_pooler_default_cpu_limit**
633+
**connection_pooler_default_memory_limit**
634+
Default resource configuration for connection pooler deployment. The internal
635635
default for memory request and limit is `100Mi`, for CPU it is `500m` and `1`.

docs/user.md

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -512,39 +512,38 @@ monitoring is outside the scope of operator responsibilities. See
512512
[administrator documentation](administrator.md) for details on how backups are
513513
executed.
514514

515-
## Connection pool
515+
## Connection pooler
516516

517-
The operator can create a database side connection pool for those applications,
518-
where an application side pool is not feasible, but a number of connections is
519-
high. To create a connection pool together with a database, modify the
517+
The operator can create a database side connection pooler for those applications
518+
where an application side pooler is not feasible, but a number of connections is
519+
high. To create a connection pooler together with a database, modify the
520520
manifest:
521521

522522
```yaml
523523
spec:
524-
enableConnectionPool: true
524+
enableConnectionPooler: true
525525
```
526526

527-
This will tell the operator to create a connection pool with default
527+
This will tell the operator to create a connection pooler with default
528528
configuration, through which one can access the master via a separate service
529-
`{cluster-name}-pooler`. In most of the cases provided default configuration
530-
should be good enough.
531-
532-
To configure a new connection pool, specify:
529+
`{cluster-name}-pooler`. In most of the cases the
530+
[default configuration](reference/operator_parameters.md#connection-pool-configuration)
531+
should be good enough. To configure a new connection pooler individually for
532+
each Postgres cluster, specify:
533533

534534
```
535535
spec:
536-
connectionPool:
537-
# how many instances of connection pool to create
538-
number_of_instances: 2
536+
connectionPooler:
537+
# how many instances of connection pooler to create
538+
numberOfInstances: 2
539539
540540
# in which mode to run, session or transaction
541541
mode: "transaction"
542542
543-
# schema, which operator will create to install credentials lookup
544-
# function
543+
# schema, which operator will create to install credentials lookup function
545544
schema: "pooler"
546545
547-
# user, which operator will create for connection pool
546+
# user, which operator will create for connection pooler
548547
user: "pooler"
549548
550549
# resources for each instance
@@ -557,13 +556,17 @@ spec:
557556
memory: 100Mi
558557
```
559558

560-
By default `pgbouncer` is used to create a connection pool. To find out about
561-
pool modes see [docs](https://www.pgbouncer.org/config.html#pool_mode) (but it
562-
should be general approach between different implementation).
559+
The `enableConnectionPooler` flag is not required when the `connectionPooler`
560+
section is present in the manifest. But, it can be used to disable/remove the
561+
pooler while keeping its configuration.
562+
563+
By default, `pgbouncer` is used as connection pooler. To find out about pooler
564+
modes read the `pgbouncer` [docs](https://www.pgbouncer.org/config.html#pooler_mode)
565+
(but it should be the general approach between different implementation).
563566

564-
Note, that using `pgbouncer` means meaningful resource CPU limit should be less
565-
than 1 core (there is a way to utilize more than one, but in K8S it's easier
566-
just to spin up more instances).
567+
Note, that using `pgbouncer` a meaningful resource CPU limit should be 1 core
568+
or less (there is a way to utilize more than one, but in K8s it's easier just to
569+
spin up more instances).
567570

568571
## Custom TLS certificates
569572

0 commit comments

Comments
 (0)