gateway api v1.1.1 standard

HTTPRoute.spec.rules[].backendRefs

BackendRefs defines the backend(s) where matching requests should be sent. Failure behavior here depends on how many BackendRefs are specified and how many are invalid. If *all* entries in BackendRefs are invalid, and there are also no filters specified in this route rule, *all* traffic which matches this rule MUST receive a 500 status code. See the HTTPBackendRef definition for the rules about what makes a single HTTPBackendRef invalid. When a HTTPBackendRef is invalid, 500 status codes MUST be returned for requests that would have otherwise been routed to an invalid backend. If multiple backends are specified, and some are invalid, the proportion of requests that would otherwise have been routed to an invalid backend MUST receive a 500 status code. For example, if two backends are specified with equal weights, and one is invalid, 50 percent of traffic must receive a 500. Implementations may choose how that 50 percent is determined. Support: Core for Kubernetes Service Support: Extended for Kubernetes ServiceImport Support: Implementation-specific for any other resource Support for weight: Core

7 fields
HTTPRoute.spec.rules[].backendRefs fields and descriptions
Field / TypeDescription
object[]

Filters defined at this level should be executed if and only if the request is being forwarded to the backend defined here. Support: Implementation-specific (For broader support of filters, use the Filters field in HTTPRouteRule.)

  • maxItems: 16
  • x-kubernetes-validations: [{"message":"May specify either httpRouteFilterRequestRedirect or httpRouteFilterRequestRewrite, but not both","rule":"!(self.exists(f, f.type == 'RequestRedirect') \u0026\u0026 self.exists(f, f.type == 'URLRewrite'))"},{"message":"May specify either httpRouteFilterRequestRedirect or httpRouteFilterRequestRewrite, but not both","rule":"!(self.exists(f, f.type == 'RequestRedirect') \u0026\u0026 self.exists(f, f.type == 'URLRewrite'))"},{"message":"RequestHeaderModifier filter cannot be repeated","rule":"self.filter(f, f.type == 'RequestHeaderModifier').size() \u003c= 1"},{"message":"ResponseHeaderModifier filter cannot be repeated","rule":"self.filter(f, f.type == 'ResponseHeaderModifier').size() \u003c= 1"},{"message":"RequestRedirect filter cannot be repeated","rule":"self.filter(f, f.type == 'RequestRedirect').size() \u003c= 1"},{"message":"URLRewrite filter cannot be repeated","rule":"self.filter(f, f.type == 'URLRewrite').size() \u003c= 1"}]
group
string

Group is the group of the referent. For example, "gateway.networking.k8s.io". When unspecified or empty string, core API group is inferred.

  • default: ""
  • maxLength: 253
  • pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
kind
string

Kind is the Kubernetes resource kind of the referent. For example "Service". Defaults to "Service" when not specified. ExternalName services can refer to CNAME DNS records that may live outside of the cluster and as such are difficult to reason about in terms of conformance. They also may not be safe to forward to (see CVE-2021-25740 for more information). Implementations SHOULD NOT support ExternalName Services. Support: Core (Services with a type other than ExternalName) Support: Implementation-specific (Services with type ExternalName)

  • default: "Service"
  • minLength: 1
  • maxLength: 63
  • pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
name
string required

Name is the name of the referent.

  • minLength: 1
  • maxLength: 253
namespace
string

Namespace is the namespace of the backend. When unspecified, the local namespace is inferred. Note that when a namespace different than the local namespace is specified, a ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details. Support: Core

  • minLength: 1
  • maxLength: 63
  • pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
port
integer

Port specifies the destination port number to use for this resource. Port is required when the referent is a Kubernetes Service. In this case, the port number is the service port number, not the target port. For other resources, destination port might be derived from the referent resource or this field.

  • format: int32
  • minimum: 1
  • maximum: 65535
weight
integer

Weight specifies the proportion of requests forwarded to the referenced backend. This is computed as weight/(sum of all weights in this BackendRefs list). For non-zero values, there may be some epsilon from the exact proportion defined here depending on the precision an implementation supports. Weight is not a percentage and the sum of weights does not need to equal 100. If only one backend is specified and it has a weight greater than 0, 100% of the traffic is forwarded to that backend. If weight is set to 0, no traffic should be forwarded for this entry. If unspecified, weight defaults to 1. Support for this field varies based on the context where used.

  • format: int32
  • default: 1
  • minimum: 0
  • maximum: 1000000