ServiceDefaults Envoy Extensions for Sidecar Proxy Issue

Hi All,
I need some helps with ServiceDefaults Envoy Extensions.

My environment:
Consul mesh version 1.16 with API Gateway
Services will route to API Gateway (path based routing)
Two services deployed and part of the mesh:

Service A
Service B (with v1 and v2)
HttpRoute Setup correctly for Service B and confirmed it was attached correctly to the API Gateway.

From service A , make a call out to service B (my-api-gateway.consul.svc.cluster.local/api/serviceB). By default, it will call service B V1.
Added envoy_on_request(request_handle) function to add header (version: 2) for OUTBOUND to ServiceDefaults of the Service A but the call out to service B
always hit service B V1.

Here’s the sample of ServiceDefaults envoy extensions:

  • name: “builtin/lua”
    required: true
    proxyType: “connect-proxy”
    listener: “outbound”
    script: |-
    function envoy_on_request(request_handle)
    request_handle:headers():add(“version”, “2”)

Could someone please let me know if I missed anything? Note that I can call service B V2 manually via curl -H “version: 2”


I was able to solve the issue detailed in this thread: Document/example how to make httpCall out to other service under Consul Envoy Extensions - #4 by kha7281

This topic was automatically closed 62 days after the last reply. New replies are no longer allowed.