Skip to content

Commit

Permalink
add headless distributor service and configure enterprise gateway to …
Browse files Browse the repository at this point in the history
…use it by default

Signed-off-by: Edward Welch <edward.welch@grafana.com>
  • Loading branch information
slim-bean committed Mar 18, 2024
1 parent 723e729 commit df645b7
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{{- $isDistributed := eq (include "loki.deployment.isDistributed" .) "true" -}}
{{- if $isDistributed -}}
apiVersion: v1
kind: Service
metadata:
name: {{ include "loki.distributorFullname" . }}-headless
namespace: {{ .Release.Namespace }}
labels:
{{- include "loki.distributorSelectorLabels" . | nindent 4 }}
{{- with .Values.distributor.serviceLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
variant: headless
prometheus.io/service-monitor: "false"
{{- with .Values.loki.serviceAnnotations }}
annotations:
{{- 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.distributor.appProtocol.grpc }}
appProtocol: {{ .Values.distributor.appProtocol.grpc }}
{{- end }}
selector:
{{- include "loki.distributorSelectorLabels" . | nindent 4 }}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ spec:
{{- if .Values.enterpriseGateway.useDefaultProxyURLs }}
- -gateway.proxy.default.url=http://{{ template "loki.fullname" . }}-admin-api.{{ .Release.Namespace }}.svc:3100
- -gateway.proxy.admin-api.url=http://{{ template "loki.fullname" . }}-admin-api.{{ .Release.Namespace }}.svc:3100
- -gateway.proxy.distributor.url=http://{{ template "loki.fullname" . }}-distributor.{{ .Release.Namespace }}.svc:3100
- -gateway.proxy.distributor.url=dns:///{{ template "loki.fullname" . }}-distributor-headless.{{ .Release.Namespace }}.svc:9095
- -gateway.proxy.ingester.url=http://{{ template "loki.fullname" . }}-ingester.{{ .Release.Namespace }}.svc:3100
- -gateway.proxy.query-frontend.url=http://{{ template "loki.fullname" . }}-query-frontend.{{ .Release.Namespace }}.svc:3100
- -gateway.proxy.ruler.url=http://{{ template "loki.fullname" . }}-ruler.{{ .Release.Namespace }}.svc:3100
Expand Down

0 comments on commit df645b7

Please sign in to comment.