{{- if .Values.podDisruptionBudget.enabled }} {{- range $svcName := list "gitdata" "gitpod" "gitsync" "email" }} {{- $svcCfg := index $.Values $svcName }} {{- $pdbCfg := index $.Values.podDisruptionBudget $svcName }} {{- if and $svcCfg.enabled $pdbCfg.minAvailable }} --- apiVersion: policy/v1 kind: PodDisruptionBudget metadata: name: {{ include "app.serviceFullname" (dict "root" $ "name" $svcName) }} namespace: {{ $.Values.global.namespace | default $.Release.Namespace }} labels: {{- include "app.serviceLabels" (dict "root" $ "name" $svcName) | nindent 4 }} spec: minAvailable: {{ $pdbCfg.minAvailable }} selector: matchLabels: {{- include "app.serviceSelectorLabels" (dict "root" $ "name" $svcName) | nindent 6 }} {{- end }} {{- end }} {{- end }}