我有一个侦听 GRPC 端点的 C# 服务,我已将其部署到 google cloud run 服务。我从日志中看到我的服务正在运行。但是,我无法通过邮递员或客户端应用程序从桌面访问 GRPC 端点。 (编辑:我还将添加 GRPC 客户端在本地或在 Docker 容器中运行时可以与我的服务通信)。
我可以 ping 通 google cloud run 实例。不过 Telenet 似乎失败了
matt_raffel@cloudshell:~ (bold-result-421221)$ ping ironbar-bootnode-6iwlqscuzq-uc.a.run.app
PING ironbar-bootnode-6iwlqscuzq-uc.a.run.app (216.239.34.53) 56(84) bytes of data.
64 bytes from 216.239.34.53 (216.239.34.53): icmp_seq=1 ttl=114 time=0.706 ms
64 bytes from 216.239.34.53 (216.239.34.53): icmp_seq=2 ttl=114 time=0.342 ms
64 bytes from 216.239.34.53 (216.239.34.53): icmp_seq=3 ttl=114 time=0.453 ms
^C
--- ironbar-bootnode-6iwlqscuzq-uc.a.run.app ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 0.342/0.500/0.706/0.152 ms
matt_raffel@cloudshell:~ (bold-result-421221)$ telnet ironbar-bootnode-6iwlqscuzq-uc.a.run.app 50051
Trying 216.239.34.53...
Trying 216.239.36.53...
Trying 216.239.32.53...
Trying 216.239.38.53...
Trying 2001:4860:4802:36::35...
Trying 2001:4860:4802:32::35...
Trying 2001:4860:4802:34::35...
Trying 2001:4860:4802:38::35...
telnet: Unable to connect to remote host: Cannot assign requested address
我查看了其他几篇文章:这里,这里。根据这篇文章,here,入站连接应该已经被允许。
我相信 GRPC 端口在 google cloud run 中配置正确。以下是我认为是实例yaml中的相关信息。
ports:
- name: h2c
containerPort: 50051
如果有帮助,可以在here找到项目代码。
出了什么问题?我怎样才能更好地诊断出了什么问题?
复制上面 DazWilkin 评论的答案,因为这回答了我的问题并让我能够继续推进该项目的工作:
Cloud Run 代理您的容器服务并将其公开在端口 443 上。因此您将使用类似 https://{app}-123456789a-rr.a.run.app:443 的内容。您的 gRPC 客户端可能不需要方案 (https://) 前缀。