From 3fbde645db5e1edd83d6481dadb70e61d2de1dca Mon Sep 17 00:00:00 2001 From: Jens Reimann Date: Thu, 28 Nov 2024 09:12:51 +0100 Subject: [PATCH] feat: allow configuring database connection pool limits --- charts/trustify/templates/helpers/_postgres.tpl | 10 ++++++++++ charts/trustify/values.schema.json | 10 ++++++++++ charts/trustify/values.schema.yaml | 10 ++++++++++ 3 files changed, 30 insertions(+) diff --git a/charts/trustify/templates/helpers/_postgres.tpl b/charts/trustify/templates/helpers/_postgres.tpl index 11497f8..3187d27 100644 --- a/charts/trustify/templates/helpers/_postgres.tpl +++ b/charts/trustify/templates/helpers/_postgres.tpl @@ -44,4 +44,14 @@ Arguments (dict): {{- include "trustification.common.requiredEnvVarValue" (dict "value" .database.password "msg" "Missing value for database password" ) | nindent 2 }} - name: {{ .prefix | default "TRUSTD_DB_" }}SSLMODE value: {{ .database.sslMode | default "allow" }} + +{{- with .database.minimumConnections }} +- name: {{ .prefix | default "TRUSTD_DB_" }}MIN_CONN + value: {{ . | quote }} +{{- end }} +{{- with .database.maximumConnections }} +- name: {{ .prefix | default "TRUSTD_DB_" }}MAX_CONN + value: {{ . | quote }} +{{- end }} + {{- end }} diff --git a/charts/trustify/values.schema.json b/charts/trustify/values.schema.json index 863d4f2..843e74c 100644 --- a/charts/trustify/values.schema.json +++ b/charts/trustify/values.schema.json @@ -811,6 +811,16 @@ }, "sslMode": { "$ref": "#/definitions/PostgresSslMode" + }, + "minimumConnections": { + "description": "The minimum number of connections created in the connection pool.\n", + "type": "integer", + "minimum": 0 + }, + "maximumConnections": { + "description": "The maximum number of connections created in the connection pool.\n", + "type": "integer", + "minimum": 1 } } }, diff --git a/charts/trustify/values.schema.yaml b/charts/trustify/values.schema.yaml index a4b32b1..1af43b2 100644 --- a/charts/trustify/values.schema.yaml +++ b/charts/trustify/values.schema.yaml @@ -628,6 +628,16 @@ definitions: $ref: "#/definitions/ValueOrRef" sslMode: $ref: "#/definitions/PostgresSslMode" + minimumConnections: + description: | + The minimum number of connections created in the connection pool. + type: integer + minimum: 0 + maximumConnections: + description: | + The maximum number of connections created in the connection pool. + type: integer + minimum: 1 PostgresSslMode: type: string