{{- if and (.Values.podDisruptionBudget.enabled) (gt ( .Values.replicaCount | int ) 1) }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
  labels:
    app.kubernetes.io/name: {{ include "rocketchat.name" . }}
    helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }}
    app.kubernetes.io/instance: {{ .Release.Name }}
    app.kubernetes.io/managed-by: {{ .Release.Service }}
  name: {{ template "rocketchat.fullname" . }}
spec:
  selector:
    matchLabels:
      app.kubernetes.io/name: {{ include "rocketchat.name" . }}
      app.kubernetes.io/instance: {{ .Release.Name }}
  minAvailable: {{ .Values.minAvailable }}
{{- end }}
