envoy.filters.network.http_connection_manager must be the last filter in a network filter chain.

311 views
Skip to first unread message

xinfeng lee

unread,
Feb 7, 2022, 7:51:12 AM2/7/22
to envoy-users
Hi All,
I met this question. I want to filters order:grpc->http->tcp.

Error: terminal filter named envoy.filters.network.http_connection_manager of type envoy.filters.network.http_connection_manager must be the last filter in a network filter chain.

here is the configuration.

static_resources:
listeners:
- namstatic_resources:
listeners:
- name: listener_0
address:
socket_address:
address: 0.0.0.0
port_value: 9901
filter_chains:
- filters:
- name: envoy.filters.network.http_connection_manager
typed_config:
stat_prefix: ingress_http
codec_type: AUTO
route_config:
name: local_route
virtual_hosts:
- name: local_service
domains:
- "*"
routes:
- match:
prefix: /
headers:
- name: content-type
string_match:
exact: application/grpc
route:
cluster: grpc_service
- match:
prefix: /
route:
cluster: http_service
http_filters:
- name: envoy.filters.http.router

- name: envoy.filters.network.tcp_proxy
typed_config:
stat_prefix: ingress_tcp
max_connect_attempts: 5
cluster: tcp_service
clusters:
- name: grpc_service
connect_timeout: 0.25s
type: STATIC
lb_policy: ROUND_ROBIN
typed_extension_protocol_options:
envoy.extensions.upstreams.http.v3.HttpProtocolOptions:
explicit_http_config:
http2_protocol_options: {}
load_assignment:
cluster_name: grpc_service
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: 192.168.56.2
port_value: 10010
- name: http_service
connect_timeout: 0.25s
type: STATIC
lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: http_service
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: 192.168.56.2
port_value: 10020
- name: tcp_service
connect_timeout: 0.25s
type: STATIC
lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: tcp_service
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: 192.168.56.2
port_value: 10030

e: listener_0
address:
socket_address:
address: 0.0.0.0
port_value: 9901
filter_chains:
- filters:
- name: envoy.filters.network.http_connection_manager
typed_config:
stat_prefix: ingress_http
codec_type: AUTO
route_config:
name: local_route
virtual_hosts:
- name: local_service
domains:
- "*"
routes:
- match:
prefix: /
headers:
- name: content-type
string_match:
exact: application/grpc
route:
cluster: grpc_service
- match:
prefix: /
route:
cluster: http_service
http_filters:
- name: envoy.filters.http.router

- name: envoy.filters.network.tcp_proxy
typed_config:
stat_prefix: ingress_tcp
max_connect_attempts: 5
cluster: tcp_service
clusters:
- name: grpc_service
connect_timeout: 0.25s
type: STATIC
lb_policy: ROUND_ROBIN
typed_extension_protocol_options:
envoy.extensions.upstreams.http.v3.HttpProtocolOptions:
explicit_http_config:
http2_protocol_options: {}
load_assignment:
cluster_name: grpc_service
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: 192.168.56.2
port_value: 10010
- name: http_service
connect_timeout: 0.25s
type: STATIC
lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: http_service
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: 192.168.56.2
port_value: 10020
- name: tcp_service
connect_timeout: 0.25s
type: STATIC
lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: tcp_service
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: 192.168.56.2
port_value: 10030


xinfeng lee

unread,
Feb 7, 2022, 7:52:17 AM2/7/22
to envoy-users
I have tried successed once ,but I forget it now. any body can help me? please

Zizon Qiu

unread,
Feb 7, 2022, 8:08:39 AM2/7/22
to xinfeng lee, envoy-users
Are you trying to do something like:

if conenction is grpc:
  goto grpc cluster
else if conection is http:
  goto http cluster
else
  goto tcp cluster

If so, this just can not be done with builtin Envoy Filters,


--
You received this message because you are subscribed to the Google Groups "envoy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to envoy-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/envoy-users/8b9bf2f2-2050-4849-946c-9e7cc6640e9en%40googlegroups.com.

Yan Avlasov

unread,
Feb 8, 2022, 11:28:19 AM2/8/22
to Zizon Qiu, xinfeng lee, envoy-users
You need to explain a bit more what you are trying to achieve. You can also ask in the envoy-users Slack channel to get more information.

Reply all
Reply to author
Forward
0 new messages