Merge pull request #1557 from element-hq/bbz/redis-recreate

Only run a single Redis Pod
This commit is contained in:
Ben Banfield-Zanin authored and GitHub committed 2026-09-02 10:27:52 +01:00
commit 3bf74c4101
3 files changed
+15

No files matched your search

@@ -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:
+1
View File
@@ -0,0 +1 @@
Fix there being multiple independent Redis `Pods` running during upgrades.
+10
View File
@@ -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, (