{{- if .Values.hotrod.enabled -}}
apiVersion: v1
kind: Service
metadata:
  name: {{ template "jaeger.fullname" . }}-hotrod
  labels:
    app: {{ template "jaeger.name" . }}
    jaeger-infra: hotrod-service
    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
    component: hotrod
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
{{- if .Values.hotrod.service.annotations }}
  annotations:
{{ toYaml .Values.hotrod.service.annotations | indent 4 }}
{{- end }}
spec:
  type: {{ .Values.hotrod.service.type }}
  ports:
    - name: {{ .Values.hotrod.service.name }}
      port: {{ .Values.hotrod.service.externalPort }}
      protocol: TCP
      targetPort: {{ .Values.hotrod.service.internalPort }}
  selector:
    app: {{ template "jaeger.name" . }}
    component: hotrod
    release: {{ .Release.Name }}
    jaeger-infra: hotrod-instance
{{- template "loadBalancerSourceRanges" .Values.hotrod }}
{{- end -}}
