Skip to content

Commit

Permalink
feat: Allow configure podDisruptionBudget
Browse files Browse the repository at this point in the history
  • Loading branch information
sule26 committed Dec 21, 2024
1 parent a3808b6 commit d5d459c
Show file tree
Hide file tree
Showing 8 changed files with 92 additions and 64 deletions.
2 changes: 1 addition & 1 deletion production/helm/loki/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: loki
description: Helm chart for Grafana Loki and Grafana Enterprise Logs supporting both simple, scalable and distributed modes.
type: application
appVersion: 3.3.2
version: 6.24.0
version: 6.24.1
home: https://grafana.github.io/helm-charts
sources:
- https://github.com/grafana/loki
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{{- $isSimpleScalable := eq (include "loki.deployment.isScalable" .) "true" -}}
{{- if and $isSimpleScalable (gt (int .Values.backend.replicas) 1) (not .Values.read.legacyReadTarget ) }}
{{- if .Values.backend.PodDisruptionBudget.create}}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
Expand All @@ -11,5 +10,7 @@ spec:
selector:
matchLabels:
{{- include "loki.backendSelectorLabels" . | nindent 6 }}
maxUnavailable: 1
{{- with .Values.backend.PodDisruptionBudget.maxUnavailable }}
maxUnavailable: {{ . | default 1 }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- if .Values.chunksCache.enabled }}
{{- if .Values.chunksCache.PodDisruptionBudget.create }}
apiVersion: {{ include "loki.pdb.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
Expand All @@ -12,5 +13,8 @@ spec:
matchLabels:
{{- include "loki.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: memcached-chunks-cache
maxUnavailable: 1
{{- end -}}
{{- with .Values.chunksCache.PodDisruptionBudget.maxUnavailable }}
maxUnavailable: {{ . | default 1 }}
{{- end}}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- if and .Values.gateway.enabled }}
{{- if and .Values.gateway.PodDisruptionBudget.create}}
{{- if or
(and (not .Values.gateway.autoscaling.enabled) (gt (int .Values.gateway.replicas) 1))
(and .Values.gateway.autoscaling.enabled (gt (int .Values.gateway.autoscaling.minReplicas) 1))
Expand All @@ -14,6 +15,8 @@ spec:
selector:
matchLabels:
{{- include "loki.gatewaySelectorLabels" . | nindent 6 }}
maxUnavailable: 1
{{- with .Values.gateway.PodDisruptionBudget.maxUnavailable }}
maxUnavailable: {{ . | default 1 }}
{{- end}}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{{- $isSimpleScalable := eq (include "loki.deployment.isScalable" .) "true" -}}
{{- if and $isSimpleScalable (gt (int .Values.read.replicas) 1) }}
{{- if .Values.read.PodDisruptionBudget.create }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
Expand All @@ -11,5 +10,7 @@ spec:
selector:
matchLabels:
{{- include "loki.readSelectorLabels" . | nindent 6 }}
maxUnavailable: 1
{{- with .Values.read.PodDisruptionBudget.maxUnavailable }}
maxUnavailable: {{ . | default 1 }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- if .Values.resultsCache.enabled }}
{{- if .Values.resultsCache.PodDisruptionBudget.create }}
apiVersion: {{ include "loki.pdb.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
Expand All @@ -12,5 +13,8 @@ spec:
matchLabels:
{{- include "loki.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: memcached-results-cache
maxUnavailable: 1
{{- end -}}
{{- with .Values.resultsCache.PodDisruptionBudget.maxUnavailable}}
maxUnavailable: {{ . | default 1}}
{{- end }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{{- $isSimpleScalable := eq (include "loki.deployment.isScalable" .) "true" -}}
{{- if and $isSimpleScalable (gt (int .Values.write.replicas) 1) }}
{{- if .Values.write.PodDisruptionBudget.create }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
Expand All @@ -11,5 +10,7 @@ spec:
selector:
matchLabels:
{{- include "loki.writeSelectorLabels" . | nindent 6 }}
maxUnavailable: 1
{{- with .Values.write.PodDisruptionBudget.maxUnavailable }}
maxUnavailable: {{ . | default 1 }}
{{- end }}
{{- end }}
Loading

0 comments on commit d5d459c

Please sign in to comment.