{{- if eq .Values.highAvailability.enabled true }}
{{- if .Capabilities.APIVersions.Has "policy/v1" }}
apiVersion: policy/v1
{{- else }}
apiVersion: policy/v1beta1
{{- end }}
kind: PodDisruptionBudget
metadata:
  name: {{ include "azure-api-management-gateway.fullname" . }}
  namespace: {{ .Release.Namespace | quote }}
  labels:
    {{- include "azure-api-management-gateway.labels" . | nindent 4 }}
spec:
  maxUnavailable: {{ .Values.highAvailability.disruption.maximumUnavailable }}
  selector:
    matchLabels:
      {{- include "azure-api-management-gateway.selectorLabels" . | nindent 6 }}
{{- end }}
