From b0f534776d5734c8c15a5e49459f9a497ea8dbf4 Mon Sep 17 00:00:00 2001 From: Felix Kunde Date: Fri, 20 Mar 2020 15:56:27 +0100 Subject: [PATCH] update pooler default image and add explanation for maxDBConnections param --- charts/postgres-operator/crds/operatorconfigurations.yaml | 2 +- docs/reference/cluster_manifest.md | 3 ++- docs/reference/operator_parameters.md | 6 ++++-- manifests/operatorconfiguration.crd.yaml | 2 +- pkg/controller/operator_config.go | 2 +- pkg/util/config/config.go | 2 +- 6 files changed, 10 insertions(+), 7 deletions(-) diff --git a/charts/postgres-operator/crds/operatorconfigurations.yaml b/charts/postgres-operator/crds/operatorconfigurations.yaml index 5fadae356..6c61bfac8 100644 --- a/charts/postgres-operator/crds/operatorconfigurations.yaml +++ b/charts/postgres-operator/crds/operatorconfigurations.yaml @@ -329,7 +329,7 @@ spec: #default: "pooler" connection_pool_image: type: string - #default: "registry.opensource.zalan.do/acid/pgbouncer:master-5" + #default: "registry.opensource.zalan.do/acid/pgbouncer" connection_pool_max_db_connections: type: integer #default: 60 diff --git a/docs/reference/cluster_manifest.md b/docs/reference/cluster_manifest.md index 34fdd3b70..704a29e99 100644 --- a/docs/reference/cluster_manifest.md +++ b/docs/reference/cluster_manifest.md @@ -385,7 +385,8 @@ present. Which docker image to use for connection pool deployment. * **maxDBConnections** - How many connections the pooler can max hold. + How many connections the pooler can max hold. This value is divided by the + number of pooler pods. * **mode** In which mode to run connection pool, transaction or session. diff --git a/docs/reference/operator_parameters.md b/docs/reference/operator_parameters.md index 0309d6b68..030ec4f1e 100644 --- a/docs/reference/operator_parameters.md +++ b/docs/reference/operator_parameters.md @@ -616,10 +616,12 @@ operator being able to provide some reasonable defaults. * **connection_pool_image** Docker image to use for connection pool deployment. - Default: "registry.opensource.zalan.do/acid/pgbouncer:master-5" + Default: "registry.opensource.zalan.do/acid/pgbouncer" * **connection_pool_max_db_connections** - How many connections the pooler can max hold. Default is 60. + How many connections the pooler can max hold. This value is divided by the + number of pooler pods. Default is 60 which will make up 30 connections per + pod for the default setup with two instances. * **connection_pool_mode** Default pool mode, `session` or `transaction`. Default is `transaction`. diff --git a/manifests/operatorconfiguration.crd.yaml b/manifests/operatorconfiguration.crd.yaml index 4b2b977db..2b3c2bf09 100644 --- a/manifests/operatorconfiguration.crd.yaml +++ b/manifests/operatorconfiguration.crd.yaml @@ -305,7 +305,7 @@ spec: #default: "pooler" connection_pool_image: type: string - #default: "registry.opensource.zalan.do/acid/pgbouncer:master-5" + #default: "registry.opensource.zalan.do/acid/pgbouncer" connection_pool_max_db_connections: type: integer #default: 60 diff --git a/pkg/controller/operator_config.go b/pkg/controller/operator_config.go index 3c5bba82f..970eef701 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, - "registry.opensource.zalan.do/acid/pgbouncer:master-5") + "registry.opensource.zalan.do/acid/pgbouncer") result.ConnectionPool.Mode = util.Coalesce( fromCRD.ConnectionPool.Mode, diff --git a/pkg/util/config/config.go b/pkg/util/config/config.go index 3f8b5b9d5..73a0d9655 100644 --- a/pkg/util/config/config.go +++ b/pkg/util/config/config.go @@ -89,7 +89,7 @@ type ConnectionPool struct { NumberOfInstances *int32 `name:"connection_pool_number_of_instances" default:"2"` Schema string `name:"connection_pool_schema" default:"pooler"` User string `name:"connection_pool_user" default:"pooler"` - Image string `name:"connection_pool_image" default:"registry.opensource.zalan.do/acid/pgbouncer:master-5"` + Image string `name:"connection_pool_image" default:"registry.opensource.zalan.do/acid/pgbouncer"` Mode string `name:"connection_pool_mode" default:"transaction"` MaxDBConnections *int32 `name:"connection_pool_max_db_connections" default:"60"` ConnPoolDefaultCPURequest string `name:"connection_pool_default_cpu_request" default:"1"`