Skip to content

Commit 267fc6c

Browse files
authored
Updates Envoy / Showcase as an upstream filter (#20)
Thanks to the work by @vikaschoudhary16 in envoyproxy/envoy#38686 Signed-off-by: Takeshi Yoneda <[email protected]>
1 parent 0b8a644 commit 267fc6c

File tree

6 files changed

+23
-6
lines changed

6 files changed

+23
-6
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ RUN cp /build/target/aarch64-unknown-linux-gnu/debug/librust_module.so /build/ar
2828
RUN cp /build/target/x86_64-unknown-linux-gnu/debug/librust_module.so /build/amd64_librust_module.so
2929

3030
# Finally, copy the built library to the final image.
31-
FROM envoyproxy/envoy-dev:240e45a54779df6f515d9cb065868b499a6fa70e AS envoy
31+
FROM envoyproxy/envoy-dev:59a14b1dcb532b23a5566173009e06d02892c1a9 AS envoy
3232
ARG TARGETARCH
3333
ENV ENVOY_DYNAMIC_MODULES_SEARCH_PATH=/usr/local/lib
3434
COPY --from=rust_builder /build/${TARGETARCH}_librust_module.so /usr/local/lib/librust_module.so

ENVOY_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
240e45a54779df6f515d9cb065868b499a6fa70e
1+
59a14b1dcb532b23a5566173009e06d02892c1a9

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Dynamic Modules Examples
22

3-
> Envoy Version: [240e45a54779df6f515d9cb065868b499a6fa70e]
3+
> Envoy Version: [59a14b1dcb532b23a5566173009e06d02892c1a9]
44
55
This repository hosts examples of dynamic modules for [Envoy] to extend its functionality.
66
The high level documentation is available [here][High Level Doc]. In short, a dynamic module is a shared library
@@ -79,6 +79,6 @@ NEW_VERSION=4a113b5118003682833ba612202eb68628861ac6 # Whatever the commit in en
7979
grep -rlF "${CURRENT_VERSION}" . | xargs sed -i "s/${CURRENT_VERSION}/${NEW_VERSION}/g"
8080
```
8181

82-
[240e45a54779df6f515d9cb065868b499a6fa70e]: https://github.com/envoyproxy/envoy/tree/240e45a54779df6f515d9cb065868b499a6fa70e
82+
[59a14b1dcb532b23a5566173009e06d02892c1a9]: https://github.com/envoyproxy/envoy/tree/59a14b1dcb532b23a5566173009e06d02892c1a9
8383
[Envoy]: https://github.com/envoyproxy/envoy
8484
[High Level Doc]: https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/advanced/dynamic_modules

integration/envoy.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,23 @@ static_resources:
131131

132132
clusters:
133133
- name: httpbin
134+
# This demonstrates how to use the dynamic module HTTP filter as an upstream filter.
135+
typed_extension_protocol_options:
136+
envoy.extensions.upstreams.http.v3.HttpProtocolOptions:
137+
"@type": type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions
138+
explicit_http_config:
139+
http_protocol_options: {}
140+
http_filters:
141+
- name: dynamic_modules/passthrough/upstream
142+
typed_config:
143+
# https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/dynamic_modules/v3/dynamic_modules.proto#envoy-v3-api-msg-extensions-dynamic-modules-v3-dynamicmoduleconfig
144+
"@type": type.googleapis.com/envoy.extensions.filters.http.dynamic_modules.v3.DynamicModuleFilter
145+
dynamic_module_config:
146+
name: rust_module
147+
filter_name: passthrough
148+
- name: envoy.filters.http.upstream_codec
149+
typed_config:
150+
"@type": type.googleapis.com/envoy.extensions.filters.http.upstream_codec.v3.UpstreamCodec
134151
connect_timeout: 5000s
135152
type: strict_dns
136153
lb_policy: round_robin

rust/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ repository = "https://github.com/envoyproxy/dynamic-modules-example"
88

99
[dependencies]
1010
# The SDK version must match the Envoy version due to the strict compatibility requirements.
11-
envoy-proxy-dynamic-modules-rust-sdk = { git = "https://github.com/envoyproxy/envoy", rev = "240e45a54779df6f515d9cb065868b499a6fa70e" }
11+
envoy-proxy-dynamic-modules-rust-sdk = { git = "https://github.com/envoyproxy/envoy", rev = "59a14b1dcb532b23a5566173009e06d02892c1a9" }
1212
serde = { version = "1.0", features = ["derive"] }
1313
serde_json = "1.0"
1414
rand = "0.9.0"

0 commit comments

Comments
 (0)