go~istio加载wasm的步骤

这篇具有很好参考价值的文章主要介绍了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 编程语言编写的程序的另一种方法。文章来源地址https://www.toymoban.com/news/detail-844161.html

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 编程语言编写的程序的另一种方法。

到了这里,关于go~istio加载wasm的步骤的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • 【解决问题 fatal: unable to access ‘https://github.com/.../.git‘: Could not resolve host: github.com】

    1.发现vulhub靶场不全,重新下载发现下这个问题,记录一下。 2.出现以下报错,如下图 fatal: unable to access ‘https://github.com/…/.git’: Could not resolve host: github.com 3.只需要在命令行中执行 git config --global --unset http.proxy git config --global --unset https.proxy 4.既可解决以上问题。

    2024年02月05日
    浏览(49)
  • fatal: 无法访问 https://github.com/ :Failed to connect to github.com port 443: 拒绝连接的解决办法

    最近在ubuntu20.04安装PCL1.9.1的过程中,在从github 下载pcl时遇到了 fatal: 无法访问 https://github.com/PointCloudLibrary/pcl.git/ :Failed to connect to github.com port 443: 拒绝连接 这个问题。 解决办法:在终端输入 sudo gedit /etc/hosts ,打开/etc/hosts文件,然后注释掉所有只涉及到github.com的行(注意是

    2024年02月12日
    浏览(50)
  • clone报错fatal: unable to access ‘https://github.com/...‘: Failed to connect to github.com port

    原因是本机代理端口和git端口不一致。 第一步、找到本机代理端口号(红框部分) 第二步、修改git端口号 在git-bash执行如下两条指令 问题解决! [1][报错解决] Failed to connect to github.com port 443 after ***** ms: Couldn‘t connect to server [2]GitHub 新手详细教程

    2024年02月06日
    浏览(53)
  • 【已解决】fatal: Authentication failed for ‘https://github.com/.../‘

    在 Linux 服务器上使用 git push 命令,输入用户名和密码之后,总会显示一个报错: 起初我认为可能是密码输错了,但重新试过很多次后依然不行 到网上查阅,才知道原来是 github 的问题… 长话短说:大概就是 github 现在不让使用 用户名+密码 的方式进行验证 ,解决起来也不难

    2024年01月18日
    浏览(42)
  • lkx语言的总体设计已经发布到github上 (https://github.com/lichuan/lkx)

    Lkx is a new strongly typed scripting language, simpler and faster than lua. It can easily interact with c/c++ , the name Lkx comes from my daughter’s name ( Li Kaixin ), so this language is also a gift for my daughter. simple and clear variable typed hot reloading garbage collection user defined structure shared function shared variable faster than Lua c-

    2024年02月10日
    浏览(35)
  • github.com/json-iterator/go 详细教程

    最近接触到了 github.com/json-iterator/go , 是由滴滴开源的第三方json编码库,它同时提供Go和Java两个版本。 文中大量内容来自 github 上的 wiki 文档,有兴趣的朋友可以直接点击 Home 跳转到官方文档查阅。 本文加了些自己的思考以及相关的详细学习例子,废话不多说了,冲!!!

    2024年02月11日
    浏览(31)
  • Git clone报错:fatal: unable to access ‘https://github.com/.....‘: Failed to connect to github.com port

    使用Git克隆项目是,有时候会报错:Failed to connect to github.com port 443 after 21096 ms: Couldn’t connect to server 原因是本机代理端口和git端口不一致。 我的解决方法: 然后开启手动代理模式: 随便在哪个地方,右键选择Git Bash Here(得安装了Git),然后在弹出的命令行窗口中分别输入一

    2024年04月13日
    浏览(66)
  • fatal: unable to access ‘https://github.com/.../.git‘: Could not resolve host: github.com解决方法【亲测有效】

    今天在使用Github的时候突然出现了这样的报错,云里雾里,看了网上的解决办法,说是代理服务器的问题,尝试了无数遍无果 然后Ping了一下github网站,发现Ping不通: 这里考虑应该是hosts文件解析的问题☘️ 在hosts文件中加入如下三行: 140.82.112.3 是github网站服务器的真实I

    2024年02月12日
    浏览(44)
  • fatal: unable to access ‘https://github.com/xxx/123.git/‘: Failed connect to github.com:443 解决方案

    在linux上git clone时遇到 fatal: unable to access \\\'https://github.com/xx/xx.git/\\\': Failed connect to github.com:443; Connection timed out时如图 解决方法:把https:改成git 如果没有成功,遇上以下报错 配置用户名,邮箱 给该邮箱设置公钥 回车三次后 得到如图  设置成功后进入~/.ssh,    复制公钥(ssh-r

    2024年02月05日
    浏览(52)
  • 解决git fatal: Authentication failed for ‘https://github.com

    git clone 遇到的错误 remote: Support for password authentication was removed on August 13, 2021. remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication. fatal: Authentication failed for ‘https://github.com/Drif

    2024年02月03日
    浏览(44)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包