如何将 Dapr 与 Kong Api 网关集成
我想使用 Kong 作为 api 网关,以允许外部应用程序与集群交互 Dapr 与我的应用程序通信。我找不到任何例子。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
我想使用 Kong 作为 api 网关,以允许外部应用程序与集群交互 Dapr 与我的应用程序通信。我找不到任何例子。
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(1)
因此,没有简单的方法可以直接执行此操作。这里有一篇博客文章介绍了如何使用 ingress 设置它 https://carlos.mendible.com/2020/04/05/kubernetes-nginx-ingress-controller-with-dapr/
其要点是,您将入口控制器 Pod 设置为 Dapr 服务,并将调用重写/重定向到 dapr sidecar。注意命名空间(博客对此进行了阐述,并将入口安装在默认命名空间中,这不是常见的做法)并完全限定服务名称..
最后,我建议您对下游服务的调用进行重写。使用正则表达式获取段并将该段附加到服务调用 URL 的末尾:HTTP://localhost:3500/v1.0/invoke/YOURSERVICE.ITSNAMESPACE/method/$2(其中 $2 是从入口中的原始路径
注意:我在让这些类型的调用通过我下游的 HTTP 管道组件时遇到问题,但如果您不需要这些,那么它是一个不错的选择
So, there is no easy way to do this directly. There is a blog post that walks through setting it up with ingress here https://carlos.mendible.com/2020/04/05/kubernetes-nginx-ingress-controller-with-dapr/
The gist of it is that you will set up your ingress controller pods as Dapr services and rewrite/redirect the calls to the dapr sidecar. Be aware of namespaces (the blog glazes over this and installs the ingress in the default namespace which is not common practice) and fully qualify the service name ..
Finally, I recommend you apply a rewrite to the invocation of the downstream service. use a regex to get the segments and append the segment at the end of the service invocation URL: HTTP://localhost:3500/v1.0/invoke/YOURSERVICE.ITSNAMESPACE/method/$2 (where $2 is the segment captured from the original path in the ingress
NOTE: I am having issues getting these types of calls to go through the HTTP pipeline components I have downstream, but if you don't need those, then its a great option