From a9854d4c026bec03f96850cd429c4f2770a5096d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=C3=ADel=20P=2E=20Purkh=C3=BAs?= Date: Mon, 26 May 2025 11:50:17 +0000 Subject: [PATCH 1/2] Allow usage of HPAs ## What? Remove the default replica values of `1` since that clashes with the usage of HPAs. Instead default to not setting `replicas`, which by default is `1`. --- charts/temporal/templates/server-deployment.yaml | 6 +++++- charts/temporal/templates/web-deployment.yaml | 2 ++ charts/temporal/values.yaml | 3 --- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/charts/temporal/templates/server-deployment.yaml b/charts/temporal/templates/server-deployment.yaml index 97a38f927..6b8f1d2a2 100644 --- a/charts/temporal/templates/server-deployment.yaml +++ b/charts/temporal/templates/server-deployment.yaml @@ -12,7 +12,11 @@ metadata: labels: {{- include "temporal.resourceLabels" (list $ $service "deployment") | nindent 4 }} spec: - replicas: {{ default $.Values.server.replicaCount $serviceValues.replicaCount }} + {{- if $serviceValues.replicaCount }} + replicas: {{ default $serviceValues.replicaCount }} + {{- else if $.Values.server.replicaCount }} + replicas: {{ default $.Values.server.replicaCount }} + {{- end }} selector: matchLabels: app.kubernetes.io/name: {{ include "temporal.name" $ }} diff --git a/charts/temporal/templates/web-deployment.yaml b/charts/temporal/templates/web-deployment.yaml index f1530c2b4..54af0d3c5 100644 --- a/charts/temporal/templates/web-deployment.yaml +++ b/charts/temporal/templates/web-deployment.yaml @@ -8,7 +8,9 @@ metadata: labels: {{- include "temporal.resourceLabels" (list $ "web" "deployment") | nindent 4 }} spec: + {{- if .Values.web.replicaCount }} replicas: {{ .Values.web.replicaCount }} + {{- end }} selector: matchLabels: app.kubernetes.io/name: {{ include "temporal.name" $ }} diff --git a/charts/temporal/values.yaml b/charts/temporal/values.yaml index d98a5ced0..7078ddf94 100644 --- a/charts/temporal/values.yaml +++ b/charts/temporal/values.yaml @@ -22,8 +22,6 @@ server: repository: temporalio/server tag: 1.27.2 pullPolicy: IfNotPresent - # Global default settings (can be overridden per service) - replicaCount: 1 metrics: # Annotate pods directly with Prometheus annotations. # Use this if you installed Prometheus from a Helm chart. @@ -378,7 +376,6 @@ admintools: web: # additionalInitContainers: [] enabled: true - replicaCount: 1 image: repository: temporalio/ui tag: 2.37.1 From d5aeef31b0d4dd1c04af507ddb17a003416d7e94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=C3=ADel=20P=2E=20Purkh=C3=BAs?= Date: Mon, 9 Feb 2026 14:39:40 +0000 Subject: [PATCH 2/2] Test --- .../tests/server_deployment_test.yaml | 19 ++++++++++++++++--- charts/temporal/values.yaml | 1 + 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/charts/temporal/tests/server_deployment_test.yaml b/charts/temporal/tests/server_deployment_test.yaml index fc66a06bb..b3e13e2ef 100644 --- a/charts/temporal/tests/server_deployment_test.yaml +++ b/charts/temporal/tests/server_deployment_test.yaml @@ -45,6 +45,19 @@ tests: - equal: path: spec.replicas value: 3 + - it: omits replica count when neither service specific nor service wide is set + template: templates/server-deployment.yaml + documentSelector: + path: metadata.name + value: RELEASE-NAME-temporal-frontend + set: + server: + replicaCount: null + frontend: + replicaCount: null + asserts: + - notExists: + path: spec.replicas - it: defaults to service wide resources template: templates/server-deployment.yaml documentSelector: @@ -310,9 +323,9 @@ tests: server: history: readinessProbe: - initialDelaySeconds: 300 - tcpSocket: - port: rpc + initialDelaySeconds: 300 + tcpSocket: + port: rpc asserts: - equal: path: spec.template.spec.containers[0].readinessProbe.initialDelaySeconds diff --git a/charts/temporal/values.yaml b/charts/temporal/values.yaml index 3fb667696..6644a6ba6 100644 --- a/charts/temporal/values.yaml +++ b/charts/temporal/values.yaml @@ -440,6 +440,7 @@ admintools: web: # additionalInitContainers: [] enabled: true + # replicaCount: 1 image: repository: temporalio/ui tag: 2.42.1