From f9c12b48a8fae1b7c1dab0662978c88fadd546b1 Mon Sep 17 00:00:00 2001 From: Aryan Gorwade Date: Thu, 19 Nov 2026 14:38:33 -0800 Subject: [PATCH] Validate explicit operator PDB requests Signed-off-by: Aryan Gorwade --- deployments/gpu-operator/templates/validations.yaml | 5 +++++ deployments/gpu-operator/values.yaml | 9 ++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/deployments/gpu-operator/templates/validations.yaml b/deployments/gpu-operator/templates/validations.yaml index b278bd12b..e6e8fa0ce 100644 --- a/deployments/gpu-operator/templates/validations.yaml +++ b/deployments/gpu-operator/templates/validations.yaml @@ -32,3 +32,8 @@ {{- if and (hasKey .Values.operator "replicaCount") (lt (int .Values.operator.replicaCount) 1) }} {{- fail "operator.replicaCount must be at least 1" }} {{- end }} + +{{- $pdb := .Values.operator.podDisruptionBudget | default dict }} +{{- if and (dig "enabled" false $pdb) (le (int .Values.operator.replicaCount) 1) }} +{{- fail "operator.podDisruptionBudget.enabled=true requires operator.replicaCount to be at least 2" }} +{{- end }} diff --git a/deployments/gpu-operator/values.yaml b/deployments/gpu-operator/values.yaml index bb8f41d82..774bc3946 100644 --- a/deployments/gpu-operator/values.yaml +++ b/deployments/gpu-operator/values.yaml @@ -117,11 +117,10 @@ operator: values: [""] podAntiAffinity: enabled: true - podDisruptionBudget: - # Created when operator.replicaCount > 1. - # If only one node can run operator pods, this budget can block draining that node. - # Set operator.replicaCount to 1 or disable this podDisruptionBudget to allow draining. - enabled: true + # Created when operator.replicaCount > 1. + # If only one node can run operator pods, this budget can block draining that node. + # Set operator.replicaCount to 1 or disable this podDisruptionBudget to allow draining. + podDisruptionBudget: {} logging: # Zap time encoding (one of 'epoch', 'millis', 'nano', 'iso8601', 'rfc3339' or 'rfc3339nano') timeEncoding: epoch