{{- if .Values.pdb.enabled -}}
---
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
  name: {{ include "hydra.fullname" . }}
spec:
  selector:
    matchLabels:
      app.kubernetes.io/name: {{ include "hydra.name" . }}
      app.kubernetes.io/instance: {{ .Release.Name }}
  {{- with .Values.pdb.spec.maxUnavailable }}
  maxUnavailable: {{ . }}
  {{- end }}
  {{- with .Values.pdb.spec.minAvailable }}
  minAvailable: {{ . }}
  {{- end }}
{{- end -}}