@@ -62,44 +62,29 @@ type HTTPRouteSpec struct {
62
62
// 1. IPs are not allowed.
63
63
// 2. The `:` delimiter is not respected because ports are not allowed.
64
64
//
65
- // Incoming requests are matched against the hostnames before the
66
- // HTTPRoute rules. If no hostname is specified, traffic is routed
67
- // based on the HTTPRouteRules.
68
- //
69
- // Requests will be matched against the Host field in the following order:
70
- //
71
- // 1. If Hostname is precise, the request matches this rule if
72
- // the HTTP Host header is equal to the Hostname.
73
- // 2. If Hostname is a wildcard, then the request matches this rule if
74
- // the HTTP Host header is to equal to the suffix
75
- // (removing the first label) of the wildcard rule.
76
- // 3. If Hostname is unspecified, empty, or `*`, then any request will match
77
- // this route.
78
- //
79
- // If a hostname is specified by the Listener that the HTTPRoute is bound
80
- // to, at least one hostname specified here must match the Listener specified
81
- // hostname as per the rules above. Other hostnames will not affect processing
82
- // of the route in that case.
83
- //
84
- // If no hostname is specified by the Listener, then that value will be treated
85
- // as '*', match any hostname, and so any hostname on this Route will match.
86
- //
87
- // If all hostnames do not match, then the HTTPRoute is not admitted, and
88
- // the implementation must raise an 'Admitted' Condition with a status of
89
- // `false` for that Listener.
90
- //
91
- // Examples:
92
- // - A Listener with unspecified, empty, or `*` values for Hostname matches
93
- // any HTTPRoute hostname.
94
- // - A HTTPRoute with unspecified, empty, or `*` values for Hostname matches
95
- // any Listener hostname.
96
- // - A Listener with `test.foo.com` as the hostname matches *only*
97
- // `test.foo.com` or `*.foo.com`. Any other hostnames present must be ignored.
98
- // - A Listener with `*.foo.com` as hostname, all hostnames in the HTTPRoute
99
- // must have any single label where the star is, and the rest of the hostname
100
- // must match exactly. So, `test.foo.com`, `*.foo.com` or `blog.foo.com` match.
101
- // `test.blog.foo.com`, `test.bar.com`, or `bar.com` do not. Hostnames that do
102
- // not match will be ignored.
65
+ // If a hostname is specified by both the Listener and HTTPRoute, there
66
+ // must be at least one intersecting hostname for the HTTPRoute to be
67
+ // attached to the Listener. For example:
68
+ //
69
+ // * A Listener with `test.example.com` as the hostname matches HTTPRoutes
70
+ // that have either not specified any hostnames, or have specified at
71
+ // least one of `test.example.com` or `*.example.com`.
72
+ // * A Listener with `*.example.com` as as the hostname matches HTTPRoutes
73
+ // that have either not specified any hostnames or have specified at least
74
+ // one hostname that matches the Listener hostname. For example,
75
+ // `test.example.com` and `*.example.com` would both match. On the other
76
+ // hand, `a.b.example.com`, `example.com`, and `test.example.net` would
77
+ // not match.
78
+ //
79
+ // If both the Listener and HTTPRoute have specified hostnames, any
80
+ // HTTPRoute hostnames that do not match the Listener hostname MUST be
81
+ // ignored. For example, if a Listener specified `*.example.com`, and the
82
+ // HTTPRoute specified `test.example.com` and `test.example.net`,
83
+ // `test.example.net` must not be considered for a match.
84
+ //
85
+ // If hostnames do not match with the criteria above, then the HTTPRoute is
86
+ // not admitted, and the implementation must raise an 'Admitted' Condition
87
+ // with a status of `False` for the target Listener(s).
103
88
//
104
89
// Support: Core
105
90
//
@@ -155,8 +140,10 @@ type HTTPRouteRule struct {
155
140
// of the following criteria, continuing on ties:
156
141
//
157
142
// * The longest matching hostname.
143
+ // * The longest matching non-wildcard hostname.
158
144
// * The longest matching path.
159
145
// * The largest number of header matches.
146
+ // * The largest number of query param matches.
160
147
//
161
148
// If ties still exist across multiple Routes, matching precedence MUST be
162
149
// determined in order of the following criteria, continuing on ties:
@@ -199,11 +186,14 @@ type HTTPRouteRule struct {
199
186
Filters []HTTPRouteFilter `json:"filters,omitempty"`
200
187
201
188
// BackendRefs defines the backend(s) where matching requests should be
202
- // sent. If unspecified or invalid (refers to a non-existent resource or a Service with no endpoints),
203
- // the rule performs no forwarding; if no filters are specified that would result in a
204
- // response being sent, a HTTP 503 status code is returned. 503 responses must be sent so that the overall
205
- // weight is respected; if an invalid backend is requested to have 80% of requests, then 80% of requests
206
- // must get a 503 instead.
189
+ // sent.
190
+
191
+ // If unspecified or invalid (refers to a non-existent resource or a Service
192
+ // with no endpoints), the rule performs no forwarding. If that are also no
193
+ // filters specified that would result in a response being sent, a HTTP 503
194
+ // status code is returned. 503 responses must be sent so that the overall
195
+ // weight is respected; if an invalid backend is requested to have 80% of
196
+ // requests, then 80% of requests must get a 503 instead.
207
197
//
208
198
// Support: Core for Kubernetes Service
209
199
// Support: Custom for any other resource
@@ -466,11 +456,9 @@ type HTTPRouteMatch struct {
466
456
467
457
// ExtensionRef is an optional, implementation-specific extension to the
468
458
// "match" behavior. For example, resource "myroutematcher" in group
469
- // "networking.acme.io". If the referent cannot be found, the rule is not
470
- // included in the route. The controller should raise the "ResolvedRefs"
471
- // condition on the Gateway with the "DegradedRoutes" reason. The gateway
472
- // status for this route should be updated with a condition that describes
473
- // the error more specifically.
459
+ // "networking.example.net". If the referent cannot be found, the rule is
460
+ // not included in the route. The controller must ensure the "ResolvedRefs"
461
+ // condition on the Route status is set to `status: False`.
474
462
//
475
463
// Support: Custom
476
464
//
@@ -528,7 +516,8 @@ type HTTPRouteFilter struct {
528
516
// +optional
529
517
RequestMirror * HTTPRequestMirrorFilter `json:"requestMirror,omitempty"`
530
518
531
- // RequestRedirect defines a schema for a filter that redirects request.
519
+ // RequestRedirect defines a schema for a filter that responds to the
520
+ // request with an HTTP redirection.
532
521
//
533
522
// Support: Core
534
523
//
@@ -537,7 +526,7 @@ type HTTPRouteFilter struct {
537
526
538
527
// ExtensionRef is an optional, implementation-specific extension to the
539
528
// "filter" behavior. For example, resource "myroutefilter" in group
540
- // "networking.acme.io "). ExtensionRef MUST NOT be used for core and
529
+ // "networking.example.net "). ExtensionRef MUST NOT be used for core and
541
530
// extended filters.
542
531
//
543
532
// Support: Implementation-specific
@@ -650,10 +639,10 @@ type HTTPRequestHeaderFilter struct {
650
639
// +kubebuilder:validation:MaxItems=16
651
640
Add []HTTPHeader `json:"add,omitempty"`
652
641
653
- // Remove the given header(s) from the HTTP request before the
654
- // action. The value of RemoveHeader is a list of HTTP header
655
- // names. Note that the header names are case-insensitive
656
- // (see https://datatracker.ietf.org/doc/html/rfc2616#section-4.2).
642
+ // Remove the given header(s) from the HTTP request before the action. The
643
+ // value of Remove is a list of HTTP header names. Note that the header
644
+ // names are case-insensitive (see
645
+ // https://datatracker.ietf.org/doc/html/rfc2616#section-4.2).
657
646
//
658
647
// Input:
659
648
// GET /foo HTTP/1.1
@@ -717,15 +706,14 @@ type HTTPRequestRedirect struct {
717
706
type HTTPRequestMirrorFilter struct {
718
707
// BackendRef references a resource where mirrored requests are sent.
719
708
//
720
- // If the referent cannot be found, this HTTPBackendRef is invalid
721
- // and must be dropped from the Gateway. The controller must ensure the
722
- // "ResolvedRefs" condition on the Gateway is set to `status: true`
723
- // with the "DegradedRoutes" reason, and not configure this backend in the
724
- // underlying implemenation.
709
+ // If the referent cannot be found, this BackendRef is invalid and must be
710
+ // dropped from the Gateway. The controller must ensure the "ResolvedRefs"
711
+ // condition on the Route status is set to `status: False` and not configure
712
+ // this backend in the underlying implementation.
725
713
//
726
714
// If there is a cross-namespace reference to an *existing* object
727
715
// that is not allowed by a ReferencePolicy, the controller must ensure the
728
- // "ResolvedRefs" condition on the Gateway is set to `status: true `,
716
+ // "ResolvedRefs" condition on the Route is set to `status: False `,
729
717
// with the "RefNotPermitted" reason and not configure this backend in the
730
718
// underlying implementation.
731
719
//
@@ -743,15 +731,14 @@ type HTTPRequestMirrorFilter struct {
743
731
type HTTPBackendRef struct {
744
732
// BackendRef is a reference to a backend to forward matched requests to.
745
733
//
746
- // If the referent cannot be found, this HTTPBackendRef is invalid
747
- // and must be dropped from the Gateway. The controller must ensure the
748
- // "ResolvedRefs" condition on the Gateway is set to `status: true`
749
- // with the "DegradedRoutes" reason, and not configure this backend in the
750
- // underlying implemenation.
734
+ // If the referent cannot be found, this HTTPBackendRef is invalid and must
735
+ // be dropped from the Gateway. The controller must ensure the
736
+ // "ResolvedRefs" condition on the Route is set to `status: False` and not
737
+ // configure this backend in the underlying implementation.
751
738
//
752
739
// If there is a cross-namespace reference to an *existing* object
753
740
// that is not covered by a ReferencePolicy, the controller must ensure the
754
- // "ResolvedRefs" condition on the Gateway is set to `status: true`,
741
+ // "ResolvedRefs" condition on the Route is set to `status: true`,
755
742
// with the "RefNotPermitted" reason and not configure this backend in the
756
743
// underlying implementation.
757
744
//
@@ -763,7 +750,7 @@ type HTTPBackendRef struct {
763
750
// +optional
764
751
BackendRef `json:",inline"`
765
752
766
- // Filters defined at this- level should be executed if and only if the
753
+ // Filters defined at this level should be executed if and only if the
767
754
// request is being forwarded to the backend defined here.
768
755
//
769
756
// Support: Custom (For broader support of filters, use the Filters field
0 commit comments