{{- if eq (include "rancher.gatewayEnabled" .) "true" -}} {{ $defaultGateway := printf "%s-%s" (include "rancher.fullname" .) "gateway" }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: name: {{ include "rancher.fullname" . }} labels: {{ include "rancher.labels" . | indent 4 }} spec: parentRefs: - name: {{ include "rancher.gateway" . }} namespace: {{ .Release.Namespace }} {{- if eq (include "rancher.useExternalTls" .) "false" }} # TLS terminates at k8s: attach to HTTPS listeners (redirect route handles HTTP) sectionName: rancher-https {{- else }} # TLS is external: attach to HTTP listeners (no redirect route) sectionName: rancher-http {{- end }} hostnames: - {{ .Values.hostname }} rules: - matches: - path: type: PathPrefix value: / backendRefs: - name: {{ include "rancher.fullname" . }} port: {{ ternary 443 80 .Values.service.disableHTTP }} {{- end }}