{{- if .Values.app.metrics.service.enabled }}
apiVersion: v1
kind: Service
metadata:
  name: {{ include "trust-manager.name" . }}-metrics
  namespace: {{ include "trust-manager.namespace" . }}
  labels:
    app: {{ include "trust-manager.name" . }}
    {{- include "trust-manager.labels" . | nindent 4 }}
spec:
  type: {{ .Values.app.metrics.service.type }}
  ports:
    - port: {{ .Values.app.metrics.port }}
      targetPort: {{ .Values.app.metrics.port }}
      protocol: TCP
      name: metrics
  selector:
    app: {{ include "trust-manager.name" . }}
{{- end }}
