{{- if .Values.jaeger.enabled -}}
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ template "fullname" . }}-jaeger
  labels:
    app: {{ template "fullname" . }}-jaeger
    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
    release: "{{ .Release.Name }}"
    heritage: "{{ .Release.Service }}"
spec:
  replicas: 1
  selector:
    matchLabels:
      app: {{ template "fullname" . }}-jaeger
      release: "{{ .Release.Name }}"
  template:
    metadata:
      labels:
        app: {{ template "fullname" . }}-jaeger
        chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
        release: "{{ .Release.Name }}"
    spec:
      containers:
        - env:
            - name: COLLECTOR_ZIPKIN_HTTP_PORT
              value: "9441"
          image: "{{ .Values.jaeger.image.repository }}:{{ .Values.jaeger.image.tag }}"
          name: {{ template "fullname" . }}-jaeger
          ports:
            - containerPort: 14268
              protocol: TCP
            - containerPort: 5775
              protocol: UDP
            - containerPort: 6831
              protocol: UDP
            - containerPort: 6832
              protocol: UDP
            - containerPort: 5778
              protocol: TCP
            - containerPort: 16686
              protocol: TCP
            - containerPort: 9411
              protocol: TCP
{{- end -}}
