From 3aa5481f7cfc5317009d22e03e61dead0e0366ef Mon Sep 17 00:00:00 2001 From: Starlight Romero Date: Sun, 10 Sep 2023 09:38:03 -0700 Subject: [PATCH 1/5] fix(prometheus): allow more flexible poddisruptionbudget config Signed-off-by: Starlight Romero --- charts/prometheus/templates/pdb.yaml | 4 ++-- charts/prometheus/values.yaml | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/charts/prometheus/templates/pdb.yaml b/charts/prometheus/templates/pdb.yaml index 852f1bb8fe5e..74018a2e8a40 100644 --- a/charts/prometheus/templates/pdb.yaml +++ b/charts/prometheus/templates/pdb.yaml @@ -1,4 +1,4 @@ -{{- if .Values.server.podDisruptionBudget.enabled }} +{{- if .Values.server.podDisruptionBudget }} apiVersion: {{ template "prometheus.podDisruptionBudget.apiVersion" . }} kind: PodDisruptionBudget metadata: @@ -7,8 +7,8 @@ metadata: labels: {{- include "prometheus.server.labels" . | nindent 4 }} spec: - maxUnavailable: {{ .Values.server.podDisruptionBudget.maxUnavailable }} selector: matchLabels: {{- include "prometheus.server.matchLabels" . | nindent 6 }} +{{ toYaml .Values.server.podDisruptionBudget | indent 2 }} {{- end }} diff --git a/charts/prometheus/values.yaml b/charts/prometheus/values.yaml index 90dd3c7db2c8..cb3acefa5ade 100644 --- a/charts/prometheus/values.yaml +++ b/charts/prometheus/values.yaml @@ -371,9 +371,7 @@ server: ## PodDisruptionBudget settings ## ref: https://kubernetes.io/docs/concepts/workloads/pods/disruptions/ ## - podDisruptionBudget: - enabled: false - maxUnavailable: 1 + podDisruptionBudget: {} ## Use an alternate scheduler, e.g. "stork". ## ref: https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/ From 663e8c23c779a8c2f4482c269ccaa9b6b97754d7 Mon Sep 17 00:00:00 2001 From: Starlight Romero Date: Sun, 10 Sep 2023 09:45:44 -0700 Subject: [PATCH 2/5] chore(prometheus): bump helm chart version Signed-off-by: Starlight Romero --- charts/prometheus/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/prometheus/Chart.yaml b/charts/prometheus/Chart.yaml index c82f523aef2a..c89d586252d5 100644 --- a/charts/prometheus/Chart.yaml +++ b/charts/prometheus/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: prometheus appVersion: v2.46.0 -version: 24.3.0 +version: 24.3.1 kubeVersion: ">=1.19.0-0" description: Prometheus is a monitoring system and time series database. home: https://prometheus.io/ From 4db8bf947d70c789159c879647fc6fda0e9db958 Mon Sep 17 00:00:00 2001 From: Starlight Romero <28881133+starlightromero@users.noreply.github.com> Date: Sun, 10 Sep 2023 15:25:10 -0700 Subject: [PATCH 3/5] Update charts/prometheus/values.yaml Co-authored-by: zeritti <47476160+zeritti@users.noreply.github.com> Signed-off-by: Starlight Romero <28881133+starlightromero@users.noreply.github.com> --- charts/prometheus/values.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/charts/prometheus/values.yaml b/charts/prometheus/values.yaml index cb3acefa5ade..45d3bcd32b9c 100644 --- a/charts/prometheus/values.yaml +++ b/charts/prometheus/values.yaml @@ -371,7 +371,13 @@ server: ## PodDisruptionBudget settings ## ref: https://kubernetes.io/docs/concepts/workloads/pods/disruptions/ ## - podDisruptionBudget: {} + podDisruptionBudget: + enabled: false + 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 + # unhealthyPodEvictionPolicy: IfHealthyBudget ## Use an alternate scheduler, e.g. "stork". ## ref: https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/ From 7318dccb5ee9a1e1c59984cda45092131f431158 Mon Sep 17 00:00:00 2001 From: Starlight Romero <28881133+starlightromero@users.noreply.github.com> Date: Sun, 10 Sep 2023 15:25:15 -0700 Subject: [PATCH 4/5] Update charts/prometheus/templates/pdb.yaml Co-authored-by: zeritti <47476160+zeritti@users.noreply.github.com> Signed-off-by: Starlight Romero <28881133+starlightromero@users.noreply.github.com> --- 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 74018a2e8a40..51b752809a2c 100644 --- a/charts/prometheus/templates/pdb.yaml +++ b/charts/prometheus/templates/pdb.yaml @@ -10,5 +10,5 @@ spec: selector: matchLabels: {{- include "prometheus.server.matchLabels" . | nindent 6 }} -{{ toYaml .Values.server.podDisruptionBudget | indent 2 }} + {{- toYaml $pdbSpec | nindent 2 }} {{- end }} From 43c408efe5321e52dcd8b8ec23f41d4e9662f922 Mon Sep 17 00:00:00 2001 From: Starlight Romero <28881133+starlightromero@users.noreply.github.com> Date: Sun, 10 Sep 2023 15:25:21 -0700 Subject: [PATCH 5/5] Update charts/prometheus/templates/pdb.yaml Co-authored-by: zeritti <47476160+zeritti@users.noreply.github.com> Signed-off-by: Starlight Romero <28881133+starlightromero@users.noreply.github.com> --- charts/prometheus/templates/pdb.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/charts/prometheus/templates/pdb.yaml b/charts/prometheus/templates/pdb.yaml index 51b752809a2c..7ffe67307116 100644 --- a/charts/prometheus/templates/pdb.yaml +++ b/charts/prometheus/templates/pdb.yaml @@ -1,4 +1,5 @@ -{{- if .Values.server.podDisruptionBudget }} +{{- if .Values.server.podDisruptionBudget.enabled }} +{{- $pdbSpec := omit .Values.server.podDisruptionBudget "enabled" }} apiVersion: {{ template "prometheus.podDisruptionBudget.apiVersion" . }} kind: PodDisruptionBudget metadata: