go~istio加载wasm的步骤
参考
- https://github.com/higress-group/proxy-wasm-go-sdk/tree/main/proxywasm
- https://github.com/tetratelabs/proxy-wasm-go-sdk
- https://github.com/alibaba/higress/blob/main/plugins/wasm-go/pkg/wrapper
- https://tinygo.org/docs/reference/
- https://tinygo.org/docs/reference/lang-support/stdlib/
mse网关及插件的测试
网关转发到上游服务
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:(下面对插件的有效机制作简要说明:)
- 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 编程语言编写的程序的另一种方法。
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 【.NET】调用本地 Deepseek 模型
· CSnakes vs Python.NET:高效嵌入与灵活互通的跨语言方案对比
· DeepSeek “源神”启动!「GitHub 热点速览」
· 我与微信审核的“相爱相杀”看个人小程序副业
· Plotly.NET 一个为 .NET 打造的强大开源交互式图表库
2022-04-07 javascript~引用js的module
2020-04-07 k8s~helm3更方便的部署
2020-04-07 k8s~helm的安装过程
2020-04-07 k8s~helm的介绍
2017-04-07 docker~linux下的部署和基本命令
2016-04-07 微信JSApi支付~订单号和微信交易号