apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "jaeger-operator.fullname" . }}
  labels:
    app.kubernetes.io/name: {{ include "jaeger-operator.name" . }}
    app.kubernetes.io/instance: {{ .Release.Name }}
    app.kubernetes.io/managed-by: {{ .Release.Service }}
    helm.sh/chart: {{ include "jaeger-operator.chart" . }}
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: {{ include "jaeger-operator.name" . }}
      app.kubernetes.io/instance: {{ .Release.Name }}
  template:
    metadata:
      name: {{ include "jaeger-operator.fullname" . }}
      labels:
        app.kubernetes.io/name: {{ include "jaeger-operator.name" . }}
        app.kubernetes.io/instance: {{ .Release.Name }}
        app.kubernetes.io/managed-by: {{ .Release.Service }}
        helm.sh/chart: {{ include "jaeger-operator.chart" . }}
    spec:
      {{- if .Values.serviceAccount.create }}
      serviceAccountName: {{ include "jaeger-operator.serviceAccountName" . }}
      {{- end }}
      containers:
        - name: {{ include "jaeger-operator.fullname" . }}
          image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
          imagePullPolicy: {{ .Values.image.pullPolicy }}
          ports:
          - containerPort: 60000
            name: metrics
          args: ["start"]
          env:
            - name: WATCH_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: OPERATOR_NAME
              value: {{ include "jaeger-operator.fullname" . | quote }}
          resources:
{{ toYaml .Values.resources | indent 12 }}
    {{- with .Values.nodeSelector }}
      nodeSelector:
{{ toYaml . | indent 8 }}
    {{- end }}
    {{- with .Values.affinity }}
      affinity:
{{ toYaml . | indent 8 }}
    {{- end }}
    {{- with .Values.tolerations }}
      tolerations:
{{ toYaml . | indent 8 }}
    {{- end }}
