From 03fd586b582cee589516ae71b660f22f397eb78f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20G=C3=A9rondal?= Date: Tue, 21 May 2024 13:00:42 +0200 Subject: [PATCH] chart: add pdb parameter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thibault GĂ©rondal --- chart/k8s-pause/Chart.yaml | 2 +- chart/k8s-pause/templates/pdb.yaml | 22 ++++++++++++++++++++++ chart/k8s-pause/values.yaml | 6 ++++++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 chart/k8s-pause/templates/pdb.yaml diff --git a/chart/k8s-pause/Chart.yaml b/chart/k8s-pause/Chart.yaml index be8419b..c2b76f1 100644 --- a/chart/k8s-pause/Chart.yaml +++ b/chart/k8s-pause/Chart.yaml @@ -14,4 +14,4 @@ keywords: name: k8s-pause sources: - https://github.com/DoodleScheduling/k8s-pause -version: 0.2.7 +version: 0.2.8 diff --git a/chart/k8s-pause/templates/pdb.yaml b/chart/k8s-pause/templates/pdb.yaml new file mode 100644 index 0000000..590da64 --- /dev/null +++ b/chart/k8s-pause/templates/pdb.yaml @@ -0,0 +1,22 @@ +{{- if .Values.pdb.enabled }} +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: {{ include "k8s-pause.fullname" . }}-pdb + labels: + app.kubernetes.io/name: {{ include "k8s-pause.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + helm.sh/chart: {{ include "k8s-pause.chart" . }} +spec: + {{- if .Values.pdb.minAvailable }} + minAvailable: {{ .Values.pdb.minAvailable }} + {{- end }} + {{- if .Values.pdb.maxUnavailable }} + maxUnavailable: {{ .Values.pdb.maxUnavailable }} + {{- end }} + selector: + matchLabels: + app.kubernetes.io/name: {{ include "k8s-pause.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} diff --git a/chart/k8s-pause/values.yaml b/chart/k8s-pause/values.yaml index 680fbf6..6ea4ea8 100644 --- a/chart/k8s-pause/values.yaml +++ b/chart/k8s-pause/values.yaml @@ -91,6 +91,12 @@ envFromSecret: "" ## key: password extraEnvSecrets: {} +# Ability to set a PodDisruptionBudget +pdb: + enabled: false + minAvailable: 1 + maxUnavailable: "" + securityContext: allowPrivilegeEscalation: false capabilities: