Skip to content

chart(redis-cluster): only render pdb.maxUnavailable / minAvailable when set#1749

Open
SAY-5 wants to merge 1 commit intoOT-CONTAINER-KIT:mainfrom
SAY-5:fix/redis-cluster-pdb-conditional-render-1745
Open

chart(redis-cluster): only render pdb.maxUnavailable / minAvailable when set#1749
SAY-5 wants to merge 1 commit intoOT-CONTAINER-KIT:mainfrom
SAY-5:fix/redis-cluster-pdb-conditional-render-1745

Conversation

@SAY-5
Copy link
Copy Markdown

@SAY-5 SAY-5 commented Apr 21, 2026

Summary

Fixes #1745.

The _helpers.tpl PDB block unconditionally rendered both maxUnavailable and minAvailable from values.yaml, which the chart defaults to (1, 1):

{{- if .pdb.enabled }}
pdb:
  enabled: {{ .pdb.enabled }}
  maxUnavailable: {{ .pdb.maxUnavailable }}
  minAvailable: {{ .pdb.minAvailable }}
{{- end }}

When a user enabled the PDB without clearing one of them, the RedisCluster CR carried both fields and the operator propagated them to the PodDisruptionBudget controller, which rejects the object:

PodDisruptionBudget.policy is invalid: spec: Invalid value:
minAvailable and maxUnavailable cannot be both set

RedisCluster reconciliation then loops on the failed PDB and follower StatefulSets are never created.

Fix

Guard each field with {{- if .pdb.<field> }} so users who explicitly set only one keep the chart behaviour they asked for, while setting both still renders both (preserving current behaviour for deliberately-configured overrides).

Test plan

  • Hand-verified the rendered YAML shape with each of the three configurations (only maxUnavailable, only minAvailable, both)
  • helm lint charts/redis-cluster (no helm available in my local env; left for CI)

…hen set

The _helpers.tpl PDB block unconditionally rendered both
maxUnavailable and minAvailable from values.yaml, which the
chart defaults to (1, 1). When a user enabled the PDB without
clearing one of them, the RedisCluster CR carried both fields
and the operator propagated them to the PodDisruptionBudget
controller, which rejects the object:

  PodDisruptionBudget.policy is invalid: spec: Invalid value:
  minAvailable and maxUnavailable cannot be both set

RedisCluster reconciliation then loops on the failed PDB and
the follower StatefulSets are never created (OT-CONTAINER-KIT#1745).

Guard each field with `{{- if .pdb.<field> }}` so users who
explicitly set only one keep the charts' behaviour they asked
for, and setting both still renders both (preserving current
behaviour for deliberately-configured overrides).

Signed-off-by: SAY-5 <SAY-5@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

redis-cluster Helm chart renders both minAvailable and maxUnavailable in PDB causing RedisCluster reconciliation failure

1 participant