{{- if .Values.httpRoute.enabled }}
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: {{ .Release.Name }}
  namespace: {{ .Values.httpRoute.gatewayNamespace }}
  {{- with .Values.httpRoute.annotations }}
  annotations:
    {{- toYaml . | nindent 4 }}
  {{- end }}
spec:
  parentRefs:
  - name: {{ .Values.httpRoute.gatewayName }}
    namespace: {{ .Values.httpRoute.gatewayNamespace }}
  hostnames:
  {{- range .Values.httpRoute.hostnames }}
  - {{ . }}
  {{- end }}
  rules:
  - backendRefs:
    - name: {{ .Release.Name }}
      namespace: {{ .Release.Namespace }}
      port: {{ .Values.service.port }}
{{- end }}
