go~istio加载wasm的步骤

打印 上一主题 下一主题

主题 854|帖子 854|积分 2564

参考

mse网关及插件的测试

网关转发到上游服务


istio中加载wasm插件


go语言通过tinygo编译wasm文件

TinyGo 是一个 Go 编译器,旨在用于微控制器,WebAssembly(WASM)和命令行工具等小型场景。它重用了 Go 语言工具和 LLVM 一起利用的库,以提供编译用 Go 编程语言编写的步伐的另一种方法。
  1. 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:(下面临插件的有效机制作简要说明:)

  • The user compiles the code into a Wasm file(用户编译代码为wasm文件)
  • The user builds the Wasm file into a Docker image(用户将wasm文件构建为Docker镜像)
  • The user pushes the Docker image to the image registry(用户将Docker镜像推送到镜像堆栈)
  • The user creates the WasmPlugin resource(用户创建WasmPlugin资源)
  • Istio watches changes of the WasmPlugin resource(Istio监听WasmPlugin资源的厘革)
  • The xDS proxy process in Higress Gateway obtains the configuration from Istio and finds the image address of the plugin.(Higress Gateway中的xDS代理进程从Istio获取设置,并找到插件的镜像地址)
  • xDS proxy pulls images from the image registry.(xDS代理从镜像堆栈拉取镜像)
  • xDS proxy extracts the Wasm file from the image.(xDS代理从镜像中提取wasm文件)
  • 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文件的当地路径)
  • 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 编程语言编写的步伐的另一种方法。

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

0 个回复

倒序浏览

快速回复

您需要登录后才可以回帖 登录 or 立即注册

本版积分规则

tsx81428

金牌会员
这个人很懒什么都没写!
快速回复 返回顶部 返回列表