我在从节点/集群外部连接到在 kubernetes 中运行的 gRPC 应用程序时遇到问题。在集群内部,连接正常工作,在集群外部,我收到以下错误:
注意:集群内外的服务使用相同的 gRPC 客户端进行连接。
在服务器端:
ssl_transport_security.cc:1824] No match found for server name: <myDomain.com>
在客户端:
raise _InactiveRpcError(state)
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.UNAVAILABLE
details = "failed to connect to all addresses"
debug_error_string = "{"created":"@1627334018.361000000","description":"Failed to pick subchannel","file":"src/core/ext/filters/client_channel/client_channel.cc","file_line":5420,"referenced_errors":[{"created":"@1627334018.361000000","description":"failed to connect to all addresses","file":"src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc","file_line":398,"grpc_status":14}]}"
>
Kubernetes 设置如下:
0.0.0.0:50051
,服务节点端口配置如下:
<块引用>
节点端口:30001 端口:50051 目标端口:50051
如果我理解正确,这应该将任何流量路由到节点上的 30001,到 Pod 上的 50051。
问题: