Hi.
I’ve spend a lot of time to understand what’s wrong with my config.
I’ve even tried a config from istio documentation and it’s always says “lua cluster invalid. must be configured.”
Can someone please help to understand what am I missing?
Thanks!
Attaching my config:
apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
name: service-telepresence-header
namespace: nda
spec:
configPatches:
# The first patch adds the lua filter to the listener/http connection manager
- applyTo: HTTP_FILTER
match:
context: GATEWAY
listener:
filterChain:
filter:
name: "envoy.filters.network.http_connection_manager"
subFilter:
name: "envoy.filters.http.router"
patch:
operation: INSERT_FIRST
value: # lua filter specification
name: envoy.filters.http.lua
typed_config:
"@type": "type.googleapis.com/envoy.extensions.filters.http.lua.v3.Lua"
inlineCode: |
function envoy_on_request(request_handle)
request_handle:logWarn("Inside telepresence-header envoy filter")
local path = request_handle:headers():get(":path")
request_handle:logWarn("telepresence-header request path: "..path)
local headers, body = request_handle:httpCall(
"dummy_cluster",
{
[":method"] = "GET",
[":path"] = "/",
[":authority"] = "dummy_cluster"
},
"",
5000)
request_handle:logWarn("telepresence-header request made: "..body)
end
# The second patch adds the cluster that is referenced by the lua code
# cds match is omitted as a new cluster is being added
- applyTo: HTTP_FILTER
match:
context: SIDECAR_OUTBOUND
patch:
operation: ADD
value: # cluster specification
name: "dummy_cluster"
type: "STRICT_DNS"
connect_timeout: "3.000s"
lb_policy: "ROUND_ROBIN"
dns_lookup_family: "V4_ONLY"
load_assignment:
cluster_name: "dummy_cluster"
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
protocol: "TCP"
address: "some-url.com"
port_value: 80