{{- if .Values.httpRoute.enabled -}} {{- if not .Values.httpRoute.parentRefs }} {{- fail "httpRoute.parentRefs must include at least one parent" }} {{- end }} {{- if not .Values.httpRoute.paths }} {{- fail "httpRoute.paths must include at least one path" }} {{- end }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: name: {{ include "trek.fullname" . }} labels: app: {{ include "trek.name" . }} {{- with .Values.httpRoute.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} spec: parentRefs: {{- toYaml .Values.httpRoute.parentRefs | nindent 4 }} {{- with .Values.httpRoute.hostnames }} hostnames: {{- toYaml . | nindent 4 }} {{- end }} rules: {{- range $path := .Values.httpRoute.paths }} - matches: - path: type: PathPrefix value: {{ $path | quote }} backendRefs: - name: {{ include "trek.fullname" $ }} port: {{ $.Values.service.port }} {{- with $.Values.httpRoute.timeouts }} timeouts: {{- toYaml . | nindent 8 }} {{- end }} {{- end }} {{- end }}