These examples should work with Istio 1.8, 1.9, and future 1.10 (current master). These examples are contributed as a companion to my IstioCon talk, Extending Envoy with WASM from start to finish.
All of these examples can be tested without any 3rd party tools or cloud-specific Kubernetes storage. Users might get better performance using another technique or using the Wasm Remote Fetch experimental feature launched with Istio 1.9. The ConfigMap approach is used here because it is the simplest.
These filters for have been tested with the C++, AssemblyScript, and Go WebAssembly for Proxies SDKs.
I am preparing to contribute these with an Apache license to one of the existing examples repos in the istio-ecosystem org.
To prepare the WebAssembly for Proxies C++ SDK:
git clone git@github.com:proxy-wasm/proxy-wasm-cpp-sdk.git
cd proxy-wasm-cpp-sdk
# The next line takes 30+ minutes on MacBook (64 GB, 2.3 GHz 8-Core Intel Core i9)
docker build -t wasmsdk:v2 -f Dockerfile-sdk .
The regexp replacer example shows how to redirect the HTTP path of incoming requests to a server.
The sequence number example shows how to used “shared data” to coordinate multiple instances of a filter.
The HTTP call example shows how to make outgoing HTTP calls, and modify the body of responses based on the results of that call. .