{{- if .Values.podDisruptionBudget.enabled }}
{{- if .Capabilities.APIVersions.Has "policy/v1/PodDisruptionBudget" }}
apiVersion: policy/v1
{{- else -}}
apiVersion: policy/v1beta1
{{- end }}
kind: PodDisruptionBudget
metadata:
  name: {{ template "victoria-logs.fullname" . }}
  namespace: {{ .Release.Namespace }}
  labels:
  {{- include "victoria-logs.common.metaLabels" . | nindent 4 }}
  {{- if .Values.podDisruptionBudget.extraLabels }}
{{ toYaml .Values.podDisruptionBudget.extraLabels | indent 4}}
  {{- end }}
spec:
{{- if .Values.podDisruptionBudget.minAvailable }}
  minAvailable: {{ .Values.podDisruptionBudget.minAvailable }}
{{- end }}
{{- if .Values.podDisruptionBudget.maxUnavailable }}
  maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }}
{{- end }}
  selector:
    matchLabels:
      {{- include "victoria-logs.server.matchLabels" . | nindent 6 }}
{{- end }}
