英文:
How to allow TCP traffic in GCP Cloud Run?
问题
我已经构建了一个用于处理SSH流量的Go二进制文件,并部署到了Cloud Run。
看起来Cloud Run只允许HTTP流量,而我尝试通过ssh -p 80 ***.run.app
连接失败。
如何允许SSH流量通过?我假设我需要以某种方式允许TCP连接?
提前感谢。
英文:
I've built a Go binary for handling SSH traffic. And deployed it to Cloud Run.
Looks like cloud run allows only HTTP traffic, and my attempts to connect via ssh -p 80 ***.run.app
fails.
How to allow SSH traffic to be passed through? I assume I need to allow TPC connections some how?
Thanks in advance.
答案1
得分: 0
你不能通过SSH连接到Cloud Run,因为它是无服务器的。根据这份文档上的说明使用HTTPS请求调用,Cloud Run只能接收HTTP请求。
正如@guillaume blaquiere所提到的,容器是不可变的,实例是短暂的,因为Cloud Run是无服务器的容器化微服务。一旦实例被删除或销毁,您将无法访问它,因为Cloud Run会创建一个新的实例。
强烈建议查看@John Hanley的文档,以及以下关于Cloud Run工作原理的参考资料:
希望这对您有所帮助。
英文:
You can't SSH to Cloud Run as it being serverless. Cloud Run can only receive HTTP requests based on this documentation on invoking with an HTTPS Request.
As mentioned by @guillaume blaquiere, container is immutable and instance is ephemeral as Cloud Run being a serverless containerized microservices. Once the instance has been deleted or destroyed, you won't be able to access it as Cloud Run would just create a new one.
It is highly recommended to check out @John Hanley's documentation, as well as the following for your references regarding how Cloud Run works:
- Lifecycle of a container on Cloud Run
- Cloud Run: What no one tells you about Serverless (and how it's done)
- What is Cloud Run
Hope this helps.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论