From d3eac5fbd58112f41c9c97397ad4a4ac5248e7fa Mon Sep 17 00:00:00 2001 From: Ben Banfield-Zanin Date: Wed, 2 Sep 2026 09:50:40 +0100 Subject: [PATCH] Only run a single Redis Pod --- .../matrix-stack/templates/ess-library/_workloads.tpl | 4 ++++ newsfragments/1557.fixed.md | 1 + tests/manifests/test_pod_replicas.py | 10 ++++++++++ 3 files changed, 15 insertions(+) create mode 100644 newsfragments/1557.fixed.md diff --git a/charts/matrix-stack/templates/ess-library/_workloads.tpl b/charts/matrix-stack/templates/ess-library/_workloads.tpl index 39cf5862..6a810981 100644 --- a/charts/matrix-stack/templates/ess-library/_workloads.tpl +++ b/charts/matrix-stack/templates/ess-library/_workloads.tpl @@ -19,10 +19,14 @@ selector: app.kubernetes.io/instance: {{ $root.Release.Name }}-{{ $nameSuffix }} {{- if eq "Deployment" $kind }} strategy: +{{- if ne "redis" $nameSuffix }} type: RollingUpdate rollingUpdate: maxSurge: 2 maxUnavailable: {{ min (max 0 (sub .replicas 1)) 1 }} +{{- else }} + type: Recreate +{{- end }} {{- else }} serviceName: {{ $root.Release.Name }}-{{ $serviceNameSuffix }} updateStrategy: diff --git a/newsfragments/1557.fixed.md b/newsfragments/1557.fixed.md new file mode 100644 index 00000000..7be4aed8 --- /dev/null +++ b/newsfragments/1557.fixed.md @@ -0,0 +1 @@ +Fix there being multiple independent Redis `Pods` running during upgrades. diff --git a/tests/manifests/test_pod_replicas.py b/tests/manifests/test_pod_replicas.py index 3ac43a7d..8f1e29e7 100644 --- a/tests/manifests/test_pod_replicas.py +++ b/tests/manifests/test_pod_replicas.py @@ -30,6 +30,12 @@ async def test_deployments_statefulsets_have_replicas_by_default(values, templat ) if pod_template_details.manifest["kind"] == "Deployment": + if deployable_details.name == "redis": + assert manifest_spec["strategy"]["type"] == "Recreate" + assert "rollingUpdate" not in manifest_spec["strategy"] + continue + + assert manifest_spec["strategy"]["type"] == "RollingUpdate" max_unavailable = manifest_spec["strategy"]["rollingUpdate"]["maxUnavailable"] if expected_replicas > 1: assert max_unavailable == 1, ( @@ -64,6 +70,10 @@ async def test_deployments_statefulsets_respect_replicas(values, make_templates) ) if pod_template_details.manifest["kind"] == "Deployment": + if deployable_details.name == "redis": + assert "rollingUpdate" not in manifest_spec["strategy"] + continue + max_unavailable = manifest_spec["strategy"]["rollingUpdate"]["maxUnavailable"] if deployable_details.is_singleton: assert max_unavailable == 0, (