# grafana_charts_poddisruptionbudget-ingester.yaml
{{- if and (gt (int .Values.ingester.replicas) 1) .Values.ingester.podDisruptionBudget.enabled }}
{{ $dict := dict "ctx" . "component" "ingester" "memberlist" true }}
apiVersion: {{ include "tempo.pdb.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
  name: {{ include "tempo.resourceName" $dict }}
  namespace: {{ .Release.Namespace }}
  labels:
    {{- include "tempo.labels" $dict | nindent 4 }}
spec:
  selector:
    matchLabels:
      {{- include "tempo.selectorLabels" $dict | nindent 6 }}
  maxUnavailable: {{ default (sub (.Values.ingester.replicas) (add (div .Values.ingester.config.replication_factor 2) 1)) .Values.ingester.maxUnavailable }}
{{- end }}