# grafana_charts_poddisruptionbudget-memcached-index-queries.yaml
{{- if and .Values.memcachedIndexQueries.enabled (gt (int .Values.memcachedIndexQueries.replicas) 1) }}
{{- if kindIs "invalid" .Values.memcachedIndexQueries.maxUnavailable }}
{{- fail "`.Values.memcachedIndexQueries.maxUnavailable` must be set when `.Values.memcachedIndexQueries.replicas` is greater than 1." }}
{{- else }}
apiVersion: {{ include "loki.pdb.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
  name: {{ include "loki.memcachedIndexQueriesFullname" . }}
  namespace: {{ .Release.Namespace }}
  labels:
    {{- include "loki.memcachedIndexQueriesLabels" . | nindent 4 }}
spec:
  selector:
    matchLabels:
      {{- include "loki.memcachedIndexQueriesSelectorLabels" . | nindent 6 }}
  {{- with .Values.memcachedIndexQueries.maxUnavailable }}
  maxUnavailable: {{ . }}
  {{- end }}
  {{- with .Values.memcachedIndexQueries.minAvailable }}
  minAvailable: {{ . }}
  {{- end }}
{{- end }}
{{- end }}