From c2ccb37cc71c6479128b3d6a02333721383e594e Mon Sep 17 00:00:00 2001 From: Christoph Voigt Date: Fri, 10 Nov 2023 14:25:34 +0100 Subject: [PATCH] add optional resource PodDisruptionBudget --- templates/poddistruptionbudget.yaml | 21 +++++++++++++++++++++ values.yaml | 11 +++++++++++ 2 files changed, 32 insertions(+) create mode 100644 templates/poddistruptionbudget.yaml diff --git a/templates/poddistruptionbudget.yaml b/templates/poddistruptionbudget.yaml new file mode 100644 index 0000000..2799de1 --- /dev/null +++ b/templates/poddistruptionbudget.yaml @@ -0,0 +1,21 @@ +{{- if .Values.podDisruptionBudget.enabled -}} +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: {{ include "krakend.fullname" . }} + labels: + {{- include "krakend.labels" . | nindent 4 }} +spec: + {{- if .Values.podDisruptionBudget.minAvailable }} + minAvailable: {{ .Values.podDisruptionBudget.minAvailable }} + {{- end }} + {{- if .Values.podDisruptionBudget.maxUnavailable }} + maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }} + {{- end }} + {{- if not (eq .Values.podDisruptionBudget.unhealthyPodEvictionPolicy "") }} + unhealthyPodEvictionPolicy: {{ .Values.podDisruptionBudget.unhealthyPodEvictionPolicy }} + {{- end }} + selector: + matchLabels: + {{- include "krakend.selectorLabels" . | nindent 6 }} +{{- end }} \ No newline at end of file diff --git a/values.yaml b/values.yaml index e878f8a..e571363 100644 --- a/values.yaml +++ b/values.yaml @@ -227,6 +227,17 @@ readinessProbe: path: /__health port: http +# -- (object) podDisruptionBudget allows you to define minumum and maximum available pods +podDisruptionBudget: + # -- (bool) Set to true to create a default ServiceMonitor for your application + enabled: false + # -- minimum available pods + minAvailable: 1 + # -- maximum available pods + maxUnavailable: "" + # -- UnhealthyPodEvictionPolicy defines the criteria for when unhealthy pods should be considered for eviction + unhealthyPodEvictionPolicy: "" + # -- (object) The serviceMonitor configures a ServiceMonitor for your application serviceMonitor: # -- (bool) Set to true to create a default ServiceMonitor for your application