# helm_charts_hotrod-ing.yaml
{{- if .Values.hotrod.enabled -}}
{{- if .Values.hotrod.ingress.enabled -}}
{{- $serviceName := include "jaeger.fullname" . -}}
{{- $servicePort := .Values.hotrod.service.port -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: {{ include "jaeger.fullname" . }}-hotrod
  labels:
    app.kubernetes.io/name: {{ include "jaeger.name" . }}
    helm.sh/chart: {{ include "jaeger.chart" . }}
    app.kubernetes.io/component: hotrod
    app.kubernetes.io/instance: {{ .Release.Name }}
    app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- if .Values.hotrod.ingress.annotations }}
  annotations:
{{ toYaml .Values.hotrod.ingress.annotations | indent 4 }}
{{- end }}
spec:
  rules:
    {{- range $host := .Values.hotrod.ingress.hosts }}
    - host: {{ $host }}
      http:
        paths:
          - path: /
            backend:
              serviceName: {{ $serviceName }}-hotrod
              servicePort: {{ $servicePort }}
    {{- end -}}
  {{- if .Values.hotrod.ingress.tls }}
  tls:
{{ toYaml .Values.hotrod.ingress.tls | indent 4 }}
  {{- end -}}
{{- end -}}
{{- end -}}