# helm_charts_hotrod-deploy.yaml
{{- if .Values.hotrod.enabled -}}
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "jaeger.fullname" . }}-hotrod
  labels:
    app.kubernetes.io/name: {{ include "jaeger.name" . }}
    jaeger-infra: hotrod-deployment
    helm.sh/chart: {{ include "jaeger.chart" . }}
    app.kubernetes.io/component: hotrod
    app.kubernetes.io/instance: {{ .Release.Name }}
    app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
  replicas: {{ .Values.hotrod.replicaCount }}
  selector:
    matchLabels:
      app.kubernetes.io/name: {{ include "jaeger.name" . }}
      app.kubernetes.io/component: hotrod
      app.kubernetes.io/instance: {{ .Release.Name }}
  template:
    metadata:
      labels:
        app.kubernetes.io/name: {{ include "jaeger.name" . }}
        app.kubernetes.io/component: hotrod
        app.kubernetes.io/instance: {{ .Release.Name }}
    spec:
      serviceAccountName: {{ template "jaeger.hotrod.serviceAccountName" . }}
      containers:
        - name: {{ include "jaeger.fullname" . }}-hotrod
          image: {{ .Values.hotrod.image.repository }}:{{ .Values.tag }}
          imagePullPolicy: {{ .Values.hotrod.image.pullPolicy }}
          env:
            - name: JAEGER_AGENT_HOST
              value: {{ template "jaeger.hotrod.tracing.host" . }}
            - name: JAEGER_AGENT_PORT
              value: {{ .Values.hotrod.tracing.port | quote }}
          ports:
            - name: http
              containerPort: 8080
              protocol: TCP
          livenessProbe:
            httpGet:
              path: /
              port: http
          readinessProbe:
            httpGet:
              path: /
              port: http
          resources:
{{ toYaml .Values.hotrod.resources | indent 12 }}
    {{- if .Values.hotrod.nodeSelector }}
      nodeSelector:
{{ toYaml .Values.hotrod.nodeSelector | indent 8 }}
    {{- end }}
{{- end }}