@@ -240,14 +240,19 @@ type HTTPRouteRule struct {
240
240
// +kubebuilder:validation:MaxItems=16
241
241
Filters []HTTPRouteFilter `json:"filters,omitempty"`
242
242
243
- // ForwardTo defines the backend(s) where matching requests should be sent.
244
- // If unspecified, the rule performs no forwarding. If unspecified and no
245
- // filters are specified that would result in a response being sent, a 503
246
- // error code is returned.
243
+ // BackendRefs defines the backend(s) where matching requests should be
244
+ // sent. If unspecified, the rule performs no forwarding. If unspecified and
245
+ // no filters are specified that would result in a response being sent,
246
+ // a HTTP 503 status code is returned.
247
+ //
248
+ // Support: Core for Kubernetes Service
249
+ // Support: Custom for any other resource
250
+ //
251
+ // Support for weight: Core
247
252
//
248
253
// +optional
249
254
// +kubebuilder:validation:MaxItems=16
250
- ForwardTo []HTTPRouteForwardTo `json:"forwardTo ,omitempty"`
255
+ BackendRefs []HTTPBackendRef `json:"backendRefs ,omitempty"`
251
256
}
252
257
253
258
// PathMatchType specifies the semantics of how HTTP paths should be compared.
@@ -563,7 +568,7 @@ const (
563
568
//
564
569
// Support in HTTPRouteRule: Core
565
570
//
566
- // Support in HTTPRouteForwardTo : Extended
571
+ // Support in HTTPBackendRef : Extended
567
572
HTTPRouteFilterRequestHeaderModifier HTTPRouteFilterType = "RequestHeaderModifier"
568
573
569
574
// HTTPRouteFilterRequestRedirect can be used to redirect a request to
@@ -572,7 +577,7 @@ const (
572
577
//
573
578
// Support in HTTPRouteRule: Core
574
579
//
575
- // Support in HTTPRouteForwardTo : Extended
580
+ // Support in HTTPBackendRef : Extended
576
581
HTTPRouteFilterRequestRedirect HTTPRouteFilterType = "RequestRedirect"
577
582
578
583
// HTTPRouteFilterRequestMirror can be used to mirror HTTP requests to a
@@ -581,15 +586,15 @@ const (
581
586
//
582
587
// Support in HTTPRouteRule: Extended
583
588
//
584
- // Support in HTTPRouteForwardTo : Extended
589
+ // Support in HTTPBackendRef : Extended
585
590
HTTPRouteFilterRequestMirror HTTPRouteFilterType = "RequestMirror"
586
591
587
592
// HTTPRouteFilterExtensionRef should be used for configuring custom
588
593
// HTTP filters.
589
594
//
590
595
// Support in HTTPRouteRule: Custom
591
596
//
592
- // Support in HTTPRouteForwardTo : Custom
597
+ // Support in HTTPBackendRef : Custom
593
598
HTTPRouteFilterExtensionRef HTTPRouteFilterType = "ExtensionRef"
594
599
)
595
600
@@ -716,112 +721,30 @@ type HTTPRequestRedirect struct {
716
721
717
722
// HTTPRequestMirrorFilter defines configuration for the RequestMirror filter.
718
723
type HTTPRequestMirrorFilter struct {
719
- // ServiceName refers to the name of the Service to mirror matched requests
720
- // to. When specified, this takes the place of BackendRef. If both
721
- // BackendRef and ServiceName are specified, ServiceName will be given
722
- // precedence.
724
+ // BackendRef references a resource where mirrored requests are sent.
723
725
//
724
726
// If the referent cannot be found, the rule is not included in the route.
725
727
// The controller should raise the "ResolvedRefs" condition on the Gateway
726
728
// with the "DegradedRoutes" reason. The gateway status for this route should
727
729
// be updated with a condition that describes the error more specifically.
728
730
//
729
- // Support: Core
731
+ // Support: Extended for Kubernetes Service
732
+ // Support: Custom for any other resource
730
733
//
731
734
// +optional
732
- // +kubebuilder:validation:MaxLength=253
733
- ServiceName * string `json:"serviceName,omitempty"`
735
+ BackendRef * BackendObjectReference `json:"backendRef,omitempty"`
736
+ }
734
737
735
- // BackendRef is a local object reference to mirror matched requests to. If
736
- // both BackendRef and ServiceName are specified, ServiceName will be given
737
- // precedence.
738
+ // HTTPBackendRef defines how a HTTPRoute should forward an HTTP request.
739
+ type HTTPBackendRef struct {
740
+ // BackendRef defines how a Route should forward a request to a Kubernetes
741
+ // resource.
738
742
//
739
743
// If the referent cannot be found, the rule is not included in the route.
740
744
// The controller should raise the "ResolvedRefs" condition on the Gateway
741
745
// with the "DegradedRoutes" reason. The gateway status for this route should
742
746
// be updated with a condition that describes the error more specifically.
743
- //
744
- // Support: Custom
745
- //
746
- // +optional
747
- BackendRef * LocalObjectReference `json:"backendRef,omitempty"`
748
-
749
- // Port specifies the destination port number to use for the
750
- // backend referenced by the ServiceName or BackendRef field.
751
- //
752
- // If unspecified, the destination port in the request is used
753
- // when forwarding to a backendRef or serviceName.
754
- //
755
- // +optional
756
- Port * PortNumber `json:"port,omitempty"`
757
- }
758
-
759
- // HTTPRouteForwardTo defines how a HTTPRoute should forward a request.
760
- type HTTPRouteForwardTo struct {
761
- // ServiceName refers to the name of the Service to forward matched requests
762
- // to. When specified, this takes the place of BackendRef. If both
763
- // BackendRef and ServiceName are specified, ServiceName will be given
764
- // precedence.
765
- //
766
- // If the referent cannot be found, the route must be dropped
767
- // from the Gateway. The controller should raise the "ResolvedRefs"
768
- // condition on the Gateway with the "DegradedRoutes" reason.
769
- // The gateway status for this route should be updated with a
770
- // condition that describes the error more specifically.
771
- //
772
- // The protocol to use should be specified with the AppProtocol field on
773
- // Service resources.
774
- //
775
- // Support: Core
776
- //
777
- // +optional
778
- // +kubebuilder:validation:MaxLength=253
779
- ServiceName * string `json:"serviceName,omitempty"`
780
-
781
- // BackendRef is a reference to a backend to forward matched requests to. If
782
- // both BackendRef and ServiceName are specified, ServiceName will be given
783
- // precedence.
784
- //
785
- // If the referent cannot be found, the route must be dropped
786
- // from the Gateway. The controller should raise the "ResolvedRefs"
787
- // condition on the Gateway with the "DegradedRoutes" reason.
788
- // The gateway status for this route should be updated with a
789
- // condition that describes the error more specifically.
790
- //
791
- // Support: Custom
792
- //
793
- // +optional
794
- BackendRef * LocalObjectReference `json:"backendRef,omitempty"`
795
-
796
- // Port specifies the destination port number to use for the
797
- // backend referenced by the ServiceName or BackendRef field.
798
- // If unspecified, the destination port in the request is used
799
- // when forwarding to a backendRef or serviceName.
800
- //
801
- // Support: Core
802
- //
803
- // +optional
804
- Port * PortNumber `json:"port,omitempty"`
805
-
806
- // Weight specifies the proportion of HTTP requests forwarded to the backend
807
- // referenced by the ServiceName or BackendRef field. This is computed as
808
- // weight/(sum of all weights in this ForwardTo list). For non-zero values,
809
- // there may be some epsilon from the exact proportion defined here
810
- // depending on the precision an implementation supports. Weight is not a
811
- // percentage and the sum of weights does not need to equal 100.
812
- //
813
- // If only one backend is specified and it has a weight greater than 0, 100%
814
- // of the traffic is forwarded to that backend. If weight is set to 0,
815
- // traffic must not be forwarded for this entry. If unspecified, weight
816
- // defaults to 1.
817
- //
818
- // Support: Core
819
- //
820
- // +optional
821
- // +kubebuilder:default=1
822
- // +kubebuilder:validation:Minimum=0
823
- // +kubebuilder:validation:Maximum=1000000
824
- Weight * int32 `json:"weight,omitempty"`
747
+ BackendRef `json:",inline"`
825
748
826
749
// Filters defined at this-level should be executed if and only if the
827
750
// request is being forwarded to the backend defined here.
0 commit comments