gateway api v1.1.1 experimental

HTTPRoute.spec.rules[].backendRefs[].filters.urlRewrite.spec.rules.matches

Matches define conditions used for matching the rule against incoming HTTP requests. Each match is independent, i.e. this rule will be matched if **any** one of the matches is satisfied. For example, take the following matches configuration: ``` matches: - path: value: "/foo" headers: - name: "version" value: "v2" - path: value: "/v2/foo" ``` For a request to match against this rule, a request must satisfy EITHER of the two conditions: - path prefixed with `/foo` AND contains the header `version: v2` - path prefix of `/v2/foo` See the documentation for HTTPRouteMatch on how to specify multiple match conditions that should be ANDed together. If no matches are specified, the default is a prefix path match on "/", which has the effect of matching every HTTP request. Proxy or Load Balancer routing configuration generated from HTTPRoutes MUST prioritize matches based on the following criteria, continuing on ties. Across all rules specified on applicable Routes, precedence must be given to the match having: * "Exact" path match. * "Prefix" path match with largest number of characters. * Method match. * Largest number of header matches. * Largest number of query param matches. Note: The precedence of RegularExpression path matches are implementation-specific. If ties still exist across multiple Routes, matching precedence MUST be determined in order of the following criteria, continuing on ties: * The oldest Route based on creation timestamp. * The Route appearing first in alphabetical order by "{namespace}/{name}". If ties still exist within an HTTPRoute, matching precedence MUST be granted to the FIRST matching rule (in list order) with a match meeting the above criteria. When no rules matching a request have been successfully attached to the parent a request is coming from, a HTTP 404 status code MUST be returned.

4 fields
HTTPRoute.spec.rules[].backendRefs[].filters.urlRewrite.spec.rules.matches fields and descriptions
Field / TypeDescription
object[]

Headers specifies HTTP request header matchers. Multiple match values are ANDed together, meaning, a request must match all the specified headers to select the route.

  • maxItems: 16
  • x-kubernetes-list-map-keys: ["name"]
  • x-kubernetes-list-type: "map"
method
string

Method specifies HTTP method matcher. When specified, this route will be matched only if the request has the specified method. Support: Extended

  • enum: ["GET","HEAD","POST","PUT","DELETE","CONNECT","OPTIONS","TRACE","PATCH"]
object

Path specifies a HTTP request path matcher. If this field is not specified, a default prefix match on the "/" path is provided.

  • default: {"type":"PathPrefix","value":"/"}
  • x-kubernetes-validations: [{"message":"value must be an absolute path and start with '/' when type one of ['Exact', 'PathPrefix']","rule":"(self.type in ['Exact','PathPrefix']) ? self.value.startsWith('/') : true"},{"message":"must not contain '//' when type one of ['Exact', 'PathPrefix']","rule":"(self.type in ['Exact','PathPrefix']) ? !self.value.contains('//') : true"},{"message":"must not contain '/./' when type one of ['Exact', 'PathPrefix']","rule":"(self.type in ['Exact','PathPrefix']) ? !self.value.contains('/./') : true"},{"message":"must not contain '/../' when type one of ['Exact', 'PathPrefix']","rule":"(self.type in ['Exact','PathPrefix']) ? !self.value.contains('/../') : true"},{"message":"must not contain '%2f' when type one of ['Exact', 'PathPrefix']","rule":"(self.type in ['Exact','PathPrefix']) ? !self.value.contains('%2f') : true"},{"message":"must not contain '%2F' when type one of ['Exact', 'PathPrefix']","rule":"(self.type in ['Exact','PathPrefix']) ? !self.value.contains('%2F') : true"},{"message":"must not contain '#' when type one of ['Exact', 'PathPrefix']","rule":"(self.type in ['Exact','PathPrefix']) ? !self.value.contains('#') : true"},{"message":"must not end with '/..' when type one of ['Exact', 'PathPrefix']","rule":"(self.type in ['Exact','PathPrefix']) ? !self.value.endsWith('/..') : true"},{"message":"must not end with '/.' when type one of ['Exact', 'PathPrefix']","rule":"(self.type in ['Exact','PathPrefix']) ? !self.value.endsWith('/.') : true"},{"message":"type must be one of ['Exact', 'PathPrefix', 'RegularExpression']","rule":"self.type in ['Exact','PathPrefix'] || self.type == 'RegularExpression'"},{"message":"must only contain valid characters (matching ^(?:[-A-Za-z0-9/._~!$\u0026'()*+,;=:@]|[%][0-9a-fA-F]{2})+$) for types ['Exact', 'PathPrefix']","rule":"(self.type in ['Exact','PathPrefix']) ? self.value.matches(r\"\"\"^(?:[-A-Za-z0-9/._~!$\u0026'()*+,;=:@]|[%][0-9a-fA-F]{2})+$\"\"\") : true"}]
object[]

QueryParams specifies HTTP query parameter matchers. Multiple match values are ANDed together, meaning, a request must match all the specified query parameters to select the route. Support: Extended

  • maxItems: 16
  • x-kubernetes-list-map-keys: ["name"]
  • x-kubernetes-list-type: "map"