22 lines
752 B
YAML
22 lines
752 B
YAML
|
{{- $isDistributed := eq (include "loki.deployment.isDistributed" .) "true" -}}
|
||
|
{{- if and $isDistributed (gt (int .Values.ruler.replicas) 1) }}
|
||
|
{{- if kindIs "invalid" .Values.ruler.maxUnavailable }}
|
||
|
{{- fail "`.Values.ruler.maxUnavailable` must be set when `.Values.ruler.replicas` is greater than 1." }}
|
||
|
{{- else }}
|
||
|
apiVersion: {{ include "loki.pdb.apiVersion" . }}
|
||
|
kind: PodDisruptionBudget
|
||
|
metadata:
|
||
|
name: {{ include "loki.rulerFullname" . }}
|
||
|
namespace: {{ $.Release.Namespace }}
|
||
|
labels:
|
||
|
{{- include "loki.rulerLabels" . | nindent 4 }}
|
||
|
spec:
|
||
|
selector:
|
||
|
matchLabels:
|
||
|
{{- include "loki.rulerSelectorLabels" . | nindent 6 }}
|
||
|
{{- with .Values.ruler.maxUnavailable }}
|
||
|
maxUnavailable: {{ . }}
|
||
|
{{- end }}
|
||
|
{{- end }}
|
||
|
{{- end }}
|