2026-01-14 21:45:05 +00:00
|
|
|
{{- if .Values.httpRoute.enabled -}}
|
|
|
|
|
{{- $fullName := include "chart.fullname" . -}}
|
|
|
|
|
{{- $svcPort := .Values.service.port -}}
|
2026-02-02 21:21:53 +00:00
|
|
|
{{- $defaultGatewayName := .Values.gateway.name -}}
|
|
|
|
|
{{- if not $defaultGatewayName -}}
|
|
|
|
|
{{- $defaultGatewayName = printf "%s-gateway" $fullName -}}
|
|
|
|
|
{{- end -}}
|
|
|
|
|
{{- $defaultGatewayNs := .Release.Namespace -}}
|
|
|
|
|
{{- if .Values.gateway.enabled -}}
|
|
|
|
|
{{- $defaultGatewayNs = default .Release.Namespace .Values.gateway.namespace -}}
|
|
|
|
|
{{- end -}}
|
2026-01-14 21:45:05 +00:00
|
|
|
apiVersion: gateway.networking.k8s.io/v1
|
|
|
|
|
kind: HTTPRoute
|
|
|
|
|
metadata:
|
|
|
|
|
name: {{ $fullName }}
|
|
|
|
|
labels:
|
|
|
|
|
{{- include "chart.labels" . | nindent 4 }}
|
|
|
|
|
{{- with .Values.httpRoute.annotations }}
|
|
|
|
|
annotations:
|
|
|
|
|
{{- toYaml . | nindent 4 }}
|
|
|
|
|
{{- end }}
|
|
|
|
|
spec:
|
|
|
|
|
parentRefs:
|
2026-02-02 21:21:53 +00:00
|
|
|
{{- if .Values.httpRoute.parentRefs }}
|
2026-01-14 21:45:05 +00:00
|
|
|
{{- range $ref := .Values.httpRoute.parentRefs }}
|
|
|
|
|
- name: {{ default $defaultGatewayName $ref.name | quote }}
|
2026-02-02 21:21:53 +00:00
|
|
|
{{- $refNs := $ref.namespace | default $defaultGatewayNs -}}
|
|
|
|
|
namespace: {{ $refNs | quote }}
|
2026-01-14 21:45:05 +00:00
|
|
|
{{- with $ref.sectionName }}
|
|
|
|
|
sectionName: {{ . | quote }}
|
2026-02-02 21:21:53 +00:00
|
|
|
{{- else }}
|
|
|
|
|
sectionName: "http"
|
2026-01-14 21:45:05 +00:00
|
|
|
{{- end }}
|
|
|
|
|
{{- with $ref.kind }}
|
|
|
|
|
kind: {{ . | quote }}
|
|
|
|
|
{{- end }}
|
|
|
|
|
{{- with $ref.group }}
|
|
|
|
|
group: {{ . | quote }}
|
|
|
|
|
{{- end }}
|
|
|
|
|
{{- end }}
|
2026-02-02 21:21:53 +00:00
|
|
|
{{- else }}
|
|
|
|
|
# Default parentRef when parentRefs is empty or not set
|
|
|
|
|
- name: {{ $defaultGatewayName | quote }}
|
|
|
|
|
namespace: {{ $defaultGatewayNs | quote }}
|
|
|
|
|
sectionName: "http"
|
|
|
|
|
{{- end }}
|
2026-01-14 21:45:05 +00:00
|
|
|
{{- with .Values.httpRoute.hostnames }}
|
|
|
|
|
hostnames:
|
|
|
|
|
{{- toYaml . | nindent 4 }}
|
|
|
|
|
{{- end }}
|
|
|
|
|
rules:
|
|
|
|
|
{{- range .Values.httpRoute.rules }}
|
2026-02-02 21:21:53 +00:00
|
|
|
- {{- with .matches }}
|
|
|
|
|
matches:
|
2026-01-14 21:45:05 +00:00
|
|
|
{{- toYaml . | nindent 8 }}
|
2026-02-02 21:21:53 +00:00
|
|
|
{{- end }}
|
|
|
|
|
{{- with .filters }}
|
2026-01-14 21:45:05 +00:00
|
|
|
filters:
|
|
|
|
|
{{- toYaml . | nindent 8 }}
|
2026-02-02 21:21:53 +00:00
|
|
|
{{- end }}
|
2026-01-14 21:45:05 +00:00
|
|
|
backendRefs:
|
|
|
|
|
- name: {{ $fullName }}
|
|
|
|
|
port: {{ $svcPort }}
|
|
|
|
|
weight: 1
|
|
|
|
|
{{- end }}
|
|
|
|
|
{{- end }}
|