diff --git a/docs/sources/setup/install/helm/reference.md b/docs/sources/setup/install/helm/reference.md
index 2a538a751617..53101a483214 100644
--- a/docs/sources/setup/install/helm/reference.md
+++ b/docs/sources/setup/install/helm/reference.md
@@ -5086,29 +5086,37 @@ null
"ingressClassName": "",
"labels": {},
"paths": {
- "read": [
- "/api/prom/tail",
- "/loki/api/v1/tail",
- "/loki/api",
- "/api/prom/rules",
- "/loki/api/v1/rules",
- "/prometheus/api/v1/rules",
- "/prometheus/api/v1/alerts"
- ],
- "singleBinary": [
+ "distributor": [
"/api/prom/push",
"/loki/api/v1/push",
+ "/otlp/v1/logs"
+ ],
+ "queryFrontend": [
+ "/api/prom/query",
+ "/api/prom/label",
+ "/api/prom/series",
"/api/prom/tail",
+ "/loki/api/v1/query",
+ "/loki/api/v1/query_range",
"/loki/api/v1/tail",
- "/loki/api",
+ "/loki/api/v1/label",
+ "/loki/api/v1/labels",
+ "/loki/api/v1/series",
+ "/loki/api/v1/index/stats",
+ "/loki/api/v1/index/volume",
+ "/loki/api/v1/index/volume_range",
+ "/loki/api/v1/format_query",
+ "/loki/api/v1/detected_fields",
+ "/loki/api/v1/detected_labels",
+ "/loki/api/v1/patterns"
+ ],
+ "ruler": [
"/api/prom/rules",
+ "/api/prom/api/v1/rules",
+ "/api/prom/api/v1/alerts",
"/loki/api/v1/rules",
"/prometheus/api/v1/rules",
"/prometheus/api/v1/alerts"
- ],
- "write": [
- "/api/prom/push",
- "/loki/api/v1/push"
]
},
"tls": []
@@ -5125,6 +5133,62 @@ null
"loki.example.com"
]
+
+
+
+ ingress.paths.distributor |
+ list |
+ Paths that are exposed by Loki Distributor. If deployment mode is Distributed, the requests are forwarded to the service: `{{"loki.distributorFullname"}}`. If deployment mode is SimpleScalable, the requests are forwarded to write k8s service: `{{"loki.writeFullname"}}`. If deployment mode is SingleBinary, the requests are forwarded to the central/single k8s service: `{{"loki.singleBinaryFullname"}}` |
+
+[
+ "/api/prom/push",
+ "/loki/api/v1/push",
+ "/otlp/v1/logs"
+]
+
+ |
+
+
+ ingress.paths.queryFrontend |
+ list |
+ Paths that are exposed by Loki Query Frontend. If deployment mode is Distributed, the requests are forwarded to the service: `{{"loki.queryFrontendFullname"}}`. If deployment mode is SimpleScalable, the requests are forwarded to write k8s service: `{{"loki.readFullname"}}`. If deployment mode is SingleBinary, the requests are forwarded to the central/single k8s service: `{{"loki.singleBinaryFullname"}}` |
+
+[
+ "/api/prom/query",
+ "/api/prom/label",
+ "/api/prom/series",
+ "/api/prom/tail",
+ "/loki/api/v1/query",
+ "/loki/api/v1/query_range",
+ "/loki/api/v1/tail",
+ "/loki/api/v1/label",
+ "/loki/api/v1/labels",
+ "/loki/api/v1/series",
+ "/loki/api/v1/index/stats",
+ "/loki/api/v1/index/volume",
+ "/loki/api/v1/index/volume_range",
+ "/loki/api/v1/format_query",
+ "/loki/api/v1/detected_fields",
+ "/loki/api/v1/detected_labels",
+ "/loki/api/v1/patterns"
+]
+
+ |
+
+
+ ingress.paths.ruler |
+ list |
+ Paths that are exposed by Loki Ruler. If deployment mode is Distributed, the requests are forwarded to the service: `{{"loki.rulerFullname"}}`. If deployment mode is SimpleScalable, the requests are forwarded to k8s service: `{{"loki.backendFullname"}}`. If deployment mode is SimpleScalable but `read.legacyReadTarget` is `true`, the requests are forwarded to k8s service: `{{"loki.readFullname"}}`. If deployment mode is SingleBinary, the requests are forwarded to the central/single k8s service: `{{"loki.singleBinaryFullname"}}` |
+
+[
+ "/api/prom/rules",
+ "/api/prom/api/v1/rules",
+ "/api/prom/api/v1/alerts",
+ "/loki/api/v1/rules",
+ "/prometheus/api/v1/rules",
+ "/prometheus/api/v1/alerts"
+]
+
|
diff --git a/production/helm/loki/CHANGELOG.md b/production/helm/loki/CHANGELOG.md
index 8a9f00cf7753..1606c89914f8 100644
--- a/production/helm/loki/CHANGELOG.md
+++ b/production/helm/loki/CHANGELOG.md
@@ -13,6 +13,10 @@ Entries should include a reference to the pull request that introduced the chang
[//]: # ( : do not remove this line. This locator is used by the CI pipeline to automatically create a changelog entry for each new Loki release. Add other chart versions and respective changelog entries bellow this line.)
+## 6.5.2
+
+- [BUGFIX] Fixed Ingress routing for all deployment modes.
+
## 6.5.0
- [CHANGE] Changed version of Grafana Enterprise Logs to v3.0.1
diff --git a/production/helm/loki/Chart.yaml b/production/helm/loki/Chart.yaml
index 595c4b5710cd..989a54d146a1 100644
--- a/production/helm/loki/Chart.yaml
+++ b/production/helm/loki/Chart.yaml
@@ -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.0.0
-version: 6.5.1
+version: 6.5.2
home: https://grafana.github.io/helm-charts
sources:
- https://github.com/grafana/loki
diff --git a/production/helm/loki/README.md b/production/helm/loki/README.md
index 9e0dce69d838..55a7256c72f7 100644
--- a/production/helm/loki/README.md
+++ b/production/helm/loki/README.md
@@ -1,6 +1,6 @@
# loki
-![Version: 6.5.1](https://img.shields.io/badge/Version-6.5.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 3.0.0](https://img.shields.io/badge/AppVersion-3.0.0-informational?style=flat-square)
+![Version: 6.5.2](https://img.shields.io/badge/Version-6.5.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 3.0.0](https://img.shields.io/badge/AppVersion-3.0.0-informational?style=flat-square)
Helm chart for Grafana Loki and Grafana Enterprise Logs supporting both simple, scalable and distributed modes.
diff --git a/production/helm/loki/templates/_helpers.tpl b/production/helm/loki/templates/_helpers.tpl
index c71c6c23aff8..572ef9a5e784 100644
--- a/production/helm/loki/templates/_helpers.tpl
+++ b/production/helm/loki/templates/_helpers.tpl
@@ -607,33 +607,68 @@ Return if ingress supports pathType.
Generate list of ingress service paths based on deployment type
*/}}
{{- define "loki.ingress.servicePaths" -}}
-{{- if (eq (include "loki.deployment.isScalable" .) "true") -}}
+{{- if (eq (include "loki.deployment.isSingleBinary" .) "true") -}}
+{{- include "loki.ingress.singleBinaryServicePaths" . }}
+{{- else if (eq (include "loki.deployment.isDistributed" .) "true") -}}
+{{- include "loki.ingress.distributedServicePaths" . }}
+{{- else if and (eq (include "loki.deployment.isScalable" .) "true") (not .Values.read.legacyReadTarget ) -}}
{{- include "loki.ingress.scalableServicePaths" . }}
{{- else -}}
-{{- include "loki.ingress.singleBinaryServicePaths" . }}
+{{- include "loki.ingress.legacyScalableServicePaths" . }}
+{{- end -}}
{{- end -}}
+
+
+{{/*
+Ingress service paths for distributed deployment
+*/}}
+{{- define "loki.ingress.distributedServicePaths" -}}
+{{- $distributorServiceName := include "loki.distributorFullname" . }}
+{{- include "loki.ingress.servicePath" (dict "ctx" . "serviceName" $distributorServiceName "paths" .Values.ingress.paths.distributor )}}
+{{- $queryFrontendServiceName := include "loki.queryFrontendFullname" . }}
+{{- include "loki.ingress.servicePath" (dict "ctx" . "serviceName" $queryFrontendServiceName "paths" .Values.ingress.paths.queryFrontend )}}
+{{- $rulerServiceName := include "loki.rulerFullname" . }}
+{{- include "loki.ingress.servicePath" (dict "ctx" . "serviceName" $rulerServiceName "paths" .Values.ingress.paths.ruler)}}
{{- end -}}
{{/*
-Ingress service paths for scalable deployment
+Ingress service paths for legacy simple scalable deployment when backend components were part of read component.
*/}}
{{- define "loki.ingress.scalableServicePaths" -}}
-{{- include "loki.ingress.servicePath" (dict "ctx" . "svcName" "read" "paths" .Values.ingress.paths.read )}}
-{{- include "loki.ingress.servicePath" (dict "ctx" . "svcName" "write" "paths" .Values.ingress.paths.write )}}
+{{- $readServiceName := include "loki.readFullname" . }}
+{{- include "loki.ingress.servicePath" (dict "ctx" . "serviceName" $readServiceName "paths" .Values.ingress.paths.queryFrontend )}}
+{{- $writeServiceName := include "loki.writeFullname" . }}
+{{- include "loki.ingress.servicePath" (dict "ctx" . "serviceName" $writeServiceName "paths" .Values.ingress.paths.distributor )}}
+{{- $backendServiceName := include "loki.backendFullname" . }}
+{{- include "loki.ingress.servicePath" (dict "ctx" . "serviceName" $backendServiceName "paths" .Values.ingress.paths.ruler )}}
+{{- end -}}
+
+{{/*
+Ingress service paths for legacy simple scalable deployment
+*/}}
+{{- define "loki.ingress.legacyScalableServicePaths" -}}
+{{- $readServiceName := include "loki.readFullname" . }}
+{{- include "loki.ingress.servicePath" (dict "ctx" . "serviceName" $readServiceName "paths" .Values.ingress.paths.queryFrontend )}}
+{{- include "loki.ingress.servicePath" (dict "ctx" . "serviceName" $readServiceName "paths" .Values.ingress.paths.ruler )}}
+{{- $writeServiceName := include "loki.writeFullname" . }}
+{{- include "loki.ingress.servicePath" (dict "ctx" . "serviceName" $writeServiceName "paths" .Values.ingress.paths.distributor )}}
{{- end -}}
{{/*
Ingress service paths for single binary deployment
*/}}
{{- define "loki.ingress.singleBinaryServicePaths" -}}
-{{- include "loki.ingress.servicePath" (dict "ctx" . "svcName" "singleBinary" "paths" .Values.ingress.paths.singleBinary )}}
+{{- $serviceName := include "loki.singleBinaryFullname" . }}
+{{- include "loki.ingress.servicePath" (dict "ctx" . "serviceName" $serviceName "paths" .Values.ingress.paths.distributor )}}
+{{- include "loki.ingress.servicePath" (dict "ctx" . "serviceName" $serviceName "paths" .Values.ingress.paths.queryFrontend )}}
+{{- include "loki.ingress.servicePath" (dict "ctx" . "serviceName" $serviceName "paths" .Values.ingress.paths.ruler )}}
{{- end -}}
{{/*
Ingress service path helper function
Params:
ctx = . context
- svcName = service name without the "loki.fullname" part (ie. read, write)
+ serviceName = fully qualified k8s service name
paths = list of url paths to allow ingress for
*/}}
{{- define "loki.ingress.servicePath" -}}
@@ -645,33 +680,18 @@ Params:
pathType: Prefix
{{- end }}
backend:
- {{- $serviceName := include "loki.ingress.serviceName" (dict "ctx" $.ctx "svcName" $.svcName) }}
{{- if $ingressApiIsStable }}
service:
- name: {{ $serviceName }}
+ name: {{ $.serviceName }}
port:
number: {{ $.ctx.Values.loki.server.http_listen_port }}
{{- else }}
- serviceName: {{ $serviceName }}
+ serviceName: {{ $.serviceName }}
servicePort: {{ $.ctx.Values.loki.server.http_listen_port }}
{{- end -}}
{{- end -}}
{{- end -}}
-{{/*
-Ingress service name helper function
-Params:
- ctx = . context
- svcName = service name without the "loki.fullname" part (ie. read, write)
-*/}}
-{{- define "loki.ingress.serviceName" -}}
-{{- if (eq .svcName "singleBinary") }}
-{{- printf "%s" (include "loki.singleBinaryFullname" .ctx) }}
-{{- else }}
-{{- printf "%s-%s" (include "loki.name" .ctx) .svcName }}
-{{- end -}}
-{{- end -}}
-
{{/*
Create the service endpoint including port for MinIO.
*/}}
diff --git a/production/helm/loki/values.yaml b/production/helm/loki/values.yaml
index 11e579e6c885..3edfc24ba34f 100644
--- a/production/helm/loki/values.yaml
+++ b/production/helm/loki/values.yaml
@@ -1131,24 +1131,47 @@ ingress:
labels: {}
# blackbox.monitoring.exclude: "true"
paths:
- write:
- - /api/prom/push
- - /loki/api/v1/push
- read:
- - /api/prom/tail
- - /loki/api/v1/tail
- - /loki/api
- - /api/prom/rules
- - /loki/api/v1/rules
- - /prometheus/api/v1/rules
- - /prometheus/api/v1/alerts
- singleBinary:
+ # -- Paths that are exposed by Loki Distributor.
+ # If deployment mode is Distributed, the requests are forwarded to the service: `{{"loki.distributorFullname"}}`.
+ # If deployment mode is SimpleScalable, the requests are forwarded to write k8s service: `{{"loki.writeFullname"}}`.
+ # If deployment mode is SingleBinary, the requests are forwarded to the central/single k8s service: `{{"loki.singleBinaryFullname"}}`
+ distributor:
- /api/prom/push
- /loki/api/v1/push
+ - /otlp/v1/logs
+ # -- Paths that are exposed by Loki Query Frontend.
+ # If deployment mode is Distributed, the requests are forwarded to the service: `{{"loki.queryFrontendFullname"}}`.
+ # If deployment mode is SimpleScalable, the requests are forwarded to write k8s service: `{{"loki.readFullname"}}`.
+ # If deployment mode is SingleBinary, the requests are forwarded to the central/single k8s service: `{{"loki.singleBinaryFullname"}}`
+ queryFrontend:
+ - /api/prom/query
+ # this path covers labels and labelValues endpoints
+ - /api/prom/label
+ - /api/prom/series
- /api/prom/tail
+ - /loki/api/v1/query
+ - /loki/api/v1/query_range
- /loki/api/v1/tail
- - /loki/api
+ # this path covers labels and labelValues endpoints
+ - /loki/api/v1/label
+ - /loki/api/v1/labels
+ - /loki/api/v1/series
+ - /loki/api/v1/index/stats
+ - /loki/api/v1/index/volume
+ - /loki/api/v1/index/volume_range
+ - /loki/api/v1/format_query
+ - /loki/api/v1/detected_fields
+ - /loki/api/v1/detected_labels
+ - /loki/api/v1/patterns
+ # -- Paths that are exposed by Loki Ruler.
+ # If deployment mode is Distributed, the requests are forwarded to the service: `{{"loki.rulerFullname"}}`.
+ # If deployment mode is SimpleScalable, the requests are forwarded to k8s service: `{{"loki.backendFullname"}}`.
+ # If deployment mode is SimpleScalable but `read.legacyReadTarget` is `true`, the requests are forwarded to k8s service: `{{"loki.readFullname"}}`.
+ # If deployment mode is SingleBinary, the requests are forwarded to the central/single k8s service: `{{"loki.singleBinaryFullname"}}`
+ ruler:
- /api/prom/rules
+ - /api/prom/api/v1/rules
+ - /api/prom/api/v1/alerts
- /loki/api/v1/rules
- /prometheus/api/v1/rules
- /prometheus/api/v1/alerts