Skip to content

Commit 4fb75b2

Browse files
authored
feat: variable postgresql connection pools (#265)
* feat: make workflow db pool configurable * simplify * bump semver
1 parent 0581f0e commit 4fb75b2

File tree

5 files changed

+26
-3
lines changed

5 files changed

+26
-3
lines changed

charts/retool/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: retool
33
description: A Helm chart for Kubernetes
44
type: application
5-
version: 6.8.9
5+
version: 6.9.0
66
maintainers:
77
- name: Retool Engineering
88

charts/retool/templates/_workers.tpl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@
2929
{{- $workerValues = $parentValues.evalWorker -}}
3030
{{- end -}}
3131

32+
{{- $workerPoolMaxSize := 100 -}}
33+
{{- if $workerValues }}
34+
{{- if $workerValues.postgresPoolMaxSize }}
35+
{{- $workerPoolMaxSize = $workerValues.postgresPoolMaxSize }}
36+
{{- end }}
37+
{{- end -}}
38+
3239
{{- $healthcheckPort := ternary 3012 3005 (eq $workerType "agentEval") -}}
3340
{{- $serviceType := ternary "AGENT_EVAL_TEMPORAL_WORKER" "WORKFLOW_TEMPORAL_WORKER" (eq $workerType "agentEval") -}}
3441
{{- $taskqueue := ternary "agent-eval" (ternary "agent" "" (eq $workerType "agent")) (eq $workerType "agentEval") -}}
@@ -119,7 +126,7 @@ spec:
119126
value: {{ $taskqueue }}
120127
{{- end }}
121128
- name: DBCONNECTOR_POSTGRES_POOL_MAX_SIZE
122-
value: "100"
129+
value: {{ $workerPoolMaxSize | quote }}
123130
{{- if $.Values.dbconnector.enabled }}
124131
- name: DB_CONNECTOR_HOST
125132
value: http://{{ template "retool.fullname" $ }}-dbconnector

charts/retool/templates/deployment_workflows.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,14 @@ spec:
6262
{{- if .Values.commandline.args }}
6363
{{ toYaml .Values.commandline.args | indent 10 }}
6464
{{- end }}
65+
{{- $workflowBackendPoolMaxSize := 100 -}}
66+
{{- with .Values.workflows }}
67+
{{- with .backend }}
68+
{{- if .postgresPoolMaxSize }}
69+
{{- $workflowBackendPoolMaxSize = .postgresPoolMaxSize }}
70+
{{- end }}
71+
{{- end }}
72+
{{- end }}
6573
env:
6674
- name: DEPLOYMENT_TEMPLATE_TYPE
6775
value: {{ template "retool.deploymentTemplateType" . }}
@@ -107,7 +115,7 @@ spec:
107115
value: "true"
108116
{{ end }}
109117
- name: DBCONNECTOR_POSTGRES_POOL_MAX_SIZE
110-
value: "100"
118+
value: {{ $workflowBackendPoolMaxSize | quote }}
111119
- name: DBCONNECTOR_QUERY_TIMEOUT_MS
112120
{{- if .Values.workflows.dbConnectorTimeout }}
113121
value: {{ .Values.workflows.dbConnectorTimeout | quote}}

charts/retool/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,12 +379,16 @@ workflows:
379379
# Scaling this number will increase the number of workflow workers, e.g. a replicaCount of 4
380380
# will launch 9 pods -- 1 workflow backend, 4 workflow workers, and 4 for temporal cluster
381381
replicaCount: 1
382+
# Override the connection pool size used by workflow workers when calling the dbconnector service
383+
postgresPoolMaxSize: 100
382384

383385
backend:
384386
# A replicaCount of 1 will launch 6 pods -- 1 workflow backend, 1 workflow worker, and 4 pods that make up the executor temporal cluster
385387
# Scaling this number will increase the number of workflow backends, e.g. a replicaCount of 4
386388
# will launch 9 pods -- 4 workflow backend, 1 workflow workers, and 4 for temporal cluster
387389
replicaCount: 1
390+
# Override the connection pool size used by workflow backends when calling the dbconnector service
391+
postgresPoolMaxSize: 100
388392

389393
# If necessary, specify the resources to provision the workflows-backend pod separately from the main backend pods.
390394
# resources:

values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,12 +379,16 @@ workflows:
379379
# Scaling this number will increase the number of workflow workers, e.g. a replicaCount of 4
380380
# will launch 9 pods -- 1 workflow backend, 4 workflow workers, and 4 for temporal cluster
381381
replicaCount: 1
382+
# Override the connection pool size used by workflow workers when calling the dbconnector service
383+
postgresPoolMaxSize: 100
382384

383385
backend:
384386
# A replicaCount of 1 will launch 6 pods -- 1 workflow backend, 1 workflow worker, and 4 pods that make up the executor temporal cluster
385387
# Scaling this number will increase the number of workflow backends, e.g. a replicaCount of 4
386388
# will launch 9 pods -- 4 workflow backend, 1 workflow workers, and 4 for temporal cluster
387389
replicaCount: 1
390+
# Override the connection pool size used by workflow backends when calling the dbconnector service
391+
postgresPoolMaxSize: 100
388392

389393
# If necessary, specify the resources to provision the workflows-backend pod separately from the main backend pods.
390394
# resources:

0 commit comments

Comments
 (0)