Skip to content

Commit 052467d

Browse files
committed
[loki] Set deploymentMode to Monolithic
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
1 parent 70b4414 commit 052467d

26 files changed

+186
-223
lines changed

charts/loki/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Helm chart for Grafana Loki supporting monolithic, simple scalable,
44
type: application
55
# renovate: docker=docker.io/grafana/loki
66
appVersion: 3.7.1
7-
version: 11.4.5
7+
version: 12.0.0
88
kubeVersion: ">=1.25.0-0"
99
home: https://grafana-community.github.io/helm-charts
1010
sources:

charts/loki/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,15 @@ See the [changelog](https://grafana-community.github.io/helm-charts/changelog/?c
5353

5454
## Upgrading
5555

56+
### From 11.x to 12.0.0 ([#258](https://github.com/grafana-community/helm-charts/pull/258))
57+
58+
The `deploymentMode` default value has been changed to `Monolithic`. `SingleBinary` has been renamed to `Monolithic`.
59+
The old naming `SingleBinary` is still supported. `SimpleScalable` is still supported but will be removed in Loki 4.0.0.
60+
61+
Actions required:
62+
- If you are using `SimpleScalable` deployment mode, you have to explicitly set `deploymentMode: SimpleScalable` in your values file to avoid breaking changes. Consider migrating to `Monolithic` deployment mode as `SimpleScalable` will be removed in Loki 4.0.0.
63+
- If you are using `SingleBinary` deployment mode, you have to explicitly set `deploymentMode: Monolithic` in your values file to avoid breaking changes.
64+
5665
### From 10.x to 11.0.0 ([#273](https://github.com/grafana-community/helm-charts/pull/273))
5766

5867
The `read.legacyReadTarget` option has been removed. Simple scalable deployments always requires a dedicated backend target.

charts/loki/ci/default-single-binary-filesystem-values.yaml renamed to charts/loki/ci/default-monolithic-filesystem-values.yaml

File renamed without changes.

charts/loki/ci/default-single-binary-values.yaml renamed to charts/loki/ci/default-ssd-values.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@ loki:
88
chunks: chunks
99
ruler: ruler
1010
admin: admin
11-
deploymentMode: SingleBinary
12-
singleBinary:
13-
replicas: 1
11+
deploymentMode: SimpleScalable
1412
read:
15-
replicas: 0
13+
replicas: 1
1614
write:
17-
replicas: 0
15+
replicas: 1
1816
backend:
19-
replicas: 0
17+
replicas: 1
18+
sidecar:
19+
rules:
20+
enabled: true

charts/loki/ci/default-values.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@ loki:
88
chunks: chunks
99
ruler: ruler
1010
admin: admin
11-
read:
11+
deploymentMode: Monolithic
12+
singleBinary:
1213
replicas: 1
14+
read:
15+
replicas: 0
1316
write:
14-
replicas: 1
17+
replicas: 0
1518
backend:
16-
replicas: 1
19+
replicas: 0
1720

1821
sidecar:
1922
rules:

charts/loki/ci/ingress-values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
deploymentMode: SimpleScalable
23
gateway:
34
ingress:
45
enabled: true
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
commonLabels:
33
labelA: valueA
4-
labelA: valueB
4+
labelB: valueB
55
loki:
66
commonConfig:
77
replication_factor: 1
@@ -31,7 +31,7 @@ loki:
3131
# - path: /
3232
# pathType: Prefix
3333

34-
deploymentMode: SingleBinary
34+
deploymentMode: Monolithic
3535
singleBinary:
3636
replicas: 1
3737
resources:

charts/loki/templates/NOTES.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ If pods are taking too long to schedule make sure pod affinity can be fulfilled
1717
Installed components:
1818
***********************************************************************
1919

20-
{{- if eq (include "loki.deployment.isSingleBinary" .) "true" }}
20+
{{- if eq (include "loki.deployment.isMonolithic" .) "true" }}
2121
* loki
2222
{{- else -}}
2323
{{- if .Values.gateway.enabled }}
@@ -43,7 +43,7 @@ Installed components:
4343
{{- end }}
4444

4545

46-
{{- if eq (include "loki.deployment.isSingleBinary" .) "true" }}
46+
{{- if eq (include "loki.deployment.isMonolithic" .) "true" }}
4747

4848
Loki has been deployed as a single binary.
4949
This means a single pod is handling reads and writes. You can scale that pod vertically by adding more CPU and memory resources.
@@ -68,9 +68,9 @@ You can send logs from inside the cluster using the cluster DNS:
6868
http://{{ include "loki.gatewayFullname" . }}.{{ include "loki.namespace" . }}.svc.{{ .Values.global.clusterDomain }}/loki/api/v1/push
6969

7070
{{- else }}
71-
{{- if eq (include "loki.deployment.isSingleBinary" .) "true" }}
71+
{{- if eq (include "loki.deployment.isMonolithic" .) "true" }}
7272

73-
http://{{ include "loki.singleBinaryFullname" . }}.{{ include "loki.namespace" . }}.svc.{{ .Values.global.clusterDomain }}:{{ .Values.loki.server.http_listen_port }}/loki/api/v1/push
73+
http://{{ include "loki.monolithicFullname" . }}.{{ include "loki.namespace" . }}.svc.{{ .Values.global.clusterDomain }}:{{ .Values.loki.server.http_listen_port }}/loki/api/v1/push
7474

7575
{{- end}}
7676
{{- if eq (include "loki.deployment.isScalable" .) "true" }}
@@ -91,9 +91,9 @@ You can test to send data from outside the cluster by port-forwarding the gatewa
9191
kubectl port-forward --namespace {{ include "loki.namespace" $ }} svc/{{ include "loki.gatewayFullname" . }} 3100:{{ .Values.gateway.service.port }} &
9292

9393
{{- else }}
94-
{{- if eq (include "loki.deployment.isSingleBinary" .) "true" }}
94+
{{- if eq (include "loki.deployment.isMonolithic" .) "true" }}
9595

96-
kubectl port-forward --namespace {{ include "loki.namespace" $ }} svc/{{ include "loki.singleBinaryFullname" . }} 3100:{{ .Values.loki.server.http_listen_port }} &
96+
kubectl port-forward --namespace {{ include "loki.namespace" $ }} svc/{{ include "loki.monolithicFullname" . }} 3100:{{ .Values.loki.server.http_listen_port }} &
9797

9898
{{- end}}
9999
{{- if eq (include "loki.deployment.isScalable" .) "true" }}
@@ -135,9 +135,9 @@ If Grafana operates within the cluster, you'll set up a new Loki datasource by u
135135
http://{{ include "loki.gatewayFullname" . }}.{{ include "loki.namespace" . }}.svc.{{ .Values.global.clusterDomain }}/
136136

137137
{{- else }}
138-
{{- if eq (include "loki.deployment.isSingleBinary" .) "true" }}
138+
{{- if eq (include "loki.deployment.isMonolithic" .) "true" }}
139139

140-
http://{{ include "loki.singleBinaryFullname" . }}.{{ include "loki.namespace" . }}.svc.{{ .Values.global.clusterDomain }}:{{ .Values.loki.server.http_listen_port }}/
140+
http://{{ include "loki.monolithicFullname" . }}.{{ include "loki.namespace" . }}.svc.{{ .Values.global.clusterDomain }}:{{ .Values.loki.server.http_listen_port }}/
141141

142142
{{- end}}
143143
{{- if eq (include "loki.deployment.isScalable" .) "true" }}

charts/loki/templates/_helpers.tpl

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ Allow the release namespace to be overridden for multi-namespace deployments in
2929
{{- end -}}
3030

3131
{{/*
32-
singleBinary fullname
32+
monolithic fullname
3333
*/}}
34-
{{- define "loki.singleBinaryFullname" -}}
34+
{{- define "loki.monolithicFullname" -}}
3535
{{- if .Values.fullnameOverride -}}
3636
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
3737
{{- else -}}
@@ -66,14 +66,14 @@ Params:
6666
Return if deployment mode is simple scalable
6767
*/}}
6868
{{- define "loki.deployment.isScalable" -}}
69-
{{- and (eq (include "loki.isUsingObjectStorage" . ) "true") (or (eq .Values.deploymentMode "SingleBinary<->SimpleScalable") (eq .Values.deploymentMode "SimpleScalable") (eq .Values.deploymentMode "SimpleScalable<->Distributed")) }}
69+
{{- and (eq (include "loki.isUsingObjectStorage" . ) "true") (or (eq .Values.deploymentMode "SingleBinary<->SimpleScalable") (eq .Values.deploymentMode "Monolithic<->SimpleScalable") (eq .Values.deploymentMode "SimpleScalable") (eq .Values.deploymentMode "SimpleScalable<->Distributed")) }}
7070
{{- end -}}
7171

7272
{{/*
7373
Return if deployment mode is single binary
7474
*/}}
75-
{{- define "loki.deployment.isSingleBinary" -}}
76-
{{- or (eq .Values.deploymentMode "SingleBinary") (eq .Values.deploymentMode "SingleBinary<->SimpleScalable") }}
75+
{{- define "loki.deployment.isMonolithic" -}}
76+
{{- or (eq .Values.deploymentMode "SingleBinary") (eq .Values.deploymentMode "Monolithic") (eq .Values.deploymentMode "SingleBinary<->SimpleScalable") (eq .Values.deploymentMode "Monolithic<->SimpleScalable") }}
7777
{{- end -}}
7878

7979
{{/*
@@ -465,8 +465,8 @@ configMap:
465465
Generate list of ingress service paths based on deployment type
466466
*/}}
467467
{{- define "loki.ingress.servicePaths" -}}
468-
{{- if (eq (include "loki.deployment.isSingleBinary" .) "true") -}}
469-
{{- include "loki.ingress.singleBinaryServicePaths" . }}
468+
{{- if (eq (include "loki.deployment.isMonolithic" .) "true") -}}
469+
{{- include "loki.ingress.monolithicServicePaths" . }}
470470
{{- else if (eq (include "loki.deployment.isDistributed" .) "true") -}}
471471
{{- include "loki.ingress.distributedServicePaths" . }}
472472
{{- else if and (eq (include "loki.deployment.isScalable" .) "true") -}}
@@ -504,8 +504,8 @@ Ingress service paths for simple scalable deployment when backend components wer
504504
{{/*
505505
Ingress service paths for single binary deployment
506506
*/}}
507-
{{- define "loki.ingress.singleBinaryServicePaths" -}}
508-
{{- $serviceName := include "loki.singleBinaryFullname" . }}
507+
{{- define "loki.ingress.monolithicServicePaths" -}}
508+
{{- $serviceName := include "loki.monolithicFullname" . }}
509509
{{- include "loki.ingress.servicePath" (dict "ctx" . "serviceName" $serviceName "paths" .Values.ingress.paths.distributor )}}
510510
{{- include "loki.ingress.servicePath" (dict "ctx" . "serviceName" $serviceName "paths" .Values.ingress.paths.queryFrontend )}}
511511
{{- include "loki.ingress.servicePath" (dict "ctx" . "serviceName" $serviceName "paths" .Values.ingress.paths.ruler )}}
@@ -561,10 +561,10 @@ Create the service endpoint including port for MinIO.
561561

562562
{{/* Determine the public host for the Loki cluster */}}
563563
{{- define "loki.host" -}}
564-
{{- $isSingleBinary := eq (include "loki.deployment.isSingleBinary" .) "true" -}}
564+
{{- $isMonolithic := eq (include "loki.deployment.isMonolithic" .) "true" -}}
565565
{{- $url := printf "%s.%s.svc.%s.:%s" (include "loki.resourceName" (dict "ctx" . "component" "gateway")) (include "loki.namespace" .) .Values.global.clusterDomain (.Values.gateway.service.port | toString) }}
566-
{{- if and $isSingleBinary (not .Values.gateway.enabled) }}
567-
{{- $url = printf "%s.%s.svc.%s.:%s" (include "loki.singleBinaryFullname" .) (include "loki.namespace" .) .Values.global.clusterDomain (.Values.loki.server.http_listen_port | toString) }}
566+
{{- if and $isMonolithic (not .Values.gateway.enabled) }}
567+
{{- $url = printf "%s.%s.svc.%s.:%s" (include "loki.monolithicFullname" .) (include "loki.namespace" .) .Values.global.clusterDomain (.Values.loki.server.http_listen_port | toString) }}
568568
{{- end }}
569569
{{- printf "%s" $url -}}
570570
{{- end -}}
@@ -704,8 +704,8 @@ http {
704704
{{- $backendUrl = .Values.gateway.nginxConfig.customBackendUrl }}
705705
{{- end }}
706706

707-
{{- $singleBinaryHost := include "loki.singleBinaryFullname" . }}
708-
{{- $singleBinaryUrl := printf "%s://%s.%s.svc.%s:%s" $httpSchema $singleBinaryHost $namespace .Values.global.clusterDomain (.Values.loki.server.http_listen_port | toString) }}
707+
{{- $monolithicHost := include "loki.monolithicFullname" . }}
708+
{{- $monolithicUrl := printf "%s://%s.%s.svc.%s:%s" $httpSchema $monolithicHost $namespace .Values.global.clusterDomain (.Values.loki.server.http_listen_port | toString) }}
709709

710710
{{- $distributorHost := include "loki.resourceName" (dict "ctx" . "component" "distributor") }}
711711
{{- $ingesterHost := include "loki.resourceName" (dict "ctx" . "component" "ingester") }}
@@ -725,15 +725,15 @@ http {
725725
{{- $schedulerUrl := printf "%s://%s.%s.svc.%s:%s" $httpSchema $schedulerHost $namespace .Values.global.clusterDomain (.Values.loki.server.http_listen_port | toString) }}
726726
{{- $querierUrl := printf "%s://%s.%s.svc.%s:%s" $httpSchema $querierHost $namespace .Values.global.clusterDomain (.Values.loki.server.http_listen_port | toString) }}
727727

728-
{{- if eq (include "loki.deployment.isSingleBinary" .) "true"}}
729-
{{- $distributorUrl = $singleBinaryUrl }}
730-
{{- $ingesterUrl = $singleBinaryUrl }}
731-
{{- $queryFrontendUrl = $singleBinaryUrl }}
732-
{{- $indexGatewayUrl = $singleBinaryUrl }}
733-
{{- $rulerUrl = $singleBinaryUrl }}
734-
{{- $compactorUrl = $singleBinaryUrl }}
735-
{{- $schedulerUrl = $singleBinaryUrl }}
736-
{{- $querierUrl = $singleBinaryUrl }}
728+
{{- if eq (include "loki.deployment.isMonolithic" .) "true"}}
729+
{{- $distributorUrl = $monolithicUrl }}
730+
{{- $ingesterUrl = $monolithicUrl }}
731+
{{- $queryFrontendUrl = $monolithicUrl }}
732+
{{- $indexGatewayUrl = $monolithicUrl }}
733+
{{- $rulerUrl = $monolithicUrl }}
734+
{{- $compactorUrl = $monolithicUrl }}
735+
{{- $schedulerUrl = $monolithicUrl }}
736+
{{- $querierUrl = $monolithicUrl }}
737737
{{- else if eq (include "loki.deployment.isScalable" .) "true"}}
738738
{{- $distributorUrl = $writeUrl }}
739739
{{- $ingesterUrl = $writeUrl }}
@@ -994,11 +994,11 @@ enableServiceLinks: false
994994
{{- define "loki.compactorAddress" -}}
995995
{{- $isSimpleScalable := eq (include "loki.deployment.isScalable" .) "true" -}}
996996
{{- $isDistributed := eq (include "loki.deployment.isDistributed" .) "true" -}}
997-
{{- $isSingleBinary := eq (include "loki.deployment.isSingleBinary" .) "true" -}}
997+
{{- $isMonolithic := eq (include "loki.deployment.isMonolithic" .) "true" -}}
998998
{{- $compactorAddress := include "loki.resourceName" (dict "ctx" . "component" "backend") -}}
999-
{{- if $isSingleBinary -}}
999+
{{- if $isMonolithic -}}
10001000
{{/* single binary */}}
1001-
{{- $compactorAddress = include "loki.singleBinaryFullname" . -}}
1001+
{{- $compactorAddress = include "loki.monolithicFullname" . -}}
10021002
{{/* distributed */}}
10031003
{{- else if $isDistributed -}}
10041004
{{- $compactorAddress = include "loki.resourceName" (dict "ctx" . "component" "compactor") -}}

charts/loki/templates/backend/statefulset.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ metadata:
1717
{{- end }}
1818
spec:
1919
{{- if and (not .Values.backend.autoscaling.enabled) (not .Values.backend.kedaAutoscaling.enabled) }}
20-
{{- if eq .Values.deploymentMode "SingleBinary" }}
20+
{{- if or (eq .Values.deploymentMode "SingleBinary") (eq .Values.deploymentMode "Monolithic") }}
2121
replicas: 0
2222
{{- else }}
2323
replicas: {{ .Values.backend.replicas }}

0 commit comments

Comments
 (0)