Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions production/helm/loki/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -1183,6 +1183,18 @@ enableServiceLinks: false
{{- printf "%s" $querierAddress }}
{{- end }}

{{/* Determine headless querier address for tail proxy */}}
{{- define "loki.querierHeadlessAddress" -}}
{{- $querierAddress := "" }}
{{- $isDistributed := eq (include "loki.deployment.isDistributed" .) "true" -}}
{{- if $isDistributed -}}
{{- $querierHost := include "loki.querierFullname" .}}
{{- $querierUrl := printf "http://%s-headless.%s.svc.%s:3100" $querierHost .Release.Namespace .Values.global.clusterDomain }}
{{- $querierAddress = $querierUrl }}
{{- end -}}
{{- printf "%s" $querierAddress }}
{{- end }}

{{/* Determine index-gateway address */}}
{{- define "loki.indexGatewayAddress" -}}
{{- $idxGatewayAddress := ""}}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{{- $isDistributed := eq (include "loki.deployment.isDistributed" .) "true" -}}
{{- if $isDistributed -}}
apiVersion: v1
kind: Service
metadata:
name: {{ include "loki.querierFullname" . }}-headless
namespace: {{ .Release.Namespace }}
labels:
{{- include "loki.querierLabels" . | nindent 4 }}
{{- with .Values.querier.serviceLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
Comment on lines +10 to +12
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{{- with .Values.querier.serviceLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.querier.serviceLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
variant: headless
prometheus.io/service-monitor: "false"

Similar to:

variant: headless
prometheus.io/service-monitor: "false"

annotations:
{{- with .Values.loki.serviceAnnotations }}
{{- toYaml . | nindent 4}}
{{- end }}
{{- with .Values.querier.serviceAnnotations }}
{{- toYaml . | nindent 4}}
{{- end }}
spec:
type: ClusterIP
clusterIP: None
ports:
- name: http-metrics
port: 3100
targetPort: http-metrics
protocol: TCP
- name: grpc
port: 9095
targetPort: grpc
protocol: TCP
{{- if .Values.querier.appProtocol.grpc }}
appProtocol: {{ .Values.querier.appProtocol.grpc }}
{{- end }}
selector:
{{- include "loki.querierSelectorLabels" . | nindent 4 }}
{{- end -}}
2 changes: 1 addition & 1 deletion production/helm/loki/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ loki:
mode: simple
frontend:
scheduler_address: '{{ include "loki.querySchedulerAddress" . }}'
tail_proxy_url: '{{ include "loki.querierAddress" . }}'
tail_proxy_url: '{{ include "loki.querierHeadlessAddress" . }}'
frontend_worker:
scheduler_address: '{{ include "loki.querySchedulerAddress" . }}'
# -- Optional distributor configuration
Expand Down
Loading