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