From ff983152f6b3ee2196475212cad71123235521f7 Mon Sep 17 00:00:00 2001 From: Marc Sensenich Date: Mon, 28 Nov 2022 11:57:49 -0500 Subject: [PATCH 1/3] [loki-distributed] Add headless service to query frontend Adds an additional headless service to the query frontend to be used by NGINX for round-robin traffic routing to the query frontend pods. Signed-off-by: Marc Sensenich --- charts/loki-distributed/Chart.yaml | 2 +- charts/loki-distributed/README.md | 2 +- .../service-query-frontend-headless.yaml | 39 +++++++++++++++++++ charts/loki-distributed/values.yaml | 4 +- 4 files changed, 43 insertions(+), 4 deletions(-) create mode 100644 charts/loki-distributed/templates/query-frontend/service-query-frontend-headless.yaml diff --git a/charts/loki-distributed/Chart.yaml b/charts/loki-distributed/Chart.yaml index 2425ea3fe4..b72eebb048 100644 --- a/charts/loki-distributed/Chart.yaml +++ b/charts/loki-distributed/Chart.yaml @@ -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.2 +version: 0.66.3 home: https://grafana.github.io/helm-charts sources: - https://github.com/grafana/loki diff --git a/charts/loki-distributed/README.md b/charts/loki-distributed/README.md index 047bb2a075..c600d105ab 100644 --- a/charts/loki-distributed/README.md +++ b/charts/loki-distributed/README.md @@ -1,6 +1,6 @@ # loki-distributed -![Version: 0.66.2](https://img.shields.io/badge/Version-0.66.2-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.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) Helm chart for Grafana Loki in microservices mode diff --git a/charts/loki-distributed/templates/query-frontend/service-query-frontend-headless.yaml b/charts/loki-distributed/templates/query-frontend/service-query-frontend-headless.yaml new file mode 100644 index 0000000000..255a56ae52 --- /dev/null +++ b/charts/loki-distributed/templates/query-frontend/service-query-frontend-headless.yaml @@ -0,0 +1,39 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "loki.queryFrontendFullname" . }}-headless + labels: + {{- include "loki.queryFrontendLabels" . | nindent 4 }} + {{- with .Values.queryFrontend.serviceLabels }} + {{- toYaml . | nindent 4 }} + {{- end }} + prometheus.io/service-monitor: "false" + {{- with .Values.loki.serviceAnnotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + clusterIP: None + type: ClusterIP + publishNotReadyAddresses: true + ports: + - name: http + port: 3100 + targetPort: http + protocol: TCP + - name: grpc + port: 9095 + targetPort: grpc + protocol: TCP + {{- if .Values.queryFrontend.appProtocol.grpc }} + appProtocol: {{ .Values.queryFrontend.appProtocol.grpc }} + {{- end }} + - name: grpclb + port: 9096 + targetPort: grpc + protocol: TCP + {{- if .Values.queryFrontend.appProtocol.grpc }} + appProtocol: {{ .Values.queryFrontend.appProtocol.grpc }} + {{- end }} + selector: + {{- include "loki.queryFrontendSelectorLabels" . | nindent 4 }} diff --git a/charts/loki-distributed/values.yaml b/charts/loki-distributed/values.yaml index 03d2f02fc8..c8b61405b8 100644 --- a/charts/loki-distributed/values.yaml +++ b/charts/loki-distributed/values.yaml @@ -1064,7 +1064,7 @@ gateway: } location ~ /api/prom/.* { - set $api_prom_backend http://{{ include "loki.queryFrontendFullname" . }}.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + set $api_prom_backend http://{{ include "loki.queryFrontendFullname" . }}-headless.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; proxy_pass $api_prom_backend:3100$request_uri; proxy_http_version 1.1; } @@ -1084,7 +1084,7 @@ gateway: } location ~ /loki/api/.* { - set $loki_api_backend http://{{ include "loki.queryFrontendFullname" . }}.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + set $loki_api_backend http://{{ include "loki.queryFrontendFullname" . }}-headless.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; proxy_pass $loki_api_backend:3100$request_uri; proxy_http_version 1.1; } From 7e116bce9d13c10643c357151f39802413613f8e Mon Sep 17 00:00:00 2001 From: MH Date: Thu, 12 Jan 2023 06:10:38 +0800 Subject: [PATCH 2/3] Update charts/loki-distributed/Chart.yaml Signed-off-by: MH --- charts/loki-distributed/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/loki-distributed/Chart.yaml b/charts/loki-distributed/Chart.yaml index a9014ed516..da31854cac 100644 --- a/charts/loki-distributed/Chart.yaml +++ b/charts/loki-distributed/Chart.yaml @@ -3,7 +3,7 @@ name: loki-distributed description: Helm chart for Grafana Loki in microservices mode type: application appVersion: 2.6.1 -version: 0.67.3 +version: 0.68.0 home: https://grafana.github.io/helm-charts sources: - https://github.com/grafana/loki From bffce0755555f7a860c3643b18af14e9aea25cea Mon Sep 17 00:00:00 2001 From: MH Date: Thu, 12 Jan 2023 06:10:52 +0800 Subject: [PATCH 3/3] Update charts/loki-distributed/README.md Signed-off-by: MH --- charts/loki-distributed/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/loki-distributed/README.md b/charts/loki-distributed/README.md index 406950dad2..3ebfb287b4 100644 --- a/charts/loki-distributed/README.md +++ b/charts/loki-distributed/README.md @@ -1,6 +1,6 @@ # loki-distributed -![Version: 0.67.3](https://img.shields.io/badge/Version-0.67.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.68.0](https://img.shields.io/badge/Version-0.68.0-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