From af068e7243e1a256da8d830b68f6c4413db6c6ab Mon Sep 17 00:00:00 2001 From: Matthew Mentlak <93769720+mentlak0@users.noreply.github.com> Date: Wed, 27 Nov 2024 13:44:11 +0000 Subject: [PATCH] [prometheus] pdb template values (#5001) * fix: bump chart v Signed-off-by: mentlak * chore: resolve requested changes Signed-off-by: mentlak * fix: uncomment default values Signed-off-by: mentlak * fix: brackets Signed-off-by: mentlak --------- Signed-off-by: mentlak --- charts/prometheus/Chart.yaml | 2 +- charts/prometheus/templates/pdb.yaml | 13 ++++++++++++- charts/prometheus/values.yaml | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/charts/prometheus/Chart.yaml b/charts/prometheus/Chart.yaml index b3552332ee29..b2e4c46907cc 100644 --- a/charts/prometheus/Chart.yaml +++ b/charts/prometheus/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: prometheus appVersion: v2.55.1 -version: 25.30.1 +version: 25.30.2 kubeVersion: ">=1.19.0-0" description: Prometheus is a monitoring system and time series database. home: https://prometheus.io/ diff --git a/charts/prometheus/templates/pdb.yaml b/charts/prometheus/templates/pdb.yaml index 7ffe67307116..fffbdc62fc87 100644 --- a/charts/prometheus/templates/pdb.yaml +++ b/charts/prometheus/templates/pdb.yaml @@ -11,5 +11,16 @@ spec: selector: matchLabels: {{- include "prometheus.server.matchLabels" . | nindent 6 }} - {{- toYaml $pdbSpec | nindent 2 }} + {{- if not (or (hasKey $pdbSpec "minAvailable") (hasKey $pdbSpec "maxUnavailable")) }} + maxUnavailable: 1 + {{- end }} + {{- if hasKey $pdbSpec "minAvailable" }} + minAvailable: {{ $pdbSpec.minAvailable }} + {{- end }} + {{- if hasKey $pdbSpec "maxUnavailable" }} + maxUnavailable: {{ $pdbSpec.maxUnavailable }} + {{- end }} + {{- if hasKey $pdbSpec "unhealthyPodEvictionPolicy" }} + unhealthyPodEvictionPolicy: {{ $pdbSpec.unhealthyPodEvictionPolicy }} + {{- end }} {{- end }} diff --git a/charts/prometheus/values.yaml b/charts/prometheus/values.yaml index 106db6d348d6..2ce96ef652d2 100644 --- a/charts/prometheus/values.yaml +++ b/charts/prometheus/values.yaml @@ -453,7 +453,7 @@ server: ## podDisruptionBudget: enabled: false - maxUnavailable: 1 + # maxUnavailable: 1 # minAvailable: 1 ## unhealthyPodEvictionPolicy is available since 1.27.0 (beta) ## https://kubernetes.io/docs/tasks/run-application/configure-pdb/#unhealthy-pod-eviction-policy