From 113954794bd3e4dbe6b85d1efbed522c8fef6a30 Mon Sep 17 00:00:00 2001 From: Starlight Romero <28881133+starlightromero@users.noreply.github.com> Date: Mon, 11 Sep 2023 02:09:33 -0700 Subject: [PATCH] [prometheus] allow more flexible poddisruptionbudget config (#3772) * fix(prometheus): allow more flexible poddisruptionbudget config Signed-off-by: Starlight Romero * chore(prometheus): bump helm chart version Signed-off-by: Starlight Romero * 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> * 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> * 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> --------- Signed-off-by: Starlight Romero Signed-off-by: Starlight Romero <28881133+starlightromero@users.noreply.github.com> Co-authored-by: zeritti <47476160+zeritti@users.noreply.github.com> --- charts/prometheus/Chart.yaml | 2 +- charts/prometheus/templates/pdb.yaml | 3 ++- charts/prometheus/values.yaml | 4 ++++ 3 files changed, 7 insertions(+), 2 deletions(-) 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/ diff --git a/charts/prometheus/templates/pdb.yaml b/charts/prometheus/templates/pdb.yaml index 852f1bb8fe5e..7ffe67307116 100644 --- a/charts/prometheus/templates/pdb.yaml +++ b/charts/prometheus/templates/pdb.yaml @@ -1,4 +1,5 @@ {{- if .Values.server.podDisruptionBudget.enabled }} +{{- $pdbSpec := omit .Values.server.podDisruptionBudget "enabled" }} apiVersion: {{ template "prometheus.podDisruptionBudget.apiVersion" . }} kind: PodDisruptionBudget metadata: @@ -7,8 +8,8 @@ metadata: labels: {{- include "prometheus.server.labels" . | nindent 4 }} spec: - maxUnavailable: {{ .Values.server.podDisruptionBudget.maxUnavailable }} selector: matchLabels: {{- include "prometheus.server.matchLabels" . | nindent 6 }} + {{- toYaml $pdbSpec | nindent 2 }} {{- end }} diff --git a/charts/prometheus/values.yaml b/charts/prometheus/values.yaml index 90dd3c7db2c8..45d3bcd32b9c 100644 --- a/charts/prometheus/values.yaml +++ b/charts/prometheus/values.yaml @@ -374,6 +374,10 @@ server: 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/