@@ -201,26 +201,31 @@ type HTTPRouteRule struct {
201
201
// BackendRefs defines the backend(s) where matching requests should be
202
202
// sent.
203
203
//
204
- // A 500 status code MUST be returned if there are no BackendRefs or filters
205
- // specified that would result in a response being sent .
204
+ // Failure behavior here depends on how many BackendRefs are specified and
205
+ // how many are invalid .
206
206
//
207
- // A BackendRef is considered invalid when it refers to:
207
+ // If *all* entries in BackendRefs are invalid, and there are also no filters
208
+ // specified in this route rule, *all* traffic which matches this rule MUST
209
+ // recieve a 500 status code (exactly).
208
210
//
209
- // * an unknown or unsupported kind of resource
210
- // * a resource that does not exist
211
- // * a resource in another namespace when the reference has not been
212
- // explicitly allowed by a ReferenceGrant (or equivalent concept).
211
+ // See the HTTPBackendRef definition for the rules about what makes a single
212
+ // HTTPBackendRef invalid.
213
213
//
214
- // When a BackendRef is invalid, 500 status codes MUST be returned for
214
+ // When a HTTPBackendRef is invalid, 500 status codes MUST be returned for
215
215
// requests that would have otherwise been routed to an invalid backend. If
216
216
// multiple backends are specified, and some are invalid, the proportion of
217
217
// requests that would otherwise have been routed to an invalid backend
218
218
// MUST receive a 500 status code.
219
219
//
220
- // When a BackendRef refers to a Service that has no ready endpoints, it is
221
- // recommended to return a 503 status code.
220
+ // For example, if two backends are specified with equal weights, and one is
221
+ // invalid, 50 percent of traffic must receive a 500. Implementations may
222
+ // choose how that 50 percent is determined.
223
+ //
224
+ // When a HTTPBackendRef refers to a Service that has no ready endpoints,
225
+ // implementations MAY return a 503 for requests to that backend instead.
222
226
//
223
227
// Support: Core for Kubernetes Service
228
+ //
224
229
// Support: Custom for any other resource
225
230
//
226
231
// Support for weight: Core
@@ -874,21 +879,31 @@ type HTTPRequestMirrorFilter struct {
874
879
type HTTPBackendRef struct {
875
880
// BackendRef is a reference to a backend to forward matched requests to.
876
881
//
877
- // If the referent cannot be found, this HTTPBackendRef is invalid and must
878
- // be dropped from the Gateway. The controller must ensure the
879
- // "ResolvedRefs" condition on the Route is set to `status: False` and not
880
- // configure this backend in the underlying implementation .
882
+ // A BackendRef can be invalid for the following reasons. In all cases, the
883
+ // implementation MUST ensure the `ResolvedRefs` Condition on the Route
884
+ // is set to `status: False`, with a Reason and Message that indicate
885
+ // what is the cause of the error .
881
886
//
882
- // If there is a cross-namespace reference to an *existing* object
883
- // that is not covered by a ReferenceGrant, the controller must ensure the
884
- // "ResolvedRefs" condition on the Route is set to `status: False`,
885
- // with the "RefNotPermitted" reason and not configure this backend in the
886
- // underlying implementation.
887
+ // A BackendRef is invalid if:
887
888
//
888
- // In either error case, the Message of the `ResolvedRefs` Condition
889
- // should be used to provide more detail about the problem.
889
+ // * It refers to an unknown or unsupported kind of resource. In this
890
+ // case, the Reason must be set to `InvalidKind` and Message of the
891
+ // Condition must explain which kind of resource is unknown or unsupported.
890
892
//
891
- // Support: Custom
893
+ // * It refers to a resource that does not exist. In this case, the Reason must
894
+ // be set to `BackendNotFound` and the Message of the Condition must explain
895
+ // which resource does not exist.
896
+ //
897
+ // * It refers a resource in another namespace when the reference has not been
898
+ // explicitly allowed by a ReferenceGrant (or equivalent concept). In this
899
+ // case, the Reason must be set to `RefNotPermitted` and the Message of the
900
+ // Condition must explain which cross-namespace reference is not allowed.
901
+ //
902
+ // Support: Core for Kubernetes Service
903
+ //
904
+ // Support: Custom for any other resource
905
+ //
906
+ // Support for weight: Core
892
907
//
893
908
// +optional
894
909
BackendRef `json:",inline"`
0 commit comments