{{- if .Values.route.enabled -}} {{- $ctx := dict "helm" . }} {{- $fullname := include "vm.fullname" $ctx }} {{- $ns := include "vm.namespace" $ctx }} {{- $svcPort := .Values.service.port -}} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: name: {{ $fullname }} namespace: {{ $ns }} labels: {{ include "vm.labels" $ctx | nindent 4 }} {{- with .Values.route.annotations }} annotations: {{ toYaml . | nindent 4 }} {{- end }} spec: parentRefs: {{- with .Values.route.parentRefs }} {{- toYaml . | nindent 4 }} {{- end }} {{- with .Values.route.hostnames }} hostnames: {{ toYaml . | nindent 4 }} {{- end }} rules: {{- range .Values.route.rules }} - backendRefs: - name: {{ $fullname }} port: {{ $svcPort }} weight: 1 {{- with .matches }} matches: {{ toYaml . | nindent 8 }} {{- end }} {{- with .filters }} filters: {{ toYaml . | nindent 8 }} {{- end }} {{- end }} {{- end }}