{{- if .Values.jaeger.enabled -}}
apiVersion: v1
kind: Service
metadata:
  name: {{ template "fullname" . }}-jaeger
  labels:
    app: {{ template "fullname" . }}-jaeger
    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
    release: "{{ .Release.Name }}"
    heritage: "{{ .Release.Service }}"
spec:
  type: {{ .Values.jaeger.type }}
  ports:
    - name: jaeger-collector-http
      port: 14268
      protocol: TCP
      targetPort: 14268
    - name: jaeger-zipkin-thrift
      port: 5775
      protocol: UDP
      targetPort: 5775
    - name: jaeger-compact
      port: 6831
      protocol: UDP
      targetPort: 6831
    - name: jaeger-binary
      port: 6832
      protocol: UDP
      targetPort: 6832
    - name: jaeger-configs
      port: 5778
      protocol: TCP
      targetPort: 5778
    - name: jaeger-query-http
      port: 16686
      protocol: TCP
      targetPort: 16686
  selector:
    app: {{ template "fullname" . }}-jaeger
    release: "{{ .Release.Name }}"
{{- end -}}
