From a95ed0176c2b9d0b78addf54d2337e2bcc603eb8 Mon Sep 17 00:00:00 2001 From: Om Mishra <32200996+mishraomp@users.noreply.github.com> Date: Mon, 22 Jan 2024 10:46:06 -0800 Subject: [PATCH] feat: Added PDB option. (#37) --- charts/component/Chart.yaml | 2 +- charts/component/templates/pdb.yaml | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 charts/component/templates/pdb.yaml diff --git a/charts/component/Chart.yaml b/charts/component/Chart.yaml index 88aac55..c0446f9 100644 --- a/charts/component/Chart.yaml +++ b/charts/component/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.2.4 +version: 0.3.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/component/templates/pdb.yaml b/charts/component/templates/pdb.yaml new file mode 100644 index 0000000..32017f4 --- /dev/null +++ b/charts/component/templates/pdb.yaml @@ -0,0 +1,15 @@ +{{- if and .Values.pdb .Values.pdb.enabled }} +--- +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: {{ include "component.fullname" . }} + labels: + {{- include "component.labels" . | nindent 4 }} +spec: + selector: + matchLabels: + app.kubernetes.io/name: {{ include "component.fullname" . }} + minAvailable: {{ .Values.pdb.minAvailable }} +{{- end }} +