From d77cd38fd08a095a678e2bb3ebd0f641b4d3be5e Mon Sep 17 00:00:00 2001 From: Jeff Larson Date: Sun, 26 Jul 2026 15:10:11 -0700 Subject: [PATCH] fix(chart): agent-daemonset maxUnavailable:0 when surging MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DaemonSet rollingUpdate rejects both maxSurge and maxUnavailable being non-zero simultaneously. With the default agent.maxSurge:1, this chart never set maxUnavailable, so it defaulted to 1 — an invalid combination that Kubernetes rejects at apply time. Brings the source chart to parity with the cluster fork's identical fix: surge ⇒ maxUnavailable:0, no surge ⇒ maxUnavailable:1 (default terminate-then-replace). Closes JEF-529 Co-Authored-By: Claude Opus 4.8 --- charts/protector/templates/agent-daemonset.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/charts/protector/templates/agent-daemonset.yaml b/charts/protector/templates/agent-daemonset.yaml index 611048b..88c60e6 100644 --- a/charts/protector/templates/agent-daemonset.yaml +++ b/charts/protector/templates/agent-daemonset.yaml @@ -38,6 +38,10 @@ spec: type: RollingUpdate rollingUpdate: maxSurge: {{ .Values.agent.maxSurge }} + # A DaemonSet rollingUpdate may not have both maxSurge and maxUnavailable + # non-zero (Kubernetes rejects it). Surging ⇒ maxUnavailable:0; no surge ⇒ + # fall back to the default terminate-then-replace (maxUnavailable:1). + maxUnavailable: {{ if gt (int .Values.agent.maxSurge) 0 }}0{{ else }}1{{ end }} selector: matchLabels: {{- include "protector.agentSelectorLabels" . | nindent 6 }}