# helm_charts_hl-composer-rest-ingress.yaml
{{- if .Values.rest.ingress.enabled -}}
{{- $fullName := include "hl-composer.fullname" . -}}
{{- $ingressPath := .Values.rest.ingress.path -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: {{ $fullName }}-rest
  labels:
{{ include "labels.standard" . | indent 4 }}
{{- with .Values.rest.ingress.annotations }}
  annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- if .Values.rest.ingress.tls }}
  tls:
  {{- range .Values.rest.ingress.tls }}
    - hosts:
      {{- range .hosts }}
        - {{ . }}
      {{- end }}
      secretName: {{ .secretName }}
  {{- end }}
{{- end }}
  rules:
  {{- range .Values.rest.ingress.hosts }}
    - host: {{ . }}
      http:
        paths:
          - path: {{ $ingressPath }}
            backend:
              serviceName: {{ $fullName }}-rest
              servicePort: http
  {{- end }}
{{- end }}