# helm_charts_metrics-service.yaml
{{- if .Values.metrics.enabled }}
apiVersion: v1
kind: Service
metadata:
  name: {{ template "hazelcast-jet.fullname" . }}-metrics
  labels:
    app.kubernetes.io/name: {{ template "hazelcast-jet.name" . }}
    helm.sh/chart: {{ template "hazelcast-jet.chart" . }}
    app.kubernetes.io/instance: "{{ .Release.Name }}"
    app.kubernetes.io/managed-by: "{{ .Release.Service }}"
  annotations:
{{ toYaml .Values.metrics.service.annotations | indent 4 }}
spec:
  type: {{ .Values.metrics.service.type }}
  selector:
    app.kubernetes.io/name: {{ template "hazelcast-jet.name" . }}
    app.kubernetes.io/instance: "{{ .Release.Name }}"
  ports:
  - protocol: TCP
    port: {{ .Values.metrics.service.port }}
    targetPort: metrics
    name: metrics
{{- end }}