Skip to content

Commit

Permalink
feat(helm): add pdb for compactor
Browse files Browse the repository at this point in the history
  • Loading branch information
LukoJy3D committed Feb 13, 2025
1 parent 1a9f382 commit a735698
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 1 deletion.
10 changes: 10 additions & 0 deletions docs/sources/setup/install/helm/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -2273,6 +2273,7 @@ null
},
"initContainers": [],
"livenessProbe": {},
"maxUnavailable": null,
"nodeSelector": {},
"persistence": {
"annotations": {},
Expand Down Expand Up @@ -2446,6 +2447,15 @@ null
<td><pre lang="json">
{}
</pre>
</td>
</tr>
<tr>
<td>compactor.maxUnavailable</td>
<td>string</td>
<td>Pod Disruption Budget maxUnavailable</td>
<td><pre lang="json">
null
</pre>
</td>
</tr>
<tr>
Expand Down
3 changes: 2 additions & 1 deletion production/helm/loki/distributed-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ distributor:
replicas: 3
maxUnavailable: 2
compactor:
replicas: 1
replicas: 2
maxUnavailable: 1
indexGateway:
replicas: 2
maxUnavailable: 1
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{- $isDistributed := eq (include "loki.deployment.isDistributed" .) "true" -}}
{{- if and $isDistributed (gt (int .Values.compactor.replicas) 1) }}
{{- if kindIs "invalid" .Values.compactor.maxUnavailable }}
{{- fail "`.Values.compactor.maxUnavailable` must be set when `.Values.compactor.replicas` is greater than 1." }}
{{- else }}
apiVersion: {{ include "loki.pdb.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
name: {{ include "loki.compactorFullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "loki.compactorLabels" . | nindent 4 }}
spec:
selector:
matchLabels:
{{- include "loki.compactorSelectorLabels" . | nindent 6 }}
{{- with .Values.compactor.maxUnavailable }}
maxUnavailable: {{ . }}
{{- end }}
{{- end }}
{{- end }}
2 changes: 2 additions & 0 deletions production/helm/loki/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2395,6 +2395,8 @@ compactor:
matchLabels:
app.kubernetes.io/component: compactor
topologyKey: kubernetes.io/hostname
# -- Pod Disruption Budget maxUnavailable
maxUnavailable: null
# -- Labels for compactor service
serviceLabels: {}
# -- Annotations for compactor service
Expand Down

0 comments on commit a735698

Please sign in to comment.