I’m trying to add an ext_auth filter into Envoy using Consul’s escape hatch, but as soon as I start the side car I get “StreamAggregatedResources gRPC config stream closed: 2, Any JSON doesn’t have ‘@type’” This appears to be a configuration version mismatch between Consul and Envoy. Using the same configuration in a standalone Envoy works correctly and falls over when the same filter configuration is added to envoy_public_listener_json in the proxy_defaults.
I’m running the latest Envoy version 1.18.2, and the 1.10.0 beta1 version of Consul as the latest version of Consul does not appear to work with 1.18.2
service.hcl
service {
name = “my-server”
id = “my-server-1”
port = 8080
tags = [“v1”]
meta = {
version = “1”
}
connect {
sidecar_service {
port = 20000
}
}
check {
id = “my-server-check”
http = “http://localhost:8080/system/v1/ping”
method = “GET”
interval = “10s”
timeout = “1s”
}
}
proxy-defaults.hcl
Kind = “proxy-defaults”
Name = “my-server”
Config {
protocol = “http”
envoy_public_listener_json = <<EOF
{
"name": "public_listener",
"address": {
"socket_address": {
"address": "0.0.0.0",
"port_value": 21000
}
},
"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",
"route_config": {
"name": "local_route",
"virtual_hosts": [
{
"name": "local_service",
"domains": [
"*"
],
"routes": [
{
"match": {
"prefix": "/"
},
"route": {
"cluster": "service_envoyproxy_io",
"host_rewrite_literal": "localhost"
}
}
]
}
]
},
"http_filters": [
{
"name": "envoy.ext_authz",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.filters.http.ext_authz.v3.ExtAuthz",
"http_service": {
"server_uri": {
"uri": "localhost:8090",
"cluster": "ext-authz",
"timeout": "0.250s"
}
}
}
},
{
"name": "envoy.filters.http.router"
}
],
"access_log": [
{
"name": "envoy.access_loggers.stdout",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.access_loggers.stream.v3.StdoutAccessLog"
}
}
]
}
}
}
EOF
envoy_extra_static_clusters_json = <<EOF2
{
“name”: “ext-authz”,
“type”: “STRICT_DNS”,
“connect_timeout”: “0.250s”,
“load_assignment”: {
“cluster_name”: “ext-authz”,
“endpoints”: [
{
“lb_endpoints”: [
{
“endpoint”: {
“address”: {
“socket_address”: {
“address”: “127.0.0.1”,
“port_value”: 8090
}
}
}
}
]
}
]
}
}
EOF2
}
consul config write proxy-defaults.hcl
consul services register service.hcl
consul connect envoy -sidecar-for my-server-1 -admin-bind 127.0.0.1:19000 &