diff --git a/charts/lfx-v2-committee-service/templates/pdb.yaml b/charts/lfx-v2-committee-service/templates/pdb.yaml new file mode 100644 index 0000000..0c8f2aa --- /dev/null +++ b/charts/lfx-v2-committee-service/templates/pdb.yaml @@ -0,0 +1,23 @@ +# Copyright The Linux Foundation and each contributor to LFX. +# SPDX-License-Identifier: MIT +{{- if .Values.podDisruptionBudget.enabled }} +{{- if and (hasKey .Values.podDisruptionBudget "minAvailable") (hasKey .Values.podDisruptionBudget "maxUnavailable") }} + {{- fail "podDisruptionBudget: cannot set both minAvailable and maxUnavailable" }} +{{- end }} +--- +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: {{ .Chart.Name }} + namespace: {{ .Release.Namespace }} +spec: + selector: + matchLabels: + app: {{ .Chart.Name }} + {{- if hasKey .Values.podDisruptionBudget "minAvailable" }} + minAvailable: {{ .Values.podDisruptionBudget.minAvailable }} + {{- end }} + {{- if hasKey .Values.podDisruptionBudget "maxUnavailable" }} + maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }} + {{- end }} +{{- end }} diff --git a/charts/lfx-v2-committee-service/values.yaml b/charts/lfx-v2-committee-service/values.yaml index e1bbf3a..63e1b4e 100644 --- a/charts/lfx-v2-committee-service/values.yaml +++ b/charts/lfx-v2-committee-service/values.yaml @@ -16,6 +16,13 @@ podAnnotations: {} # environment: production podLabels: {} +# podDisruptionBudget configures a PodDisruptionBudget for the deployment. +# Only one of minAvailable or maxUnavailable may be set (not both). +podDisruptionBudget: + enabled: false + # minAvailable: 1 + # maxUnavailable: 1 + # image is the configuration for the container images image: # repository is the container image repository