mirror of
https://github.com/sablierapp/sablier.git
synced 2025-12-21 13:23:03 +01:00
* feat(plugin): add `proxywasm` plugin The `proxywasm` plugin is a WASM Filter following the ProxyWasm ABI Specification using the proxywasm go sdk This allows extensibility with any reverse proxy who implements the ProxyWasm ABI Specification. The current WASM Filter was successfully tested with APISIX, Envoy, Nginx with ngx_wasm_module from Kong and Istio. Fixes #145
231 lines
10 KiB
YAML
231 lines
10 KiB
YAML
static_resources:
|
|
listeners:
|
|
- name: main
|
|
address:
|
|
socket_address:
|
|
address: 0.0.0.0
|
|
port_value: 8080
|
|
filter_chains:
|
|
- filters:
|
|
# Dynamic Whoami
|
|
- 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
|
|
route_config:
|
|
name: local_route
|
|
virtual_hosts:
|
|
- name: local_service
|
|
domains: ["*"]
|
|
routes:
|
|
- match:
|
|
prefix: "/dynamic/whoami"
|
|
route:
|
|
cluster: whoami
|
|
typed_per_filter_config:
|
|
sablier-wasm-whoami-dynamic:
|
|
"@type": type.googleapis.com/envoy.config.route.v3.FilterConfig
|
|
config: # Note this config field could not be empty because the xDS API requirement.
|
|
"@type": type.googleapis.com/google.protobuf.Empty # Empty as a placeholder.
|
|
is_optional: true
|
|
- match:
|
|
path: "/blocking/whoami"
|
|
route:
|
|
cluster: whoami
|
|
typed_per_filter_config:
|
|
sablier-wasm-whoami-blocking:
|
|
"@type": type.googleapis.com/envoy.config.route.v3.FilterConfig
|
|
config: # Note this config field could not be empty because the xDS API requirement.
|
|
"@type": type.googleapis.com/google.protobuf.Empty # Empty as a placeholder.
|
|
is_optional: true
|
|
- match:
|
|
prefix: "/multiple/whoami"
|
|
route:
|
|
cluster: whoami
|
|
typed_per_filter_config:
|
|
sablier-wasm-multiple:
|
|
"@type": type.googleapis.com/envoy.config.route.v3.FilterConfig
|
|
config: # Note this config field could not be empty because the xDS API requirement.
|
|
"@type": type.googleapis.com/google.protobuf.Empty # Empty as a placeholder.
|
|
is_optional: true
|
|
- match:
|
|
path: "/multiple/nginx"
|
|
route:
|
|
cluster: nginx
|
|
typed_per_filter_config:
|
|
sablier-wasm-multiple:
|
|
"@type": type.googleapis.com/envoy.config.route.v3.FilterConfig
|
|
config: # Note this config field could not be empty because the xDS API requirement.
|
|
"@type": type.googleapis.com/google.protobuf.Empty # Empty as a placeholder.
|
|
is_optional: true
|
|
- match:
|
|
path: "/healthy/nginx"
|
|
route:
|
|
cluster: nginx
|
|
typed_per_filter_config:
|
|
sablier-wasm-healthy:
|
|
"@type": type.googleapis.com/envoy.config.route.v3.FilterConfig
|
|
config: # Note this config field could not be empty because the xDS API requirement.
|
|
"@type": type.googleapis.com/google.protobuf.Empty # Empty as a placeholder.
|
|
is_optional: true
|
|
|
|
http_filters:
|
|
- name: sablier-wasm-whoami-dynamic
|
|
disabled: true
|
|
typed_config:
|
|
"@type": type.googleapis.com/udpa.type.v1.TypedStruct
|
|
type_url: type.googleapis.com/envoy.extensions.filters.http.wasm.v3.Wasm
|
|
value:
|
|
config:
|
|
name: "sablier-wasm-whoami-dynamic"
|
|
root_id: "sablier-wasm-whoami-dynamic"
|
|
configuration:
|
|
"@type": "type.googleapis.com/google.protobuf.StringValue"
|
|
value: |
|
|
{
|
|
"sablier_url": "sablier:10000",
|
|
"cluster": "sablier",
|
|
"names": ["docker_classic_e2e-whoami-1"],
|
|
"session_duration": "1m",
|
|
"dynamic": {
|
|
"display_name": "Dynamic Whoami",
|
|
"theme": "hacker-terminal"
|
|
}
|
|
}
|
|
vm_config:
|
|
runtime: "envoy.wasm.runtime.v8"
|
|
vm_id: "vm.sablier.sablier-wasm-whoami-dynamic"
|
|
code:
|
|
local:
|
|
filename: "/etc/sablierproxywasm.wasm"
|
|
configuration: { }
|
|
- name: sablier-wasm-whoami-blocking
|
|
disabled: true
|
|
typed_config:
|
|
"@type": type.googleapis.com/udpa.type.v1.TypedStruct
|
|
type_url: type.googleapis.com/envoy.extensions.filters.http.wasm.v3.Wasm
|
|
value:
|
|
config:
|
|
name: "sablier-wasm-whoami-blocking"
|
|
root_id: "sablier-wasm-whoami-blocking"
|
|
configuration:
|
|
"@type": "type.googleapis.com/google.protobuf.StringValue"
|
|
value: |
|
|
{
|
|
"sablier_url": "sablier:10000",
|
|
"cluster": "sablier",
|
|
"names": ["docker_classic_e2e-whoami-1"],
|
|
"session_duration": "1m",
|
|
"blocking": {
|
|
"timeout": "30s"
|
|
}
|
|
}
|
|
vm_config:
|
|
runtime: "envoy.wasm.runtime.v8"
|
|
vm_id: "vm.sablier.sablier-wasm-whoami-blocking"
|
|
code:
|
|
local:
|
|
filename: "/etc/sablierproxywasm.wasm"
|
|
configuration: { }
|
|
- name: sablier-wasm-multiple
|
|
disabled: true
|
|
typed_config:
|
|
"@type": type.googleapis.com/udpa.type.v1.TypedStruct
|
|
type_url: type.googleapis.com/envoy.extensions.filters.http.wasm.v3.Wasm
|
|
value:
|
|
config:
|
|
name: "sablier-wasm-multiple"
|
|
root_id: "sablier-wasm-multiple"
|
|
configuration:
|
|
"@type": "type.googleapis.com/google.protobuf.StringValue"
|
|
value: |
|
|
{
|
|
"sablier_url": "sablier:10000",
|
|
"cluster": "sablier",
|
|
"names": ["docker_classic_e2e-whoami-1", "docker_classic_e2e-nginx-1"],
|
|
"session_duration": "1m",
|
|
"dynamic": {
|
|
"display_name": "Multiple Whoami"
|
|
}
|
|
}
|
|
vm_config:
|
|
runtime: "envoy.wasm.runtime.v8"
|
|
vm_id: "vm.sablier.sablier-wasm-multiple"
|
|
code:
|
|
local:
|
|
filename: "/etc/sablierproxywasm.wasm"
|
|
configuration: { }
|
|
- name: sablier-wasm-healthy
|
|
disabled: true
|
|
typed_config:
|
|
"@type": type.googleapis.com/udpa.type.v1.TypedStruct
|
|
type_url: type.googleapis.com/envoy.extensions.filters.http.wasm.v3.Wasm
|
|
value:
|
|
config:
|
|
name: "sablier-wasm-healthy"
|
|
root_id: "sablier-wasm-healthy"
|
|
configuration:
|
|
"@type": "type.googleapis.com/google.protobuf.StringValue"
|
|
value: |
|
|
{
|
|
"sablier_url": "sablier:10000",
|
|
"cluster": "sablier",
|
|
"names": ["docker_classic_e2e-nginx-1"],
|
|
"session_duration": "1m",
|
|
"dynamic": {
|
|
"display_name": "Healthy Nginx"
|
|
}
|
|
}
|
|
vm_config:
|
|
runtime: "envoy.wasm.runtime.v8"
|
|
vm_id: "vm.sablier.sablier-wasm-healthy"
|
|
code:
|
|
local:
|
|
filename: "/etc/sablierproxywasm.wasm"
|
|
configuration: { }
|
|
- name: envoy.filters.http.router
|
|
typed_config:
|
|
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
|
|
|
|
clusters:
|
|
- name: sablier
|
|
connect_timeout: 0.25s
|
|
type: STRICT_DNS
|
|
lb_policy: round_robin
|
|
load_assignment:
|
|
cluster_name: sablier
|
|
endpoints:
|
|
- lb_endpoints:
|
|
- endpoint:
|
|
address:
|
|
socket_address:
|
|
address: sablier
|
|
port_value: 10000
|
|
- name: whoami
|
|
connect_timeout: 0.25s
|
|
type: STRICT_DNS
|
|
lb_policy: round_robin
|
|
load_assignment:
|
|
cluster_name: whoami
|
|
endpoints:
|
|
- lb_endpoints:
|
|
- endpoint:
|
|
address:
|
|
socket_address:
|
|
address: whoami
|
|
port_value: 80
|
|
- name: nginx
|
|
connect_timeout: 0.25s
|
|
type: STRICT_DNS
|
|
lb_policy: round_robin
|
|
load_assignment:
|
|
cluster_name: nginx
|
|
endpoints:
|
|
- lb_endpoints:
|
|
- endpoint:
|
|
address:
|
|
socket_address:
|
|
address: nginx
|
|
port_value: 80
|