diff --git a/docs/sources/installation/helm/reference.md b/docs/sources/installation/helm/reference.md index 9071381d552c..bb1211953740 100644 --- a/docs/sources/installation/helm/reference.md +++ b/docs/sources/installation/helm/reference.md @@ -1707,6 +1707,24 @@ true
 {}
 
+ + + + loki.frontend.scheduler_address + string + +
+"{{ include \"loki.querySchedulerAddress\" . }}"
+
+ + + + loki.frontend_worker.scheduler_address + string + +
+"{{ include \"loki.querySchedulerAddress\" . }}"
+
diff --git a/production/helm/loki/CHANGELOG.md b/production/helm/loki/CHANGELOG.md index 2028b3d3051d..e49f391ae280 100644 --- a/production/helm/loki/CHANGELOG.md +++ b/production/helm/loki/CHANGELOG.md @@ -15,6 +15,10 @@ Entries should include a reference to the pull request that introduced the chang - [CHANGE] Add clusterLabelOverride for alert label overrides. +## 5.5.3 + +- [BUGFIX] Fix issue in distribution of queries to available read pods by using k8s service for discovering query-scheduler replicas + ## 5.5.2 - [BUGFIX] Use $.Release.Namespace consistently diff --git a/production/helm/loki/Chart.yaml b/production/helm/loki/Chart.yaml index 43981488fb62..60466294adcc 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 in simple, scalable mode type: application appVersion: 2.8.2 -version: 5.5.2 +version: 5.5.3 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 f96e7d6a9050..bdb0c54f4880 100644 --- a/production/helm/loki/README.md +++ b/production/helm/loki/README.md @@ -1,6 +1,6 @@ # loki -![Version: 5.5.2](https://img.shields.io/badge/Version-5.5.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.8.2](https://img.shields.io/badge/AppVersion-2.8.2-informational?style=flat-square) +![Version: 5.5.3](https://img.shields.io/badge/Version-5.5.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.8.2](https://img.shields.io/badge/AppVersion-2.8.2-informational?style=flat-square) Helm chart for Grafana Loki in simple, scalable mode diff --git a/production/helm/loki/templates/_helpers.tpl b/production/helm/loki/templates/_helpers.tpl index 69adab23038e..f4e3dd8f00db 100644 --- a/production/helm/loki/templates/_helpers.tpl +++ b/production/helm/loki/templates/_helpers.tpl @@ -762,3 +762,12 @@ enableServiceLinks: false {{- printf "%s" $compactorAddress }} {{- end }} +{{/* Determine query-scheduler address */}} +{{- define "loki.querySchedulerAddress" -}} +{{- $isSimpleScalable := eq (include "loki.deployment.isScalable" .) "true" -}} +{{- $schedulerAddress := ""}} +{{- if and $isSimpleScalable (not .Values.read.legacyReadTarget ) -}} +{{- $schedulerAddress = printf "query-scheduler-discovery.%s.svc.%s.:9095" .Release.Namespace .Values.global.clusterDomain -}} +{{- end -}} +{{- printf "%s" $schedulerAddress }} +{{- end }} \ No newline at end of file diff --git a/production/helm/loki/templates/backend/query-scheduler-discovery.yaml b/production/helm/loki/templates/backend/query-scheduler-discovery.yaml new file mode 100644 index 000000000000..01865863e57e --- /dev/null +++ b/production/helm/loki/templates/backend/query-scheduler-discovery.yaml @@ -0,0 +1,26 @@ +{{- $isSimpleScalable := eq (include "loki.deployment.isScalable" .) "true" -}} +{{- if and $isSimpleScalable (not .Values.read.legacyReadTarget ) }} +--- +apiVersion: v1 +kind: Service +metadata: + name: query-scheduler-discovery + labels: + {{- include "loki.backendSelectorLabels" . | nindent 4 }} + prometheus.io/service-monitor: "false" +spec: + type: ClusterIP + clusterIP: None + publishNotReadyAddresses: true + ports: + - name: http-metrics + port: 3100 + targetPort: http-metrics + protocol: TCP + - name: grpc + port: 9095 + targetPort: grpc + protocol: TCP + selector: + {{- include "loki.backendSelectorLabels" . | nindent 4 }} +{{- end }} diff --git a/production/helm/loki/values.yaml b/production/helm/loki/values.yaml index 6f50c9589373..3072c77362e0 100644 --- a/production/helm/loki/values.yaml +++ b/production/helm/loki/values.yaml @@ -207,6 +207,16 @@ loki: index_gateway: {{- tpl (. | toYaml) $ | nindent 4 }} {{- end }} + + {{- with .Values.loki.frontend }} + frontend: + {{- tpl (. | toYaml) $ | nindent 4 }} + {{- end }} + + {{- with .Values.loki.frontend_worker }} + frontend_worker: + {{- tpl (. | toYaml) $ | nindent 4 }} + {{- end }} # Should authentication be enabled auth_enabled: true # Extra memberlist configuration @@ -302,6 +312,10 @@ loki: # -- Optional index gateway configuration index_gateway: mode: ring + frontend: + scheduler_address: '{{ include "loki.querySchedulerAddress" . }}' + frontend_worker: + scheduler_address: '{{ include "loki.querySchedulerAddress" . }}' enterprise: # Enable enterprise features, license must be provided enabled: false