How can I configure an extra cluster that I need in my (Http)Filter #5301
-
Hello, I'm using a Lua filter to send off some information to an external HTTP service (using https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/lua_filter#httpcall). For this I need an extra backend to exist. Currently I've used an I thought of using a 'dummy' listener and try to hide that from being exposed as a Are there other ways that I'm overlooking? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
@aukevanleeuwen as a workaround, creating a dummy The following YAML snippet is a rough idea how it might look within the lua extension: apiVersion: gateway.envoyproxy.io/v1alpha1
kind: EnvoyExtensionPolicy
metadata:
name: lua-inline-test
spec:
targetRefs:
- group: gateway.networking.k8s.io
kind: HTTPRoute
name: backend
lua:
- type: Inline
inline: |
function envoy_on_response(response_handle)
response_handle:headers():add("x-lua-custom", "FOO")
end
backendRefs:
- name: cluster-used-by-lua
port: 8080 |
Beta Was this translation helpful? Give feedback.
the extra cluster can be created using EnvoyPatchPolicy e.g. from the inference extension project https://github.com/kubernetes-sigs/gateway-api-inference-extension/blob/release-v0.1.0/pkg/manifests/gateway/patch_policy.yaml