78 Star 210 Fork 649

openEuler/docs

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
isulad.md 1.45 KB
一键复制 编辑 原始数据 按行查看 历史
chopupu 提交于 2个月前 . update faq

isulad使用grpc与rest直接调用服务方法

isulad使用grpc直接调用服务方法

isula与isulad之间的通信默认使用grpc,且k8s场景CRI接口调用只能使用grpc。

若用户想在第三方组件中直接通过gRPC连接向iSulad请求服务,可参照https://gitee.com/openeuler/iSulad/tree/master/src/api/services不同功能模块目录下的proto文件获取gRPC请求格式。

调试grpc调用可使用grpcurl工具,grpcurl 是 Go 语言开源社区开发的工具,需要手工安装:

$ go get github.com/fullstorydev/grpcurl
$ go install github.com/fullstorydev/grpcurl/cmd/grpcurl

调试grpc调用时可参照以下命令:

grpcurl -plaintext -H 'tls_mode:0' -proto=api.proto -import-path=../ -unix=true /var/run/isulad.sock runtime.v1alpha2.ImageService.ListImages

isulad使用rest直接调用服务方法

若isula与isulad之间想要使用更轻量级的rest进行通信,需要在iSulad 仓库获取iSulad源码进行源码编译,源码编译的教程可参照:https://gitee.com/openeuler/iSulad/blob/master/docs/build_docs/README_zh.md

在源码编译时使用如下编译选项可更换isula与isulad的交互方式为rest:

cmake -DENABLE_GRPC=OFF …/

调试rest调用可直接使用curl工具,调试的具体方式可参照以下命令:

curl -d "{}" --unix-socket /var/run/isulad.sock http://localhost/ContainerService/Version
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/openeuler/docs.git
git@gitee.com:openeuler/docs.git
openeuler
docs
docs
common

搜索帮助