oc-k8s/opencloud/charts/loki/templates/query-frontend/poddisruptionbudget-query-frontend.yaml

22 lines
815 B
YAML
Raw Normal View History

2024-12-16 14:55:43 +01:00
{{- $isDistributed := eq (include "loki.deployment.isDistributed" .) "true" -}}
{{- if and $isDistributed (gt (int .Values.queryFrontend.replicas) 1) }}
{{- if kindIs "invalid" .Values.queryFrontend.maxUnavailable }}
{{- fail "`.Values.queryFrontend.maxUnavailable` must be set when `.Values.queryFrontend.replicas` is greater than 1." }}
{{- else }}
apiVersion: {{ include "loki.pdb.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
name: {{ include "loki.queryFrontendFullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "loki.queryFrontendLabels" . | nindent 4 }}
spec:
selector:
matchLabels:
{{- include "loki.queryFrontendSelectorLabels" . | nindent 6 }}
{{- with .Values.queryFrontend.maxUnavailable }}
maxUnavailable: {{ . }}
{{- end }}
{{- end }}
{{- end }}