Skip to content

Commit

Permalink
Merge pull request #2027 from dimunech/loki-distributed-pdb-creation-…
Browse files Browse the repository at this point in the history
…condition

[loki-distributed] Do not create PDBs if maxUnavailable value is not set
  • Loading branch information
zanhsieh committed Dec 1, 2022
2 parents c10d8e3 + c659ac7 commit ae614c2
Show file tree
Hide file tree
Showing 14 changed files with 50 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/loki-distributed/Chart.yaml
Expand Up @@ -3,7 +3,7 @@ name: loki-distributed
description: Helm chart for Grafana Loki in microservices mode
type: application
appVersion: 2.6.1
version: 0.66.3
version: 0.66.4
home: https://grafana.github.io/helm-charts
sources:
- https://github.com/grafana/loki
Expand Down
2 changes: 1 addition & 1 deletion charts/loki-distributed/README.md
@@ -1,6 +1,6 @@
# loki-distributed

![Version: 0.66.3](https://img.shields.io/badge/Version-0.66.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.6.1](https://img.shields.io/badge/AppVersion-2.6.1-informational?style=flat-square)
![Version: 0.66.4](https://img.shields.io/badge/Version-0.66.4-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.6.1](https://img.shields.io/badge/AppVersion-2.6.1-informational?style=flat-square)

Helm chart for Grafana Loki in microservices mode

Expand Down
@@ -1,4 +1,7 @@
{{- if gt (int .Values.distributor.replicas) 1 }}
{{- if not .Values.distributor.maxUnavailable }}
{{- fail "`.Values.distributor.maxUnavailable` must be set when `.Values.distributor.replicas` is greater than 1." }}
{{- else }}
apiVersion: {{ include "loki.pdb.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
Expand All @@ -13,3 +16,4 @@ spec:
maxUnavailable: {{ . }}
{{- end }}
{{- end }}
{{- end }}
@@ -1,4 +1,7 @@
{{- if and .Values.gateway.enabled (gt (int .Values.gateway.replicas) 1) }}
{{- if not .Values.gateway.maxUnavailable }}
{{- fail "`.Values.gateway.maxUnavailable` must be set when `.Values.gateway.replicas` is greater than 1." }}
{{- else }}
apiVersion: {{ include "loki.pdb.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
Expand All @@ -13,3 +16,4 @@ spec:
maxUnavailable: {{ . }}
{{- end }}
{{- end }}
{{- end }}
@@ -1,4 +1,7 @@
{{- if and .Values.indexGateway.enabled (gt (int .Values.indexGateway.replicas) 1) }}
{{- if not .Values.indexGateway.maxUnavailable }}
{{- fail "`.Values.indexGateway.maxUnavailable` must be set when `.Values.indexGateway.replicas` is greater than 1." }}
{{- else }}
apiVersion: {{ include "loki.pdb.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
Expand All @@ -13,3 +16,4 @@ spec:
maxUnavailable: {{ . }}
{{- end }}
{{- end }}
{{- end }}
@@ -1,4 +1,7 @@
{{- if gt (int .Values.ingester.replicas) 1 }}
{{- if not .Values.ingester.maxUnavailable }}
{{- fail "`.Values.ingester.maxUnavailable` must be set when `.Values.ingester.replicas` is greater than 1." }}
{{- else }}
apiVersion: {{ include "loki.pdb.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
Expand All @@ -13,3 +16,4 @@ spec:
maxUnavailable: {{ . }}
{{- end }}
{{- end }}
{{- end }}
@@ -1,4 +1,7 @@
{{- if and .Values.memcachedChunks.enabled (gt (int .Values.memcachedChunks.replicas) 1) }}
{{- if not .Values.memcachedChunks.maxUnavailable }}
{{- fail "`.Values.memcachedChunks.maxUnavailable` must be set when `.Values.memcachedChunks.replicas` is greater than 1." }}
{{- else }}
apiVersion: {{ include "loki.pdb.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
Expand All @@ -13,3 +16,4 @@ spec:
maxUnavailable: {{ . }}
{{- end }}
{{- end }}
{{- end }}
@@ -1,4 +1,7 @@
{{- if and .Values.memcachedFrontend.enabled (gt (int .Values.memcachedFrontend.replicas) 1) }}
{{- if not .Values.memcachedFrontend.maxUnavailable }}
{{- fail "`.Values.memcachedFrontend.maxUnavailable` must be set when `.Values.memcachedFrontend.replicas` is greater than 1." }}
{{- else }}
apiVersion: {{ include "loki.pdb.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
Expand All @@ -13,3 +16,4 @@ spec:
maxUnavailable: {{ . }}
{{- end }}
{{- end }}
{{- end }}
@@ -1,4 +1,7 @@
{{- if and .Values.memcachedIndexQueries.enabled (gt (int .Values.memcachedIndexQueries.replicas) 1) }}
{{- if not .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:
Expand All @@ -13,3 +16,4 @@ spec:
maxUnavailable: {{ . }}
{{- end }}
{{- end }}
{{- end }}
@@ -1,4 +1,7 @@
{{- if and .Values.memcachedIndexWrites.enabled (gt (int .Values.memcachedIndexWrites.replicas) 1) }}
{{- if not .Values.memcachedIndexWrites.maxUnavailable }}
{{- fail "`.Values.memcachedIndexWrites.maxUnavailable` must be set when `.Values.memcachedIndexWrites.replicas` is greater than 1." }}
{{- else }}
apiVersion: {{ include "loki.pdb.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
Expand All @@ -13,3 +16,4 @@ spec:
maxUnavailable: {{ . }}
{{- end }}
{{- end }}
{{- end }}
@@ -1,4 +1,7 @@
{{- if gt (int .Values.querier.replicas) 1 }}
{{- if not .Values.querier.maxUnavailable }}
{{- fail "`.Values.querier.maxUnavailable` must be set when `.Values.querier.replicas` is greater than 1." }}
{{- else }}
apiVersion: {{ include "loki.pdb.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
Expand All @@ -13,3 +16,4 @@ spec:
maxUnavailable: {{ . }}
{{- end }}
{{- end }}
{{- end }}
@@ -1,4 +1,7 @@
{{- if gt (int .Values.queryFrontend.replicas) 1 }}
{{- if not .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:
Expand All @@ -13,3 +16,4 @@ spec:
maxUnavailable: {{ . }}
{{- end }}
{{- end }}
{{- end }}
@@ -1,4 +1,7 @@
{{- if and .Values.queryScheduler.enabled (gt (int .Values.queryScheduler.replicas) 1) }}
{{- if not .Values.queryScheduler.maxUnavailable }}
{{- fail "`.Values.queryScheduler.maxUnavailable` must be set when `.Values.queryScheduler.replicas` is greater than 1." }}
{{- else }}
apiVersion: {{ include "loki.pdb.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
Expand All @@ -13,3 +16,4 @@ spec:
maxUnavailable: {{ . }}
{{- end }}
{{- end }}
{{- end }}
@@ -1,4 +1,7 @@
{{- if and .Values.ruler.enabled (gt (int .Values.ruler.replicas) 1) }}
{{- if not .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:
Expand All @@ -13,3 +16,4 @@ spec:
maxUnavailable: {{ . }}
{{- end }}
{{- end }}
{{- end }}

0 comments on commit ae614c2

Please sign in to comment.