xds: support lookup by alias in dynamic extensions
- Dominant language
- C++
- Stars
- 28.9k
- Forks
- 5.6k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 437
Description
xDS resource aliases appear to be ignored when using Lua, Wasm, and other dynamic extensions. That restricts the ability to modify the cluster names, which are usually internal to the control plane infrastructure.
Example:
```yaml
# lua.yaml
node:
id: test
cluster: test
static_resources:
listeners:
- name: main
address:
socket_address:
address: 0.0.0.0
port_value: 8000
filter_chains:
- filters:
- name: envoy.filters.network.http_connection_manager
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
stat_prefix: ingress_http
codec_type: AUTO
route_config:
name: local_route
virtual_hosts:
- name: local_service
domains:
- "*"
routes:
- match:
prefix: "/"
direct_response:
status: 200
body:
inline_string: "Hello\n"
http_filters:
- name: lua1
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.lua.v3.Lua
default_source_code:
inline_string:
function envoy_on_response(response_handle)
response_handle:headers():add("foo", "bar")
local headers, body = response_handle:httpCall(
"lua_cluster",
{
[":method"] = "GET",
[":path"] = "/",
[":authority"] = "lua_cluster"
},
"hello world",
1000)
response_handle:headers():add("fortio", headers["date"])
end
- name: envoy.filters.http.router
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
clusters:
dynamic_resources:
cds_config:
path_config_source:
path: lua_cluster.yaml
# lua_cluster.yaml
resources:
- "@type": type.googleapis.com/envoy.service.discovery.v3.Resource
name: cluster_0
aliases: ["lua_cluster"]
resource:
"@type": type.googleapis.com/envoy.config.cluster.v3.Cluster
connect_timeout: 1s
name: cluster_0
load_assignment:
cluster_name: cluster_0
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: 127.0.0.1
port_value: 8080
```
Contributor guide
Assessment
This issue has not been assessed yet.