This resource is part of the v1alpha1 API and is subject to change. Fields and behavior may change in future releases.
Identity
| |
|---|
| Group | gateway.envoyproxy.io |
| Version | v1alpha1 |
| Kind | HTTPRouteFilter |
| Scope | Project |
Overview
An HTTPRouteFilter is an Envoy Gateway extension to the Gateway API, defined by the Envoy Gateway API, that provides extended HTTP traffic processing options beyond the standard filters. Use it when a route needs behavior such as rewriting URL path or host, returning a fixed direct response, or injecting credentials into requests before they reach a backend.
You reference an HTTPRouteFilter from an HTTPRoute (via an extension-reference filter) so the extended processing applies to the matching traffic within a Project.
Spec fields
| Field | Type | Required | Description |
|---|
spec.credentialInjection | Object | No | Injects credentials into the request before forwarding to the backend. Useful when the backend requires credentials that the original request does not carry. |
spec.credentialInjection.credential | Object | Yes* | The credential to inject. Required when credentialInjection is set. |
spec.credentialInjection.header | string | No | Name of the header the credentials are injected into. Defaults to the Authorization header. |
spec.credentialInjection.overwrite | boolean | No | Whether to overwrite the value if the injected header already exists. Defaults to false. |
spec.directResponse | Object | No | Returns a fixed response instead of forwarding to a backend. |
spec.directResponse.body | Object | No | Body of the response. |
spec.directResponse.contentType | string | No | Content type of the response, set in the Content-Type header. |
spec.directResponse.statusCode | integer | No | HTTP status code of the response. Defaults to 200 if unset. |
spec.urlRewrite | Object | No | Rewrites HTTP URL components such as path and host. |
spec.urlRewrite.hostname | Object | No | Value used to replace the Host header during forwarding. |
spec.urlRewrite.path | Object | No | Defines a path rewrite. |
* credentialInjection.credential is required only when the credentialInjection block is present.
This resource has no status field.
Usage
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: HTTPRouteFilter
metadata:
name: fixed-maintenance-response
spec:
directResponse:
statusCode: 503
contentType: text/plain
datumctl apply -f httproutefilter.yaml --project my-project
datumctl get httproutefilters --project my-project
datumctl describe httproutefilter fixed-maintenance-response --project my-project
Run datumctl explain httproutefilters --recursive to see the full, live field tree for this resource.