如何在GCP Cloud Run中允许TCP流量?

huangapple go评论56阅读模式
英文:

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:

Hope this helps.

huangapple
  • 本文由 发表于 2023年6月22日 02:04:06
  • 转载请务必保留本文链接:https://go.coder-hub.com/76526025.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定