gpt4 book ai didi

Kubernetes:使用 HTTPS 通信内部服务

转载 作者:行者123 更新时间:2023-12-05 06:07:37 27 4
gpt4 key购买 nike

我在 Kubernetes 中部署了 2 个服务

  1. 应用程序 A(asp.net core 5 gRPC 服务)
  2. 应用程序 B(asp.net core 5 api)

应用程序 B 可以通过 ingress-nginx-controller 通过 https 从我的集群外部访问。

应用程序 A 通过服务公开,并且只能在我的集群内访问。

我的问题是如何通过 SSL/TLS 从应用程序 B 连接到应用程序 A?

enter image description here

最佳答案

对于 HTTPS 通信,您可以使用“dotnet dev-certs https”设置证书。每个 pod 都需要在端口 443 上设置自签名证书,用于开发目的,但不推荐。

然而,GRPC 实际上可以与基于 HTTP 的服务一起使用,服务网格支持 http2/grpc 用于服务到服务的通信。这些步骤可以是

  1. 使用 HTTP 调用 GRPC

    https://learn.microsoft.com/en-us/aspnet/core/grpc/troubleshoot?view=aspnetcore-3.0#call-insecure-grpc-services-with-net-core-client-2

  2. 设置Linkerd

    https://techcommunity.microsoft.com/t5/azure-developer-community-blog/meshing-with-linkerd2-using-grpc-enabled-net-core-services/ba-p/1377867

希望对你有帮助

关于Kubernetes:使用 HTTPS 通信内部服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65380982/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com