Skip to content

Commit 6f39f3e

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 6f39f3e

File tree

6 files changed

+184
-144
lines changed

6 files changed

+184
-144
lines changed

singleton-http-call/Cargo.toml

Lines changed: 1 addition & 1 deletion
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"

singleton-http-call/envoy.yaml

Lines changed: 55 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,28 @@
1+
bootstrap_extensions:
2+
- name: envoy.bootstrap.wasm
3+
typed_config:
4+
"@type": type.googleapis.com/envoy.extensions.wasm.v3.WasmService
5+
singleton: true
6+
config:
7+
vm_config:
8+
vm_id: "singleton-http-call"
9+
runtime: "envoy.wasm.runtime.v8"
10+
code:
11+
local:
12+
filename: "/etc/singleton_http_call.wasm"
113
static_resources:
214
listeners:
3-
- name: main
4-
address:
15+
- address:
516
socket_address:
617
address: 0.0.0.0
718
port_value: 80
819
filter_chains:
920
- filters:
10-
- name: envoy.http_connection_manager
11-
config:
21+
- name: envoy.filters.network.http_connection_manager
22+
typed_config:
23+
"@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
24+
codec_type: AUTO
1225
stat_prefix: ingress_http
13-
codec_type: auto
1426
route_config:
1527
name: local_route
1628
virtual_hosts:
@@ -23,19 +35,21 @@ static_resources:
2335
route:
2436
cluster: web_service
2537
http_filters:
26-
- name: envoy.router
27-
config: {}
38+
- name: envoy.filters.http.router
39+
typed_config:
40+
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
2841
- name: staticreply
2942
address:
3043
socket_address:
3144
address: 127.0.0.1
3245
port_value: 8099
3346
filter_chains:
3447
- filters:
35-
- name: envoy.http_connection_manager
36-
config:
48+
- name: envoy.filters.network.http_connection_manager
49+
typed_config:
50+
"@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
51+
codec_type: AUTO
3752
stat_prefix: ingress_http
38-
codec_type: auto
3953
route_config:
4054
name: local_route
4155
virtual_hosts:
@@ -50,36 +64,44 @@ static_resources:
5064
body:
5165
inline_string: "example body\n"
5266
http_filters:
53-
- name: envoy.router
54-
config: {}
67+
- name: envoy.filters.http.wasm
68+
typed_config:
69+
"@type": type.googleapis.com/envoy.extensions.filters.http.wasm.v3.Wasm
70+
config:
71+
vm_config:
72+
vm_id: "singleton-http-call"
73+
runtime: "envoy.wasm.runtime.v8"
74+
code:
75+
local:
76+
filename: "/etc/singleton_http_call.wasm"
77+
- name: envoy.filters.http.router
78+
typed_config:
79+
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
5580
clusters:
5681
- name: web_service
57-
connect_timeout: 0.25s
5882
type: STRICT_DNS
5983
lb_policy: round_robin
60-
hosts:
61-
- socket_address:
62-
address: web_service
63-
port_value: 5678
84+
load_assignment:
85+
cluster_name: web_service
86+
endpoints:
87+
- lb_endpoints:
88+
- endpoint:
89+
address:
90+
socket_address:
91+
address: web_service
92+
port_value: 5678
6493
- name: wasm_upstream
65-
connect_timeout: 0.25s
6694
type: STRICT_DNS
6795
lb_policy: round_robin
68-
hosts:
69-
- socket_address:
70-
address: wasm_upstream
71-
port_value: 8080
72-
wasm_service:
73-
- config:
74-
name: envoy.filters.http.wasm
75-
root_id: "singleton-http-call"
76-
vm_config:
77-
runtime: "envoy.wasm.runtime.v8"
78-
code:
79-
local:
80-
filename: "/etc/singleton_http_call.wasm"
81-
allow_precompiled: true
82-
singleton: true
96+
load_assignment:
97+
cluster_name: wasm_upstream
98+
endpoints:
99+
- lb_endpoints:
100+
- endpoint:
101+
address:
102+
socket_address:
103+
address: wasm_upstream
104+
port_value: 8080
83105
admin:
84106
access_log_path: "/dev/null"
85107
address:

tcp-metrics/Cargo.toml

Lines changed: 1 addition & 1 deletion
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

Lines changed: 63 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,72 @@
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:
6271
access_log_path: "/dev/null"
6372
address:

tcp-packet-parse/Cargo.toml

Lines changed: 1 addition & 1 deletion
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"

0 commit comments

Comments
 (0)