diff --git a/charts/postgres-operator/values-crd.yaml b/charts/postgres-operator/values-crd.yaml index 0232000f0..187e9df9a 100644 --- a/charts/postgres-operator/values-crd.yaml +++ b/charts/postgres-operator/values-crd.yaml @@ -264,16 +264,18 @@ configScalyr: scalyr_memory_request: 50Mi configConnectionPool: - # number of pooler instances - connection_pool_number_of_instances: 1 # db schema to install lookup function into connection_pool_schema: "pooler" # db user for pooler to use connection_pool_user: "pooler" # docker image connection_pool_image: "registry.opensource.zalan.do/acid/pgbouncer" + # max db connections the pooler should hold + connection_pool_max_db_connections: 60 # default pooling mode connection_pool_mode: "transaction" + # number of pooler instances + connection_pool_number_of_instances: 1 # default resources connection_pool_default_cpu_request: "100m" connection_pool_default_memory_request: "100Mi" diff --git a/charts/postgres-operator/values.yaml b/charts/postgres-operator/values.yaml index e0b30f137..3a7c580fd 100644 --- a/charts/postgres-operator/values.yaml +++ b/charts/postgres-operator/values.yaml @@ -241,16 +241,18 @@ configTeamsApi: # configure connection pooler deployment created by the operator configConnectionPool: - # number of pooler instances - connection_pool_number_of_instances: 1 # db schema to install lookup function into connection_pool_schema: "pooler" # db user for pooler to use connection_pool_user: "pooler" # docker image connection_pool_image: "registry.opensource.zalan.do/acid/pgbouncer" + # max db connections the pooler should hold + connection_pool_max_db_connections: 60 # default pooling mode connection_pool_mode: "transaction" + # number of pooler instances + connection_pool_number_of_instances: 1 # default resources connection_pool_default_cpu_request: "100m" connection_pool_default_memory_request: "100Mi" diff --git a/docs/reference/cluster_manifest.md b/docs/reference/cluster_manifest.md index a66cc169d..ec79cf751 100644 --- a/docs/reference/cluster_manifest.md +++ b/docs/reference/cluster_manifest.md @@ -140,6 +140,11 @@ These parameters are grouped directly under the `spec` key in the manifest. is `false`, then no volume will be mounted no matter how operator was configured (so you can override the operator configuration). Optional. +* **enableConnectionPool** + Tells the operator to create a connection pool with a database. If this + field is true, a connection pool deployment will be created even if + `connectionPool` section is empty. Optional, not set by default. + * **enableLogicalBackup** Determines if the logical backup of this cluster should be taken and uploaded to S3. Default: false. Optional. @@ -149,11 +154,6 @@ These parameters are grouped directly under the `spec` key in the manifest. [the reference schedule format](https://kubernetes.io/docs/tasks/job/automated-tasks-with-cron-jobs/#schedule) into account. Optional. Default is: "30 00 \* \* \*" -* enableConnectionPool - Tells the operator to create a connection pool with a database. If this - field is true, a connection pool deployment will be created even if - `connectionPool` section is empty. Optional, not set by default. - ## Postgres parameters Those parameters are grouped under the `postgresql` top-level key, which is @@ -375,9 +375,6 @@ present. * **numberOfInstances** How many instances of connection pool to create. -* **mode** - In which mode to run connection pool, transaction or session. - * **schema** Schema to create for credentials lookup function. @@ -387,5 +384,11 @@ present. * **dockerImage** Which docker image to use for connection pool deployment. +* **maxDBConnections** + How many connections the pooler can max hold. + +* **mode** + In which mode to run connection pool, transaction or session. + * **resources** Resource configuration for connection pool deployment. diff --git a/docs/reference/operator_parameters.md b/docs/reference/operator_parameters.md index 1e8e1a890..a24d5f2f3 100644 --- a/docs/reference/operator_parameters.md +++ b/docs/reference/operator_parameters.md @@ -613,6 +613,9 @@ operator being able to provide some reasonable defaults. * **connection_pool_image** Docker image to use for connection pool deployment. +* **connection_pool_max_db_connections** + How many connections the pooler can max hold. + * **connection_pool_mode** Default pool mode, session or transaction. diff --git a/manifests/configmap.yaml b/manifests/configmap.yaml index f1c5446b0..a72bb6b73 100644 --- a/manifests/configmap.yaml +++ b/manifests/configmap.yaml @@ -16,8 +16,9 @@ data: # connection_pool_default_memory_limit: 100m # connection_pool_default_memory_request: "100Mi" connection_pool_image: "registry.opensource.zalan.do/acid/pgbouncer:master-5" - # connection_pool_number_of_instances: 1 + # connection_pool_max_db_connections: 60 # connection_pool_mode: "transaction" + # connection_pool_number_of_instances: 1 # connection_pool_schema: "pooler" # connection_pool_user: "pooler" # custom_service_annotations: "keyx:valuez,keya:valuea" diff --git a/manifests/postgresql-operator-default-configuration.yaml b/manifests/postgresql-operator-default-configuration.yaml index 5bc20eae3..bd1ed6622 100644 --- a/manifests/postgresql-operator-default-configuration.yaml +++ b/manifests/postgresql-operator-default-configuration.yaml @@ -127,7 +127,8 @@ configuration: connection_pool_default_memory_limit: 100m connection_pool_default_memory_request: "100Mi" connection_pool_image: "registry.opensource.zalan.do/acid/pgbouncer:master-5" - connection_pool_number_of_instances: 1 + # connection_pool_max_db_connections: 60 connection_pool_mode: "transaction" + connection_pool_number_of_instances: 1 # connection_pool_schema: "pooler" # connection_pool_user: "pooler" diff --git a/pkg/controller/operator_config.go b/pkg/controller/operator_config.go index e775b3336..2e0c9f0a8 100644 --- a/pkg/controller/operator_config.go +++ b/pkg/controller/operator_config.go @@ -168,7 +168,7 @@ func (c *Controller) importConfigurationFromCRD(fromCRD *acidv1.OperatorConfigur result.ConnectionPool.Image = util.Coalesce( fromCRD.ConnectionPool.Image, - "pgbouncer:0.0.1") + "registry.opensource.zalan.do/acid/pgbouncer:master-5") result.ConnectionPool.Mode = util.Coalesce( fromCRD.ConnectionPool.Mode,