From ea23c3196e31aca136f7fd85927e72ce34a17df7 Mon Sep 17 00:00:00 2001 From: Pablo Serrano Date: Wed, 16 Jul 2025 09:29:24 +0200 Subject: [PATCH 1/2] Add support PodDisruptionBudget in helm chart --- chart/templates/pdb.yaml | 12 +++++++++++- chart/values.yaml | 8 ++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/chart/templates/pdb.yaml b/chart/templates/pdb.yaml index 66bd52f8..592961f9 100644 --- a/chart/templates/pdb.yaml +++ b/chart/templates/pdb.yaml @@ -1,3 +1,4 @@ +{{- if .Values.podDisruptionBudget.enabled }} apiVersion: policy/v1 kind: PodDisruptionBudget metadata: @@ -5,7 +6,16 @@ metadata: labels: {{- include "kube-httpcache.labels" . | nindent 4 }} spec: - maxUnavailable: 1 + {{- if .Values.podDisruptionBudget.maxUnavailable }} + maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }} + {{- end }} + {{- if .Values.podDisruptionBudget.minAvailable }} + minAvailable: {{ .Values.podDisruptionBudget.minAvailable }} + {{- end }} + {{- if .Values.podDisruptionBudget.unhealthyPodEvictionPolicy }} + unhealthyPodEvictionPolicy: {{ .Values.podDisruptionBudget.unhealthyPodEvictionPolicy }} + {{- end }} selector: matchLabels: {{- include "kube-httpcache.selectorLabels" . | nindent 6 }} +{{- end }} diff --git a/chart/values.yaml b/chart/values.yaml index 688554bf..9289012e 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -242,6 +242,14 @@ autoscaling: targetCPUUtilizationPercentage: 80 # targetMemoryUtilizationPercentage: 80 +podDisruptionBudget: + enabled: true + # You can use either maxUnavailable or minAvailable (but not both) + maxUnavailable: 1 + # minAvailable: 1 + # Additional spec configuration + # unhealthyPodEvictionPolicy: IfHealthyBudget + nodeSelector: {} tolerations: [] From a99bbe6ee14a15638799351f70fbf8c643023456 Mon Sep 17 00:00:00 2001 From: Pablo Serrano Date: Wed, 16 Jul 2025 12:39:30 +0200 Subject: [PATCH 2/2] Adding fix to null another one --- chart/values.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chart/values.yaml b/chart/values.yaml index 9289012e..23891bda 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -244,9 +244,9 @@ autoscaling: podDisruptionBudget: enabled: true - # You can use either maxUnavailable or minAvailable (but not both) + # You can use either maxUnavailable or minAvailable (but not both) and also you have to setup another one to null. maxUnavailable: 1 - # minAvailable: 1 + minAvailable: null # Additional spec configuration # unhealthyPodEvictionPolicy: IfHealthyBudget