Skip to content

Commit 1139048

Browse files
committed
Fix Envoy proxy failing in tcp-metrics
Description: This fixes a previous open issue #39 Updated envoy.yaml - Envoy now calls for typed_config in `v3` - Rearranged placement of the filters, but it probably can be reworked to make it cleaner - Clusters is now set up with an endpoint, instead of `hosts` - Probably need to fix spacing Signed-off-by: Antonette Caldwell <[email protected]>
1 parent 693a7fd commit 1139048

File tree

4 files changed

+130
-112
lines changed

4 files changed

+130
-112
lines changed

tcp-metrics/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ edition = "2018"
1010
crate-type = ["cdylib"]
1111

1212
[dependencies]
13-
proxy-wasm = "0.1.0"
13+
proxy-wasm = "0.2.0"
1414
wasm-bindgen = "0.2"

tcp-metrics/envoy.yaml

+64-55
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,74 @@
11
static_resources:
22
listeners:
3-
- name: main
4-
address:
5-
socket_address:
6-
address: 0.0.0.0
7-
port_value: 80
8-
filter_chains:
9-
- filters:
10-
- name: envoy.filters.network.wasm
11-
config:
12-
config:
13-
name: "tcp_metrics"
14-
root_id: "tcp_metrics"
15-
vm_config:
16-
runtime: "envoy.wasm.runtime.v8"
17-
code:
18-
local:
19-
filename: "/etc/tcp_metrics.wasm"
20-
allow_precompiled: true
21-
- name: envoy.tcp_proxy
22-
config:
23-
stat_prefix: ingress_tcp
24-
cluster: web_service
25-
- name: staticreply
26-
address:
27-
socket_address:
28-
address: 127.0.0.1
29-
port_value: 8099
30-
filter_chains:
31-
- filters:
32-
- name: envoy.http_connection_manager
33-
config:
34-
stat_prefix: ingress_http
35-
codec_type: auto
36-
route_config:
37-
name: local_route
38-
virtual_hosts:
39-
- name: local_service
40-
domains:
41-
- "*"
42-
routes:
43-
- match:
44-
prefix: "/"
45-
direct_response:
46-
status: 200
47-
body:
48-
inline_string: "example body\n"
49-
http_filters:
50-
- name: envoy.router
51-
config: {}
3+
- name: main
4+
address:
5+
socket_address:
6+
address: 0.0.0.0
7+
port_value: 80
8+
filter_chains:
9+
- filters:
10+
- name: envoy.filters.network.tcp_proxy
11+
typed_config:
12+
"@type": type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
13+
stat_prefix: ingress_tcp
14+
cluster: web_service
15+
- name: staticreply
16+
address:
17+
socket_address:
18+
address: 127.0.0.1
19+
port_value: 8099
20+
filter_chains:
21+
- filters:
22+
- name: envoy.http_connection_manager
23+
typed_config:
24+
"@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
25+
stat_prefix: ingress_http
26+
codec_type: AUTO
27+
route_config:
28+
name: local_route
29+
virtual_hosts:
30+
- name: local_service
31+
domains:
32+
- "*"
33+
routes:
34+
- match:
35+
prefix: "/"
36+
direct_response:
37+
status: 200
38+
body:
39+
inline_string: "example body\n"
40+
http_filters:
41+
- name: envoy.filters.http.wasm
42+
typed_config:
43+
"@type": type.googleapis.com/udpa.type.v1.TypedStruct
44+
type_url: type.googleapis.com/envoy.extensions.filters.http.wasm.v3.Wasm
45+
value:
46+
config:
47+
vm_config:
48+
vm_id: "tcp_metrics"
49+
runtime: "envoy.wasm.runtime.v8"
50+
code:
51+
local:
52+
filename: "/etc/tcp_metrics.wasm"
53+
- name: envoy.filters.http.router
54+
typed_config:
55+
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
5256
clusters:
5357
- name: web_service
54-
connect_timeout: 0.25s
5558
type: STRICT_DNS
5659
lb_policy: round_robin
57-
hosts:
58-
- socket_address:
59-
address: web_service
60-
port_value: 5678
60+
connect_timeout: 0.25s
61+
load_assignment:
62+
cluster_name: web_service
63+
endpoints:
64+
- lb_endpoints:
65+
- endpoint:
66+
address:
67+
socket_address:
68+
address: web_service
69+
port_value: 5678
6170
admin:
62-
access_log_path: "/dev/null"
71+
access_log_path: /dev/null
6372
address:
6473
socket_address:
6574
address: 0.0.0.0

tcp-packet-parse/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ edition = "2018"
1010
crate-type = ["cdylib"]
1111

1212
[dependencies]
13-
proxy-wasm = "0.1.0"
13+
proxy-wasm = "0.2.0"
1414
wasm-bindgen = "0.2"

tcp-packet-parse/envoy.yaml

+64-55
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,74 @@
11
static_resources:
22
listeners:
3-
- name: main
4-
address:
5-
socket_address:
6-
address: 0.0.0.0
7-
port_value: 80
8-
filter_chains:
9-
- filters:
10-
- name: envoy.filters.network.wasm
11-
config:
12-
config:
13-
name: "tcp_packet_parse"
14-
root_id: "tcp_packet_parse"
15-
vm_config:
16-
runtime: "envoy.wasm.runtime.v8"
17-
code:
18-
local:
19-
filename: "/etc/tcp_packet_parse.wasm"
20-
allow_precompiled: true
21-
- name: envoy.tcp_proxy
22-
config:
23-
stat_prefix: ingress_tcp
24-
cluster: web_service
25-
- name: staticreply
26-
address:
27-
socket_address:
28-
address: 127.0.0.1
29-
port_value: 8099
30-
filter_chains:
31-
- filters:
32-
- name: envoy.http_connection_manager
33-
config:
34-
stat_prefix: ingress_http
35-
codec_type: auto
36-
route_config:
37-
name: local_route
38-
virtual_hosts:
39-
- name: local_service
40-
domains:
41-
- "*"
42-
routes:
43-
- match:
44-
prefix: "/"
45-
direct_response:
46-
status: 200
47-
body:
48-
inline_string: "example body\n"
49-
http_filters:
50-
- name: envoy.router
51-
config: {}
3+
- name: main
4+
address:
5+
socket_address:
6+
address: 0.0.0.0
7+
port_value: 80
8+
filter_chains:
9+
- filters:
10+
- name: envoy.filters.network.tcp_proxy
11+
typed_config:
12+
"@type": type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
13+
stat_prefix: ingress_tcp
14+
cluster: web_service
15+
- name: staticreply
16+
address:
17+
socket_address:
18+
address: 127.0.0.1
19+
port_value: 8099
20+
filter_chains:
21+
- filters:
22+
- name: envoy.http_connection_manager
23+
typed_config:
24+
"@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
25+
stat_prefix: ingress_http
26+
codec_type: AUTO
27+
route_config:
28+
name: local_route
29+
virtual_hosts:
30+
- name: local_service
31+
domains:
32+
- "*"
33+
routes:
34+
- match:
35+
prefix: "/"
36+
direct_response:
37+
status: 200
38+
body:
39+
inline_string: "example body\n"
40+
http_filters:
41+
- name: envoy.filters.http.wasm
42+
typed_config:
43+
"@type": type.googleapis.com/udpa.type.v1.TypedStruct
44+
type_url: type.googleapis.com/envoy.extensions.filters.http.wasm.v3.Wasm
45+
value:
46+
config:
47+
vm_config:
48+
vm_id: "tcp_packet_parse"
49+
runtime: "envoy.wasm.runtime.v8"
50+
code:
51+
local:
52+
filename: "/etc/tcp_packet_parse.wasm"
53+
- name: envoy.filters.http.router
54+
typed_config:
55+
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
5256
clusters:
5357
- name: web_service
54-
connect_timeout: 0.25s
5558
type: STRICT_DNS
5659
lb_policy: round_robin
57-
hosts:
58-
- socket_address:
59-
address: web_service
60-
port_value: 5678
60+
connect_timeout: 0.25s
61+
load_assignment:
62+
cluster_name: web_service
63+
endpoints:
64+
- lb_endpoints:
65+
- endpoint:
66+
address:
67+
socket_address:
68+
address: web_service
69+
port_value: 5678
6170
admin:
62-
access_log_path: "/dev/null"
71+
access_log_path: /dev/null
6372
address:
6473
socket_address:
6574
address: 0.0.0.0

0 commit comments

Comments
 (0)