# grafana_charts_service-ruler.yaml
{{- if .Values.ruler.enabled }}
apiVersion: v1
kind: Service
metadata:
  name: {{ include "loki.rulerFullname" . }}
  labels:
    {{- include "loki.rulerSelectorLabels" . | nindent 4 }}
    {{- with .Values.ruler.serviceLabels }}
    {{- toYaml . | nindent 4 }}
    {{- end }}
  {{- with .Values.loki.serviceAnnotations }}
  annotations:
    {{- toYaml . | nindent 4 }}
  {{- end }}
spec:
  type: ClusterIP
  clusterIP: None
  ports:
    - name: http
      port: 3100
      targetPort: http
      protocol: TCP
    - name: grpc
      port: 9095
      targetPort: grpc
      protocol: TCP
      {{- with .Values.ruler.appProtocol.grpc }}
      appProtocol: {{ . }}
      {{- end }}
  selector:
    {{- include "loki.rulerSelectorLabels" . | nindent 4 }}
{{- end }}