# grafana_charts_service-query-frontend.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "tempo.resourceName" (dict "ctx" . "component" "query-frontend") }}
  namespace: {{ .Release.Namespace }}
  labels:
    {{- include "tempo.labels" (dict "ctx" . "component" "query-frontend") | nindent 4 }}
    {{- with .Values.queryFrontend.service.labels }}
    {{- toYaml . | nindent 4 }}
    {{- end }}
  {{- with .Values.queryFrontend.service.annotations }}
  annotations:
    {{- tpl (toYaml . | nindent 4) $ }}
  {{- end }}
spec:
  type: {{ .Values.queryFrontend.service.type }}
  ipFamilies: {{ .Values.tempo.service.ipFamilies }}
  ipFamilyPolicy: {{ .Values.tempo.service.ipFamilyPolicy }}
  ports:
    - name: http-metrics
      port: {{ .Values.queryFrontend.service.httpMetricsPort }}
      targetPort: http-metrics
    - name: grpc
      port: {{ .Values.queryFrontend.service.grpcPort }}
      protocol: TCP
      targetPort: grpc
      {{- if .Values.queryFrontend.appProtocol.grpc }}
      appProtocol: {{ .Values.queryFrontend.appProtocol.grpc }}
      {{- end }}
    {{- if .Values.queryFrontend.query.enabled }}
    - name: tempo-query-jaeger-ui
      port: {{ .Values.queryFrontend.service.port }}
      targetPort: {{ .Values.queryFrontend.service.port }}
    - name: tempo-query-metrics
      port: 16687
      targetPort: jaeger-metrics
    {{- end }}
  {{- if .Values.queryFrontend.service.loadBalancerIP }}
  loadBalancerIP: {{ .Values.queryFrontend.service.loadBalancerIP  }}
  {{- end }}
  {{- with .Values.queryFrontend.service.loadBalancerSourceRanges}}
  loadBalancerSourceRanges:
    {{ toYaml . | nindent 4 }}
  {{- end }}
  selector:
    {{- include "tempo.selectorLabels" (dict "ctx" . "component" "query-frontend") | nindent 4 }}