Skip to content

Add ability to customize helm values for deployment strategy#7900

Open
rmlamarche wants to merge 2 commits intorequarks:mainfrom
rmlamarche:main
Open

Add ability to customize helm values for deployment strategy#7900
rmlamarche wants to merge 2 commits intorequarks:mainfrom
rmlamarche:main

Conversation

@rmlamarche
Copy link
Copy Markdown

Changes

  • Adds ability to customize deployment rollout strategy.type in the wiki helm chart ("RollingUpdate" vs. "Recreate")
  • With strategy.type="RollingUpdate", maxSurge and maxUnavailable are also customizable via helm values
  • Documentation updated with descriptions/defaults for new helm values

Testing

Default behavior is unchanged (RollingUpdate - 25% - 25%)

$ helm template . | grep -A4 strategy
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%

Rendering with strategy.type set to Recreate

$ helm template --set strategy.type="Recreate" . | grep -A4 strategy
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app.kubernetes.io/name: wiki

Customizing maxSurge

$ helm template --set strategy.rollingUpdate.maxSurge="100%" . | grep -A4 strategy
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 100%
      maxUnavailable: 25%

Customizing maxUnavailable

$ helm template --set strategy.rollingUpdate.maxUnavailable="100%" . | grep -A4 strategy
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 100%
Ryan LaMarche and others added 2 commits January 17, 2026 13:06
@auto-assign auto-assign Bot requested a review from NGPixel January 17, 2026 18:23
@mwielgosz-esky
Copy link
Copy Markdown

Nice addition — we are currently vendoring this patch in production to work around Multi-Attach errors on RWO PVCs.

One issue: if a user provides strategy.type: RollingUpdate without the rollingUpdate sub-keys (e.g. --set strategy.rollingUpdate=null), the template fails with a nil pointer dereference. The defaults in values.yaml help, but user overrides can remove them.

Reproduction:

$ helm template --set strategy.rollingUpdate=null .
Error: template: wiki/templates/deployment.yaml:14:26: nil pointer evaluating interface {}.maxSurge

Suggested fix for deployment.yaml:

    {{- if eq .Values.strategy.type "RollingUpdate" }}
    {{- $rollingUpdate := default (dict) .Values.strategy.rollingUpdate }}
    rollingUpdate:
      maxSurge: {{ default "25%" $rollingUpdate.maxSurge }}
      maxUnavailable: {{ default "25%" $rollingUpdate.maxUnavailable }}
    {{- end }}

Tested both paths — Recreate renders clean, RollingUpdate with null sub-keys falls back to 25%/25% defaults.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants