From d79f2a098060b1a2d9ba4a1174721a8e025b10e1 Mon Sep 17 00:00:00 2001 From: Ryan Northey Date: Fri, 23 Apr 2021 13:18:05 +0100 Subject: [PATCH 1/7] wasm: Simplify example config Signed-off-by: Ryan Northey --- examples/wasm-cc/envoy.yaml | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/examples/wasm-cc/envoy.yaml b/examples/wasm-cc/envoy.yaml index a6697ae1c8dd..d91b1047d18d 100644 --- a/examples/wasm-cc/envoy.yaml +++ b/examples/wasm-cc/envoy.yaml @@ -25,23 +25,21 @@ static_resources: 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: | - {} - 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" + 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" + configuration: {} - name: envoy.filters.http.router typed_config: {} clusters: From 7ddf6afa3619f45a11fb141ed87804df2a667a2c Mon Sep 17 00:00:00 2001 From: Ryan Northey Date: Wed, 28 Apr 2021 10:42:49 +0100 Subject: [PATCH 2/7] docs/ Signed-off-by: Ryan Northey --- .../http/http_filters/wasm_filter.rst | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/docs/root/configuration/http/http_filters/wasm_filter.rst b/docs/root/configuration/http/http_filters/wasm_filter.rst index ac3b6d2eb132..325f986eb514 100644 --- a/docs/root/configuration/http/http_filters/wasm_filter.rst +++ b/docs/root/configuration/http/http_filters/wasm_filter.rst @@ -21,20 +21,8 @@ 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 The preceding snippet configures a filter from a Wasm binary on local disk. From 03e6fe55a853f67da5a83df50f4723d7b0a0db6d Mon Sep 17 00:00:00 2001 From: Ryan Northey Date: Thu, 29 Apr 2021 10:42:28 +0100 Subject: [PATCH 3/7] wasm Signed-off-by: Ryan Northey --- docs/root/configuration/http/http_filters/wasm_filter.rst | 4 +++- examples/wasm-cc/envoy.yaml | 7 ++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/docs/root/configuration/http/http_filters/wasm_filter.rst b/docs/root/configuration/http/http_filters/wasm_filter.rst index 325f986eb514..0411ee7a84da 100644 --- a/docs/root/configuration/http/http_filters/wasm_filter.rst +++ b/docs/root/configuration/http/http_filters/wasm_filter.rst @@ -23,6 +23,8 @@ Example filter configuration: .. literalinclude:: ../../../start/sandboxes/_include/wasm-cc/envoy.yaml :language: yaml - + :lines: 24-43 + :emphasize-lines: 3-11 + :caption: :download:`wasm envoy.yaml <../../../start/sandboxes/_include/wasm-cc/envoy.yaml>` The preceding snippet configures a filter from a Wasm binary on local disk. diff --git a/examples/wasm-cc/envoy.yaml b/examples/wasm-cc/envoy.yaml index d91b1047d18d..3aa9e5c2adcf 100644 --- a/examples/wasm-cc/envoy.yaml +++ b/examples/wasm-cc/envoy.yaml @@ -22,6 +22,7 @@ static_resources: prefix: "/" route: cluster: web_service + http_filters: - name: envoy.filters.http.wasm typed_config: @@ -29,19 +30,15 @@ static_resources: config: name: "my_plugin" root_id: "my_root_id" - 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" - configuration: {} - name: envoy.filters.http.router typed_config: {} + clusters: - name: web_service connect_timeout: 0.25s From 02d21531057395e3e3af2b8f6fbf0b951fa1b9b7 Mon Sep 17 00:00:00 2001 From: Ryan Northey Date: Thu, 29 Apr 2021 10:55:59 +0100 Subject: [PATCH 4/7] docs/ Signed-off-by: Ryan Northey --- docs/root/configuration/http/http_filters/wasm_filter.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/root/configuration/http/http_filters/wasm_filter.rst b/docs/root/configuration/http/http_filters/wasm_filter.rst index 0411ee7a84da..410f1f65eb54 100644 --- a/docs/root/configuration/http/http_filters/wasm_filter.rst +++ b/docs/root/configuration/http/http_filters/wasm_filter.rst @@ -24,7 +24,7 @@ Example filter configuration: .. literalinclude:: ../../../start/sandboxes/_include/wasm-cc/envoy.yaml :language: yaml :lines: 24-43 - :emphasize-lines: 3-11 + :emphasize-lines: 4-15 :caption: :download:`wasm envoy.yaml <../../../start/sandboxes/_include/wasm-cc/envoy.yaml>` The preceding snippet configures a filter from a Wasm binary on local disk. From e5714ed9b1e8f82c972e5055bd2e0495f937a2f3 Mon Sep 17 00:00:00 2001 From: Ryan Northey Date: Fri, 30 Apr 2021 10:29:25 +0100 Subject: [PATCH 5/7] linenos Signed-off-by: Ryan Northey --- docs/root/configuration/http/http_filters/wasm_filter.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/root/configuration/http/http_filters/wasm_filter.rst b/docs/root/configuration/http/http_filters/wasm_filter.rst index 410f1f65eb54..0513aee6ffdc 100644 --- a/docs/root/configuration/http/http_filters/wasm_filter.rst +++ b/docs/root/configuration/http/http_filters/wasm_filter.rst @@ -25,6 +25,7 @@ Example filter configuration: :language: yaml :lines: 24-43 :emphasize-lines: 4-15 + :linenos: :caption: :download:`wasm envoy.yaml <../../../start/sandboxes/_include/wasm-cc/envoy.yaml>` The preceding snippet configures a filter from a Wasm binary on local disk. From 7b90c228be639320f7643923c1ee0a98c8662e57 Mon Sep 17 00:00:00 2001 From: Ryan Northey Date: Fri, 30 Apr 2021 10:50:01 +0100 Subject: [PATCH 6/7] add back config and add comment Signed-off-by: Ryan Northey --- docs/root/configuration/http/http_filters/wasm_filter.rst | 7 ++++--- examples/wasm-cc/envoy.yaml | 6 ++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/docs/root/configuration/http/http_filters/wasm_filter.rst b/docs/root/configuration/http/http_filters/wasm_filter.rst index 0513aee6ffdc..335c908871ec 100644 --- a/docs/root/configuration/http/http_filters/wasm_filter.rst +++ b/docs/root/configuration/http/http_filters/wasm_filter.rst @@ -23,9 +23,10 @@ Example filter configuration: .. literalinclude:: ../../../start/sandboxes/_include/wasm-cc/envoy.yaml :language: yaml - :lines: 24-43 - :emphasize-lines: 4-15 + :lines: 24-49 + :emphasize-lines: 4-21 :linenos: - :caption: :download:`wasm envoy.yaml <../../../start/sandboxes/_include/wasm-cc/envoy.yaml>` + + :caption: :download:`wasm envoy.yaml <../../../start/sandboxes/_include/wasm-cc/envoy.yaml>` The preceding snippet configures a filter from a Wasm binary on local disk. diff --git a/examples/wasm-cc/envoy.yaml b/examples/wasm-cc/envoy.yaml index 3aa9e5c2adcf..1d04c7a26f62 100644 --- a/examples/wasm-cc/envoy.yaml +++ b/examples/wasm-cc/envoy.yaml @@ -30,6 +30,12 @@ static_resources: 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" From 9ef2bf912441cb3477bcb103ef6f7e3747fa874b Mon Sep 17 00:00:00 2001 From: Ryan Northey Date: Fri, 30 Apr 2021 11:00:44 +0100 Subject: [PATCH 7/7] oops Signed-off-by: Ryan Northey --- docs/root/configuration/http/http_filters/wasm_filter.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/root/configuration/http/http_filters/wasm_filter.rst b/docs/root/configuration/http/http_filters/wasm_filter.rst index 335c908871ec..8b10dbaf7acd 100644 --- a/docs/root/configuration/http/http_filters/wasm_filter.rst +++ b/docs/root/configuration/http/http_filters/wasm_filter.rst @@ -26,7 +26,6 @@ Example filter configuration: :lines: 24-49 :emphasize-lines: 4-21 :linenos: - - :caption: :download:`wasm envoy.yaml <../../../start/sandboxes/_include/wasm-cc/envoy.yaml>` + :caption: :download:`wasm envoy.yaml <../../../start/sandboxes/_include/wasm-cc/envoy.yaml>` The preceding snippet configures a filter from a Wasm binary on local disk.