# grafana_charts_service-query-frontend-discovery.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "tempo.resourceName" (dict "ctx" . "component" "query-frontend-discovery") }}
  namespace: {{ .Release.Namespace }}
  labels:
    {{- include "tempo.labels" (dict "ctx" . "component" "query-frontend") | nindent 4 }}
    {{- with .Values.queryFrontend.serviceDiscovery.labels }}
    {{- toYaml . | nindent 4 }}
    {{- end }}
  {{- with .Values.queryFrontend.serviceDiscovery.annotations }}
  annotations:
    {{- tpl (toYaml . | nindent 4) $ }}
  {{- end }}
spec:
  type: ClusterIP
  clusterIP: None
  ports:
    - name: http
      port: 3200
      targetPort: http-metrics
    - name: grpc
      port: 9095
      protocol: TCP
      targetPort: grpc
      {{- if .Values.queryFrontend.appProtocol.grpc }}
      appProtocol: {{ .Values.queryFrontend.appProtocol.grpc }}
      {{- end }}
    - name: grpclb
      port: 9096
      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 }}
  publishNotReadyAddresses: true
  selector:
    {{- include "tempo.selectorLabels" (dict "ctx" . "component" "query-frontend") | nindent 4 }}