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

wasm: Simplify example config and fix docs #16142

Merged
merged 7 commits into from
Apr 30, 2021
Merged
Show file tree
Hide file tree
Changes from 6 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
20 changes: 6 additions & 14 deletions docs/root/configuration/http/http_filters/wasm_filter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,12 @@ Example configuration

Example filter configuration:

.. code-block:: yaml

name: envoy.filters.http.wasm
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.wasm.v3.Wasm
config:
config:
name: "my_plugin"
vm_config:
runtime: "envoy.wasm.runtime.v8"
code:
local:
filename: "/etc/envoy_filter_http_wasm_example.wasm"
allow_precompiled: true
.. literalinclude:: ../../../start/sandboxes/_include/wasm-cc/envoy.yaml
:language: yaml
:lines: 24-49
:emphasize-lines: 4-21
:linenos:

:caption: :download:`wasm envoy.yaml <../../../start/sandboxes/_include/wasm-cc/envoy.yaml>`
phlax marked this conversation as resolved.
Show resolved Hide resolved

The preceding snippet configures a filter from a Wasm binary on local disk.
35 changes: 18 additions & 17 deletions examples/wasm-cc/envoy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,29 @@ static_resources:
prefix: "/"
route:
cluster: web_service

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:
name: "my_plugin"
root_id: "my_root_id"
configuration:
"@type": "type.googleapis.com/google.protobuf.StringValue"
value: |
{}
phlax marked this conversation as resolved.
Show resolved Hide resolved
vm_config:
runtime: "envoy.wasm.runtime.v8"
vm_id: "my_vm_id"
code:
local:
filename: "lib/envoy_filter_http_wasm_example.wasm"
configuration: {}
"@type": type.googleapis.com/envoy.extensions.filters.http.wasm.v3.Wasm
config:
name: "my_plugin"
root_id: "my_root_id"
# if your wasm filter requires custom configuration you can add
# as follows
configuration:
"@type": "type.googleapis.com/google.protobuf.StringValue"
value: |
{}
vm_config:
runtime: "envoy.wasm.runtime.v8"
vm_id: "my_vm_id"
code:
local:
filename: "lib/envoy_filter_http_wasm_example.wasm"
- name: envoy.filters.http.router
typed_config: {}

clusters:
- name: web_service
connect_timeout: 0.25s
Expand Down