File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -87,15 +87,16 @@ The chart supports [Gateway API](https://gateway-api.sigs.k8s.io/) HTTPRoute as
8787| ` webservice.httpRoute.enabled` | Create an HTTPRoute | ` false` |
8888| ` webservice.httpRoute.gatewayRef` | Gateway reference (` name` , ` namespace` ). Omitted if empty | ` {}` |
8989| ` webservice.httpRoute.tls` | Auto-create a ListenerSet for TLS (like ` ingress.tlsAcme` ). Skipped if CRDs absent | ` true` |
90+ | ` webservice.httpRoute.addGatewayParentRef` | When ` tls: true` , also add the Gateway as a parentRef (in addition to the ListenerSet) | ` false` |
9091| ` webservice.httpRoute.annotations` | HTTPRoute annotations | ` {}` |
9192| ` webservice.httpRoute.labels` | HTTPRoute labels | ` {}` |
9293| ` webservice.httpRoute.filters` | Filters for the default rule | ` []` |
9394| ` webservice.httpRoute.additionalRules` | Extra routing rules | ` []` |
9495| ` webservice.additionalHttpRoutes` | Additional HTTPRoute resources with custom hosts | ` []` |
9596
9697` ` ` yaml
97- # Simple HTTPRoute (uses webservice.hosts )
98- # TLS is enabled by default and auto-creates a ListenerSet
98+ # Simple HTTPRoute with TLS (default )
99+ # The ListenerSet is the only parentRef, Gateway is referenced via the ListenerSet
99100webservice:
100101 image: myapp:latest
101102 hosts:
@@ -106,6 +107,22 @@ webservice:
106107 name: main-gateway
107108 namespace: gateway
108109
110+ # Also add the Gateway as a parentRef (if needed by your implementation)
111+ webservice:
112+ httpRoute:
113+ enabled: true
114+ gatewayRef:
115+ name: main-gateway
116+ addGatewayParentRef: true
117+
118+ # Without TLS — Gateway is the only parentRef
119+ webservice:
120+ httpRoute:
121+ enabled: true
122+ tls: false
123+ gatewayRef:
124+ name: main-gateway
125+
109126# Additional HTTPRoutes with custom hosts
110127webservice:
111128 httpRoute:
Original file line number Diff line number Diff line change @@ -30,11 +30,18 @@ spec:
3030 kind : XListenerSet
3131 name : {{ template "fullname" $root }}
3232 {{- end }}
33+ {{- if $root.Values.webservice.httpRoute.addGatewayParentRef }}
34+ - name : {{ .name }}
35+ {{- with .namespace }}
36+ namespace : {{ . }}
37+ {{- end }}
3338 {{- end }}
39+ {{- else }}
3440 - name : {{ .name }}
3541 {{- with .namespace }}
3642 namespace : {{ . }}
3743 {{- end }}
44+ {{- end }}
3845{{- end }}
3946{{- end }}
4047{{- if .Values.webservice.hosts }}
Original file line number Diff line number Diff line change 6262 - isNull :
6363 path : spec.parentRefs
6464
65- - it : should add Listener parentRef when tls is true
65+ - it : should only have ListenerSet parentRef when tls is true
6666 set :
6767 webservice :
6868 image : nginx:latest
@@ -72,6 +72,25 @@ tests:
7272 enabled : true
7373 gatewayRef :
7474 name : my-gateway
75+ asserts :
76+ - equal :
77+ path : spec.parentRefs[0].kind
78+ value : XListenerSet
79+ - lengthEqual :
80+ path : spec.parentRefs
81+ count : 1
82+
83+ - it : should add gateway parentRef when addGatewayParentRef is true
84+ set :
85+ webservice :
86+ image : nginx:latest
87+ hosts :
88+ - test.example.com
89+ httpRoute :
90+ enabled : true
91+ gatewayRef :
92+ name : my-gateway
93+ addGatewayParentRef : true
7594 asserts :
7695 - equal :
7796 path : spec.parentRefs[0].kind
Original file line number Diff line number Diff line change 134134 "type" : " boolean" ,
135135 "default" : true
136136 },
137+ "addGatewayParentRef" : {
138+ "type" : " boolean" ,
139+ "default" : false
140+ },
137141 "annotations" : {
138142 "type" : " object" ,
139143 "default" : {}
Original file line number Diff line number Diff line change @@ -176,6 +176,8 @@ webservice:
176176 # Creates HTTPS listeners on the gateway for each host in webservice.hosts
177177 # Silently skipped if ListenerSet/XListenerSet CRDs are not available on the cluster
178178 tls : true
179+ # When tls is true, also add the Gateway itself as a parentRef (in addition to the ListenerSet)
180+ addGatewayParentRef : false
179181 annotations : {}
180182 labels : {}
181183 # Filters applied to the default rule (e.g. RequestHeaderModifier, RequestRedirect)
You can’t perform that action at this time.
0 commit comments