{{- if .Values.podDisruptionBudget.create }}
apiVersion: policy/v1beta1
kind: PodDisruptionBudget
metadata:
  name: {{ template "mariadb-galera.fullname" . }}
  labels: {{- include "mariadb-galera.labels" . | nindent 4 }}
spec:
{{- if .Values.podDisruptionBudget.minAvailable }}
  minAvailable: {{ .Values.podDisruptionBudget.minAvailable }}
{{- end }}
{{- if .Values.podDisruptionBudget.maxUnavailable }}
  maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }}
{{- end }}
  selector:
    matchLabels:
      app.kubernetes.io/name: {{ include "mariadb-galera.name" . }}
      app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
