Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Envoy proxy failing in tcp-metrics #49

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion singleton-http-call/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ edition = "2018"
crate-type = ["cdylib"]

[dependencies]
proxy-wasm = "0.1.0"
proxy-wasm = "0.2.0"
wasm-bindgen = "0.2"
88 changes: 55 additions & 33 deletions singleton-http-call/envoy.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,28 @@
bootstrap_extensions:
- name: envoy.bootstrap.wasm
typed_config:
"@type": type.googleapis.com/envoy.extensions.wasm.v3.WasmService
singleton: true
config:
vm_config:
vm_id: "singleton-http-call"
runtime: "envoy.wasm.runtime.v8"
code:
local:
filename: "/etc/singleton_http_call.wasm"
static_resources:
listeners:
- name: main
address:
- address:
socket_address:
address: 0.0.0.0
port_value: 80
filter_chains:
- filters:
- name: envoy.http_connection_manager
config:
- name: envoy.filters.network.http_connection_manager
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
codec_type: AUTO
stat_prefix: ingress_http
codec_type: auto
route_config:
name: local_route
virtual_hosts:
Expand All @@ -23,19 +35,21 @@ static_resources:
route:
cluster: web_service
http_filters:
- name: envoy.router
config: {}
- name: envoy.filters.http.router
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
- name: staticreply
address:
socket_address:
address: 127.0.0.1
port_value: 8099
filter_chains:
- filters:
- name: envoy.http_connection_manager
config:
- name: envoy.filters.network.http_connection_manager
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
codec_type: AUTO
stat_prefix: ingress_http
codec_type: auto
route_config:
name: local_route
virtual_hosts:
Expand All @@ -50,36 +64,44 @@ static_resources:
body:
inline_string: "example body\n"
http_filters:
- name: envoy.router
config: {}
- name: envoy.filters.http.wasm
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.wasm.v3.Wasm
config:
vm_config:
vm_id: "singleton-http-call"
runtime: "envoy.wasm.runtime.v8"
code:
local:
filename: "/etc/singleton_http_call.wasm"
- name: envoy.filters.http.router
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
clusters:
- name: web_service
connect_timeout: 0.25s
type: STRICT_DNS
lb_policy: round_robin
hosts:
- socket_address:
address: web_service
port_value: 5678
load_assignment:
cluster_name: web_service
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: web_service
port_value: 5678
- name: wasm_upstream
connect_timeout: 0.25s
type: STRICT_DNS
lb_policy: round_robin
hosts:
- socket_address:
address: wasm_upstream
port_value: 8080
wasm_service:
- config:
name: envoy.filters.http.wasm
root_id: "singleton-http-call"
vm_config:
runtime: "envoy.wasm.runtime.v8"
code:
local:
filename: "/etc/singleton_http_call.wasm"
allow_precompiled: true
singleton: true
load_assignment:
cluster_name: wasm_upstream
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: wasm_upstream
port_value: 8080
admin:
access_log_path: "/dev/null"
address:
Expand Down
2 changes: 1 addition & 1 deletion tcp-metrics/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ edition = "2018"
crate-type = ["cdylib"]

[dependencies]
proxy-wasm = "0.1.0"
proxy-wasm = "0.2.0"
wasm-bindgen = "0.2"
117 changes: 63 additions & 54 deletions tcp-metrics/envoy.yaml
Original file line number Diff line number Diff line change
@@ -1,63 +1,72 @@
static_resources:
listeners:
- name: main
address:
socket_address:
address: 0.0.0.0
port_value: 80
filter_chains:
- filters:
- name: envoy.filters.network.wasm
config:
config:
name: "tcp_metrics"
root_id: "tcp_metrics"
vm_config:
runtime: "envoy.wasm.runtime.v8"
code:
local:
filename: "/etc/tcp_metrics.wasm"
allow_precompiled: true
- name: envoy.tcp_proxy
config:
stat_prefix: ingress_tcp
cluster: web_service
- name: staticreply
address:
socket_address:
address: 127.0.0.1
port_value: 8099
filter_chains:
- filters:
- name: envoy.http_connection_manager
config:
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: "example body\n"
http_filters:
- name: envoy.router
config: {}
- name: main
address:
socket_address:
address: 0.0.0.0
port_value: 80
filter_chains:
- filters:
- name: envoy.filters.network.tcp_proxy
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
stat_prefix: ingress_tcp
cluster: web_service
- name: staticreply
address:
socket_address:
address: 127.0.0.1
port_value: 8099
filter_chains:
- filters:
- name: envoy.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: "example body\n"
http_filters:
- name: envoy.filters.http.wasm
typed_config:
"@type": type.googleapis.com/udpa.type.v1.TypedStruct
type_url: type.googleapis.com/envoy.extensions.filters.http.wasm.v3.Wasm
value:
config:
vm_config:
vm_id: "tcp_metrics"
runtime: "envoy.wasm.runtime.v8"
code:
local:
filename: "/etc/tcp_metrics.wasm"
- name: envoy.filters.http.router
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
clusters:
- name: web_service
connect_timeout: 0.25s
type: STRICT_DNS
lb_policy: round_robin
hosts:
- socket_address:
address: web_service
port_value: 5678
connect_timeout: 0.25s
load_assignment:
cluster_name: web_service
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: web_service
port_value: 5678
admin:
access_log_path: "/dev/null"
address:
Expand Down
2 changes: 1 addition & 1 deletion tcp-packet-parse/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ edition = "2018"
crate-type = ["cdylib"]

[dependencies]
proxy-wasm = "0.1.0"
proxy-wasm = "0.2.0"
wasm-bindgen = "0.2"
Loading