HttpFilter CRD
EnRoute Technical Reference
HttpFilter CRD
A HttpFilter provides a mechanism to add additional policy logic that applies to all routes. HttpFilters are global and do not need to be associated with GatewayHost or a ServiceRoute
An example HttpFilter to run some lua code per-route can be specified using -
apiVersion: enroute.saaras.io/v1beta1
kind: HttpFilter
metadata:
labels:
app: httpbin
name: luafilter
namespace: httpbin
spec:
name: luafilter
type: http_filter_lua
httpFilterConfig:
config: |
function envoy_on_request(request_handle)
request_handle:logInfo("Hello World request httpbin");
end
function envoy_on_response(response_handle)
response_handle:logInfo("Hello World response httpbin");
end
---
This lua filter is invoked for all HTTP traffic.
HttpFilter to Envoy configuration
HttpFilter configuration influences the Envoy Listenerconfigurations.
Envoy needs Listener configuration to create listeners for VirtualHost, Route and Cluster. By default, an ingress_http and ingress_https listeners are created.
Complete ServiceRoute CRD Spec
A complete description of the HttpFilter CRD spec is located in github