How to allow TCP traffic in GCP Cloud Run?

328 Views Asked by At

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

There are 1 best solutions below

1
Robert G On BEST ANSWER

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: