apiVersion: v1
kind: Service
metadata:
  name: {{ include "grafana-operator.fullname" . }}-metrics-service
  namespace: {{ .Release.Namespace | quote }}
  labels:
    {{- include "grafana-operator.labels" . | nindent 4 }}
    {{- with .Values.additionalLabels }}
    {{- toYaml . | nindent 4 }}
    {{- end }}
spec:
  type: {{ .Values.metricsService.type }}
  ports:
    - port: {{ .Values.metricsService.metricsPort }}
      targetPort: metrics
      protocol: TCP
      name: metrics
  selector:
    {{- include "grafana-operator.selectorLabels" . | nindent 4 }}
