{{- if and .Values.alertmanager.enabled .Values.alertmanager.podDisruptionBudget.enabled }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
  name: {{ template "kube-prometheus-stack.fullname" . }}-alertmanager
  namespace: {{ template "kube-prometheus-stack-alertmanager.namespace" . }}
  labels:
    app: {{ template "kube-prometheus-stack.name" . }}-alertmanager
{{ include "kube-prometheus-stack.labels" . | indent 4 }}
spec:
{{- toYaml (omit .Values.alertmanager.podDisruptionBudget "enabled") | nindent 2 }}
  selector:
    matchLabels:
      app.kubernetes.io/name: alertmanager
      alertmanager: {{ template "kube-prometheus-stack.alertmanager.crname" . }}
{{- end }}
