From b4c563298df8d3c69946495dfe9bc97eb8feb291 Mon Sep 17 00:00:00 2001 From: peterabarr <90917602+peterabarr@users.noreply.github.com> Date: Wed, 25 Sep 2024 15:46:35 +0100 Subject: [PATCH] feat: Added new policy to PodDisruptionBudget rebase rebase --- charts/metrics-server/README.md | 2 ++ charts/metrics-server/templates/pdb.yaml | 10 ++++++++-- charts/metrics-server/values.yaml | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/charts/metrics-server/README.md b/charts/metrics-server/README.md index e4e846285..4590d8008 100644 --- a/charts/metrics-server/README.md +++ b/charts/metrics-server/README.md @@ -52,6 +52,8 @@ The following table lists the configurable parameters of the _Metrics Server_ ch | `podDisruptionBudget.enabled` | If `true`, create `PodDisruptionBudget` resource. | `{}` | | `podDisruptionBudget.minAvailable` | Set the `PodDisruptionBudget` minimum available pods. | `nil` | | `podDisruptionBudget.maxUnavailable` | Set the `PodDisruptionBudget` maximum unavailable pods. | `nil` | +| `podDisruptionBudget.maxUnavailable` | Set the `PodDisruptionBudget` maximum unavailable pods. | `nil` | +| `podDisruptionBudget.unhealthyPodEvictionPolicy` | Unhealthy pod eviction policy for the PDB. | `nil` | | `defaultArgs` | Default arguments to pass to the _metrics-server_ command. | See _values.yaml_ | | `args` | Additional arguments to pass to the _metrics-server_ command. | `[]` | | `livenessProbe` | Liveness probe. | See _values.yaml_ | diff --git a/charts/metrics-server/templates/pdb.yaml b/charts/metrics-server/templates/pdb.yaml index 1f5eddf87..de7689d4a 100644 --- a/charts/metrics-server/templates/pdb.yaml +++ b/charts/metrics-server/templates/pdb.yaml @@ -9,10 +9,16 @@ metadata: spec: {{- if .Values.podDisruptionBudget.minAvailable }} minAvailable: {{ .Values.podDisruptionBudget.minAvailable }} - {{- end }} + {{- end }} {{- if .Values.podDisruptionBudget.maxUnavailable }} maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }} - {{- end }} + {{- end }} + {{- if (semverCompare ">= 1.27-0" .Capabilities.KubeVersion.Version) }} + {{- with .Values.podDisruptionBudget.unhealthyPodEvictionPolicy }} + unhealthyPodEvictionPolicy: {{ . }} + {{- end }} + {{- end }} + selector: matchLabels: {{- include "metrics-server.selectorLabels" . | nindent 6 }} diff --git a/charts/metrics-server/values.yaml b/charts/metrics-server/values.yaml index 79eaf9397..ff88d13f5 100644 --- a/charts/metrics-server/values.yaml +++ b/charts/metrics-server/values.yaml @@ -90,6 +90,7 @@ podDisruptionBudget: enabled: false minAvailable: maxUnavailable: + unhealthyPodEvictionPolicy: defaultArgs: - --cert-dir=/tmp