HTTPRouteFilter is a custom Envoy Gateway HTTPRouteFilter which provides extended traffic processing options such as path regex rewrite, direct response and more.
Unchanged since Envoy Gateway v1.8.0
APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
Spec defines the desired state of HTTPRouteFilter.
HTTPCredentialInjectionFilter defines the configuration to inject credentials into the request. This is useful when the backend service requires credentials in the request, and the original request does not contain them. The filter can inject credentials into the request before forwarding it to the backend service.
Credential is the credential to be injected.
ValueRef is a reference to the secret containing the credentials to be injected. This is an Opaque secret. The credential should be stored in the key "credential", and the value should be the credential to be injected. For example, for basic authentication, the value should be "Basic <base64 encoded username:password>". for bearer token, the value should be "Bearer <token>".
Group is the group of the referent. For example, "gateway.networking.k8s.io". When unspecified or empty string, core API group is inferred.
Kind is kind of the referent. For example "Secret".
Name is the name of the referent.
Namespace is the namespace of the referenced object. 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
Header is the name of the header where the credentials are injected. If not specified, the credentials are injected into the Authorization header.
Whether to overwrite the value or not if the injected headers already exist. If not specified, the default value is false.
HTTPDirectResponseFilter defines the configuration to return a fixed response.
Body of the direct response. Supports Envoy command operators for dynamic content (see https://www.envoyproxy.io/docs/envoy/latest/configuration/observability/access_log/usage#command-operators).
Inline contains the value as an inline string.
Type is the type of method to use to read the body value. Valid values are Inline and ValueRef, default is Inline.
ValueRef contains the contents of the body specified as a local object reference. Only a reference to ConfigMap is supported. The value of key `response.body` in the ConfigMap will be used as the response body. If the key is not found, the first value in the ConfigMap will be used.
Group is the group of the referent. For example, "gateway.networking.k8s.io". When unspecified or empty string, core API group is inferred.
Kind is kind of the referent. For example "HTTPRoute" or "Service".
Name is the name of the referent.
Content Type of the direct response. This will be set in the Content-Type header.
Header defines the headers of the direct response.
Add adds the given header(s) (name, value) to the request before the action. It appends to any existing values associated with the header name. Input: GET /foo HTTP/1.1 my-header: foo Config: add: - name: "my-header" value: "bar,baz" Output: GET /foo HTTP/1.1 my-header: foo,bar,baz
Name is the name of the HTTP Header to be matched. Name matching MUST be case-insensitive. (See https://tools.ietf.org/html/rfc7230#section-3.2). If multiple entries specify equivalent header names, the first entry with an equivalent name MUST be considered for a match. Subsequent entries with an equivalent header name MUST be ignored. Due to the case-insensitivity of header names, "foo" and "Foo" are considered equivalent.
Value is the value of HTTP Header to be matched. <gateway:experimental:description> Must consist of printable US-ASCII characters, optionally separated by single tabs or spaces. See: https://tools.ietf.org/html/rfc7230#section-3.2 </gateway:experimental:description> <gateway:experimental:validation:Pattern=`^[!-~]+([\t ]?[!-~]+)*$`>
Remove the given header(s) from the HTTP request before the action. The value of Remove is a list of HTTP header names. Note that the header names are case-insensitive (see https://datatracker.ietf.org/doc/html/rfc2616#section-4.2). Input: GET /foo HTTP/1.1 my-header1: foo my-header2: bar my-header3: baz Config: remove: ["my-header1", "my-header3"] Output: GET /foo HTTP/1.1 my-header2: bar
Set overwrites the request with the given header (name, value) before the action. Input: GET /foo HTTP/1.1 my-header: foo Config: set: - name: "my-header" value: "bar" Output: GET /foo HTTP/1.1 my-header: bar
Name is the name of the HTTP Header to be matched. Name matching MUST be case-insensitive. (See https://tools.ietf.org/html/rfc7230#section-3.2). If multiple entries specify equivalent header names, the first entry with an equivalent name MUST be considered for a match. Subsequent entries with an equivalent header name MUST be ignored. Due to the case-insensitivity of header names, "foo" and "Foo" are considered equivalent.
Value is the value of HTTP Header to be matched. <gateway:experimental:description> Must consist of printable US-ASCII characters, optionally separated by single tabs or spaces. See: https://tools.ietf.org/html/rfc7230#section-3.2 </gateway:experimental:description> <gateway:experimental:validation:Pattern=`^[!-~]+([\t ]?[!-~]+)*$`>
Status Code of the HTTP response If unset, defaults to 200.
Matches defines additional matching criteria for the HTTPRoute rule. As with HTTPRouteRule.Matches, the rule is matched if any one match applies. When both HTTPRouteRule.Matches and HTTPRouteFilter.Matches are set, the effective matching is the logical AND of the two sets.
Cookies is a list of cookie matchers evaluated against the HTTP request. All specified matchers must match.
Name is the cookie name to evaluate.
Type specifies how to match against the value of the cookie.
Value is the cookie value to be matched.
HTTPURLRewriteFilter define rewrites of HTTP URL components such as path and host
AppendXForwardedHost controls whether the original Host header value is appended to the X-Forwarded-Host header when hostname rewriting is configured. Defaults to true for backward compatibility.
Hostname is the value to be used to replace the Host header value during forwarding.
Header is the name of the header whose value would be used to rewrite the Host header
HTTPPathModifierType defines the type of Hostname rewrite.
Path defines a path rewrite.
ReplaceRegexMatch defines a path regex rewrite. The path portions matched by the regex pattern are replaced by the defined substitution. https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/route/v3/route_components.proto#envoy-v3-api-field-config-route-v3-routeaction-regex-rewrite Some examples: (1) replaceRegexMatch: pattern: ^/service/([^/]+)(/.*)$ substitution: \2/instance/\1 Would transform /service/foo/v1/api into /v1/api/instance/foo. (2) replaceRegexMatch: pattern: one substitution: two Would transform /xxx/one/yyy/one/zzz into /xxx/two/yyy/two/zzz. (3) replaceRegexMatch: pattern: ^(.*?)one(.*)$ substitution: \1two\2 Would transform /xxx/one/yyy/one/zzz into /xxx/two/yyy/one/zzz. (3) replaceRegexMatch: pattern: (?i)/xxx/ substitution: /yyy/ Would transform path /aaa/XxX/bbb into /aaa/yyy/bbb (case-insensitive).
Pattern matches a regular expression against the value of the HTTP Path.The regex string must adhere to the syntax documented in https://github.com/google/re2/wiki/Syntax.
Substitution is an expression that replaces the matched portion.The expression may include numbered capture groups that adhere to syntax documented in https://github.com/google/re2/wiki/Syntax.
HTTPPathModifierType defines the type of path redirect or rewrite.
Source: gateway.envoyproxy.io_httproutefilters.yaml
Changes to HTTPRouteFilter (gateway.envoyproxy.io/v1alpha1) in each Envoy Gateway version, compared to the version before it.
HTTPRouteFilter was already present in this version of Envoy Gateway, the oldest one on kubespec.dev
Released · View HTTPRouteFilter in v1.8.0
No examples of HTTPRouteFilter yet. Contribute one on GitHub.