---
apiVersion: v1
kind: Service
metadata:
  name: {{ template "apm.fullname" . }}
  labels:
    app: {{ .Chart.Name }}
    release: {{ .Release.Name | quote }}
    heritage: {{ .Release.Service }}
{{- with .Values.service.annotations }}
  annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
  type: {{ .Values.service.type }}
  ports:
    - port: {{ .Values.service.port }}
      {{- with .Values.service.nodePort }}
      nodePort: {{ . }}
      {{- end }}
      protocol: TCP
      name: http
      targetPort: {{ .Values.service.port }}
  selector:
    app: {{ .Chart.Name }}
    release: {{ .Release.Name | quote }}
