From cac557a3863deb9626574700b8f47789addc70be Mon Sep 17 00:00:00 2001 From: mentlak Date: Mon, 25 Nov 2024 16:31:36 +0000 Subject: [PATCH 1/4] fix: bump chart v Signed-off-by: mentlak --- charts/prometheus/Chart.yaml | 2 +- charts/prometheus/templates/pdb.yaml | 7 ++++++- 2 files changed, 7 insertions(+), 2 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..eacd51dcb326 100644 --- a/charts/prometheus/templates/pdb.yaml +++ b/charts/prometheus/templates/pdb.yaml @@ -11,5 +11,10 @@ spec: selector: matchLabels: {{- include "prometheus.server.matchLabels" . | nindent 6 }} - {{- toYaml $pdbSpec | nindent 2 }} + {{- if $pdbSpec.minAvailable }} + minAvailable: {{ $pdbSpec.minAvailable }} + {{- end }} + {{- if $pdbSpec.maxUnavailable }} + maxUnavailable: {{ $pdbSpec.maxUnavailable }} + {{- end }} {{- end }} From fa9abef9ffbcd5685fbf5d7c61db7ad74090ee9c Mon Sep 17 00:00:00 2001 From: mentlak Date: Tue, 26 Nov 2024 09:27:30 +0000 Subject: [PATCH 2/4] chore: resolve requested changes Signed-off-by: mentlak --- charts/prometheus/templates/pdb.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/charts/prometheus/templates/pdb.yaml b/charts/prometheus/templates/pdb.yaml index eacd51dcb326..dff9284f0c34 100644 --- a/charts/prometheus/templates/pdb.yaml +++ b/charts/prometheus/templates/pdb.yaml @@ -11,10 +11,16 @@ spec: selector: matchLabels: {{- include "prometheus.server.matchLabels" . | nindent 6 }} - {{- if $pdbSpec.minAvailable }} + {{- if not (or (hasKey $pdbSpec "minAvailable") (hasKey $pdbSpec "maxUnavailable")) }} + maxUnavailable: 1 + {{- end }} + {{- if hasKey $pdbSpec "minAvailable" }} minAvailable: {{ $pdbSpec.minAvailable }} {{- end }} - {{- if $pdbSpec.maxUnavailable }} + {{- if hasKey $pdbSpec "maxUnavailable" }} maxUnavailable: {{ $pdbSpec.maxUnavailable }} {{- end }} + {{- if hasKey $pdbSpec "unhealthyPodEvictionPolicy" }} + unhealthyPodEvictionPolicy: {{ $pdbSpec.unhealthyPodEvictionPolicy }} + {{- end }}}} {{- end }} From a0dd72de4bc9dc3060a754d3a3df9cea169dfc53 Mon Sep 17 00:00:00 2001 From: mentlak Date: Wed, 27 Nov 2024 08:58:20 +0000 Subject: [PATCH 3/4] fix: uncomment default values Signed-off-by: mentlak --- charts/prometheus/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 3aa01ca302e29235a77398b5ca17762788a9260e Mon Sep 17 00:00:00 2001 From: mentlak Date: Wed, 27 Nov 2024 12:34:44 +0000 Subject: [PATCH 4/4] fix: brackets Signed-off-by: mentlak --- charts/prometheus/templates/pdb.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/prometheus/templates/pdb.yaml b/charts/prometheus/templates/pdb.yaml index dff9284f0c34..fffbdc62fc87 100644 --- a/charts/prometheus/templates/pdb.yaml +++ b/charts/prometheus/templates/pdb.yaml @@ -22,5 +22,5 @@ spec: {{- end }} {{- if hasKey $pdbSpec "unhealthyPodEvictionPolicy" }} unhealthyPodEvictionPolicy: {{ $pdbSpec.unhealthyPodEvictionPolicy }} - {{- end }}}} + {{- end }} {{- end }}