From 4a8b674c8d20c890a6e7177f74aa8f59d84794a4 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 --- .../templates/podDisruptionBudget.yaml | 17 +++++++++++++++++ chart/k8s-pause/values.yaml | 5 +++++ 2 files changed, 22 insertions(+) create mode 100644 chart/k8s-pause/templates/podDisruptionBudget.yaml diff --git a/chart/k8s-pause/templates/podDisruptionBudget.yaml b/chart/k8s-pause/templates/podDisruptionBudget.yaml new file mode 100644 index 0000000..d34b1db --- /dev/null +++ b/chart/k8s-pause/templates/podDisruptionBudget.yaml @@ -0,0 +1,17 @@ +{{- 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: + minAvailable: {{ .Values.pdb.minAvailable }} + 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..ca349dc 100644 --- a/chart/k8s-pause/values.yaml +++ b/chart/k8s-pause/values.yaml @@ -91,6 +91,11 @@ envFromSecret: "" ## key: password extraEnvSecrets: {} +# Ability to set a PodDisruptionBudget +# pdb: +# enabled: true +# minAvailable: 1 + securityContext: allowPrivilegeEscalation: false capabilities: