apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: istio-tracing
  namespace: {{ .Release.Namespace }}
  labels:
    app: istio-tracing
    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
spec:
  replicas: {{ .Values.replicaCount }}
  template:
    metadata:
      labels:
        app: jaeger
      annotations:
        sidecar.istio.io/inject: "false"
        scheduler.alpha.kubernetes.io/critical-pod: ""
    spec:
{{- if .Values.global.priorityClassName }}
      priorityClassName: "{{ .Values.global.priorityClassName }}"
{{- end }}
      containers:
        - name: jaeger
          image: "{{ .Values.jaeger.hub }}/all-in-one:{{ .Values.jaeger.tag }}"
          imagePullPolicy: {{ .Values.global.imagePullPolicy }}
          ports:
            - containerPort: {{ .Values.service.internalPort }}
            - containerPort: {{ .Values.jaeger.ui.port }}
            - containerPort: 5775
              protocol: UDP
            - containerPort: 6831
              protocol: UDP
            - containerPort: 6832
              protocol: UDP
          env:
          - name: POD_NAMESPACE
            valueFrom:
              fieldRef:
                apiVersion: v1
                fieldPath: metadata.namespace
          - name: COLLECTOR_ZIPKIN_HTTP_PORT
            value: "{{ .Values.service.internalPort }}"
          - name: MEMORY_MAX_TRACES
            value: "{{ .Values.jaeger.memory.max_traces }}"
          livenessProbe:
            httpGet:
              path: /
              port: {{ .Values.jaeger.ui.port }}
          readinessProbe:
            httpGet:
              path: /
              port: {{ .Values.jaeger.ui.port }}
          resources:
{{- if .Values.resources }}
{{ toYaml .Values.resources | indent 12 }}
{{- else }}
{{ toYaml .Values.global.defaultResources | indent 12 }}
{{- end }}
      affinity:
      {{- include "nodeaffinity" . | indent 6 }}
