# grafana_charts_service-query-scheduler.yaml
{{- if .Values.queryScheduler.enabled }}
apiVersion: v1
kind: Service
metadata:
  name: {{ include "loki.querySchedulerFullname" . }}
  namespace: {{ .Release.Namespace }}
  labels:
    {{- include "loki.querySchedulerLabels" . | nindent 4 }}
    {{- with .Values.queryScheduler.serviceLabels }}
    {{- toYaml . | nindent 4 }}
    {{- end }}
  {{- with .Values.loki.serviceAnnotations }}
  annotations:
    {{- toYaml . | nindent 4 }}
  {{- end }}
spec:
  type: ClusterIP
  clusterIP: None
  publishNotReadyAddresses: true
  ports:
    - name: http
      port: 3100
      targetPort: http
      protocol: TCP
    - name: grpclb
      port: 9095
      targetPort: grpc
      protocol: TCP
      {{- with .Values.queryScheduler.appProtocol.grpc }}
      appProtocol: {{ . }}
      {{- end }}
  selector:
    {{- include "loki.querySchedulerSelectorLabels" . | nindent 4 }}
{{- end }}