go~istio加载wasm的步骤
  2xk0JyO908yA 2024年04月07日 32 0
Go

参考

mse网关及插件的测试

网关转发到上游服务

test

istio中加载wasm插件

istio-wasm

go语言通过tinygo编译wasm文件

TinyGo 是一个 Go 编译器,旨在用于微控制器,WebAssembly(WASM)和命令行工具等小型场景。它重用了 Go 语言工具和 LLVM 一起使用的库,以提供编译用 Go 编程语言编写的程序的另一种方法。

tinygo build -o main.wasm -scheduler=none -target=wasi -gc=custom -tags='custommalloc nottinygc_finalizer' ./main.go

本地测试wasm具体步骤

Here is a brief explanation of the effective mechanism of the plugin:(下面对插件的有效机制作简要说明:)

  1. The user compiles the code into a Wasm file(用户编译代码为wasm文件)
  2. The user builds the Wasm file into a Docker image(用户将wasm文件构建为Docker镜像)
  3. The user pushes the Docker image to the image registry(用户将Docker镜像推送到镜像仓库)
  4. The user creates the WasmPlugin resource(用户创建WasmPlugin资源)
  5. Istio watches changes of the WasmPlugin resource(Istio监听WasmPlugin资源的变化)
  6. The xDS proxy process in Higress Gateway obtains the configuration from Istio and finds the image address of the plugin.(Higress Gateway中的xDS代理进程从Istio获取配置,并找到插件的镜像地址)
  7. xDS proxy pulls images from the image registry.(xDS代理从镜像仓库拉取镜像)
  8. xDS proxy extracts the Wasm file from the image.(xDS代理从镜像中提取wasm文件)
  9. The envoy process in the Higress Gateway obtains the configuration from the xDS proxy and discovers the local path of the Wasm file.(Higress Gateway中的envoy进程从xDS代理获取配置,并发现wasm文件的本地路径)
  10. Envoy loads the Wasm file from the local file.(Envoy从本地文件加载wasm文件)

Here, Envoy uses the Extension Config Discovery Service (ECDS) mechanism to obtain the configuration and load the Wasm file, which realizes the update of the Wasm file and direct hot loading without causing any connection interruption, and the business traffic is completely lossless.(这里Envoy使用Extension Config Discovery Service(ECDS)机制获取配置并加载wasm文件,实现了wasm文件的更新和直接热加载,不会造成任何连接中断,业务流量完全无损。)

xDS代理是一种用于管理服务发现和负载均衡的代理程序。在微服务架构中,服务之间需要相互通信,而xDS代理则可以帮助实现这种通信。xDS代理通过与服务注册中心进行交互,获取当前可用的服务实例信息,并根据负载均衡策略将请求分发到合适的服务实例上。同时,xDS代理还能够监控服务实例的健康状态,及时更新服务列表,确保服务的高可用性和稳定性。常见的xDS代理有Envoy、Nginx等。

TinyGo 是一个 Go 编译器,旨在用于微控制器,WebAssembly(WASM)和命令行工具等小型场景。它重用了 Go 语言工具和 LLVM 一起使用的库,以提供编译用 Go 编程语言编写的程序的另一种方法。

【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2024年04月07日 0

暂无评论

推荐阅读
  hyrB1Ag4eVs8   26天前   34   0   0 Go
  2xk0JyO908yA   2024年04月07日   32   0   0 Go
  YFCZjJLTjJgW   7天前   15   0   0 Go
  2xk0JyO908yA   2024年04月06日   39   0   0 Go
  MQD0xJmbEOnQ   2024年04月08日   39   0   0 Go
2xk0JyO908yA