{{- if .Values.metrics.enabled }}
apiVersion: v1
kind: Service
metadata:
  name: {{ include "scdf.fullname" . }}-prometheus-proxy
  labels: {{- include "common.labels.standard" . | nindent 4 }}
    app.kubernetes.io/component: prometheus-proxy
  {{- if .Values.metrics.service.annotations }}
  annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.service.annotations "context" $) | nindent 4 }}
  {{- end }}
spec:
  type: ClusterIP
  ports:
    - name: http
      port: {{ .Values.metrics.service.httpPort }}
      protocol: TCP
      targetPort: http
    - name: rsocket
      port: {{ .Values.metrics.service.rsocketPort }}
      protocol: TCP
      targetPort: rsocket
  selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
    app.kubernetes.io/component: prometheus-proxy
{{- end }}
