File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,13 +16,32 @@ metadata:
1616 {{- end }}
1717spec :
1818 parentRefs :
19+ {{- if $httpRoute.listenerSet.enabled }}
20+ - kind : ListenerSet
21+ name : {{ include "keycloak.fullname" $ }}
22+ namespace : {{ $.Release.Namespace }}
23+ {{- else }}
1924 {{- with $httpRoute.parentRefs }}
2025 {{- toYaml . | nindent 4 }}
2126 {{- end }}
27+ {{- end }}
28+ {{- if $httpRoute.listenerSet.enabled }}
29+ {{- $hostnames := list }}
30+ {{- range $httpRoute.listenerSet.listeners }}
31+ {{- if .hostname }}
32+ {{- $hostnames = append $hostnames .hostname }}
33+ {{- end }}
34+ {{- end }}
35+ {{- with $hostnames }}
36+ hostnames :
37+ {{- toYaml . | nindent 4 }}
38+ {{- end }}
39+ {{- else }}
2240 {{- with $httpRoute.hostnames }}
2341 hostnames :
2442 {{- toYaml . | nindent 4 }}
2543 {{- end }}
44+ {{- end }}
2645 rules :
2746 {{- range $httpRoute.rules }}
2847 {{- with .matches }}
Original file line number Diff line number Diff line change 1+ {{- $httpRoute := .Values.httpRoute -}}
2+ {{- $listenerSet := $httpRoute.listenerSet -}}
3+ {{- if and $httpRoute.enabled $listenerSet.enabled -}}
4+ apiVersion : gateway.networking.k8s.io/v1
5+ kind : ListenerSet
6+ metadata :
7+ name : {{ include "keycloak.fullname" . }}
8+ namespace : {{ .Release.Namespace }}
9+ labels :
10+ {{- include "keycloak.labels" . | nindent 4 }}
11+ {{- range $key, $value := $httpRoute.labels }}
12+ {{- printf "%s: %s" $key (tpl $value $ | quote) | nindent 4 }}
13+ {{- end }}
14+ {{- range $key, $value := $listenerSet.labels }}
15+ {{- printf "%s: %s" $key (tpl $value $ | quote) | nindent 4 }}
16+ {{- end }}
17+ {{- with $listenerSet.annotations }}
18+ annotations :
19+ {{- toYaml . | nindent 4 }}
20+ {{- end }}
21+ spec :
22+ parentRef :
23+ name : {{ $listenerSet.parentRef.name }}
24+ {{- with $listenerSet.parentRef.namespace }}
25+ namespace : {{ . }}
26+ {{- end }}
27+ listeners :
28+ {{- toYaml $listenerSet.listeners | nindent 4 }}
29+ {{- end }}
Original file line number Diff line number Diff line change 158158 },
159159 "console" : {
160160 "$ref" : " #/definitions/httpRoute"
161+ },
162+ "listenerSet" : {
163+ "type" : " object" ,
164+ "properties" : {
165+ "enabled" : {
166+ "type" : " boolean"
167+ },
168+ "annotations" : {
169+ "type" : " object"
170+ },
171+ "labels" : {
172+ "type" : " object"
173+ },
174+ "parentRef" : {
175+ "type" : " object" ,
176+ "properties" : {
177+ "name" : {
178+ "type" : " string"
179+ },
180+ "namespace" : {
181+ "type" : " string"
182+ }
183+ }
184+ },
185+ "listeners" : {
186+ "type" : " array" ,
187+ "items" : {
188+ "type" : " object"
189+ }
190+ }
191+ }
161192 }
162193 }
163194 }
Original file line number Diff line number Diff line change @@ -319,6 +319,34 @@ httpRoute:
319319 type : PathPrefix
320320 value : ' {{ tpl .Values.http.relativePath $ | trimSuffix "/" }}/'
321321
322+ # -- Create a ListenerSet resource to attach listeners to an existing Gateway
323+ # without requiring write access to the Gateway resource itself. Useful for
324+ # namespace-level configuration where app owners do not have Gateway write access.
325+ # When enabled, the HTTPRoute parentRefs are auto-derived from the ListenerSet name,
326+ # and hostnames are derived from listener hostnames; httpRoute.parentRefs and
327+ # httpRoute.hostnames are unused.
328+ listenerSet :
329+ # If `true`, a ListenerSet resource is created alongside the HTTPRoute
330+ enabled : false
331+ # Additional ListenerSet labels
332+ labels : {}
333+ # ListenerSet annotations
334+ annotations : {}
335+ # The Gateway this ListenerSet attaches to
336+ parentRef :
337+ name : gateway
338+ # namespace: envoy-gateway-system
339+ # Listeners to attach to the Gateway. Passed through as-is.
340+ # Listener hostnames are used to populate the HTTPRoute hostnames field.
341+ listeners : []
342+ # - name: http
343+ # hostname: keycloak.example.com
344+ # port: 80
345+ # protocol: HTTP
346+ # allowedRoutes:
347+ # namespaces:
348+ # from: Same
349+
322350 # HTTPRoute for console only (/auth/admin)
323351 console :
324352 # If `true`, an HTTPRoute is created for console path only
You can’t perform that action at this time.
0 commit comments