Reputation: 24167
I've deployed a container to Cloud Run that is designed to work only if accessed on a specific port. Localhost access works fine if I access the service by http://localhost:8080/myendpoint
After deploying to Cloud Run however it times out https://helloworld-xyzxyzxyz-ew.a.run.app:8080/myendpoint
Is it possible to access services on Cloud Run in this way, with the port specified explicitly in the url?
Upvotes: 0
Views: 1258
Reputation: 81454
The public side of Cloud Run only supports ports 80 and 443.
Usage of ports like 8080 is for your application to listen to requests from the Google Frontend (GFE). That port number can be configured but the public port numbers that the GFE listens on cannot be changed.
Google Cloud Run and many other services use the GFE (Google Frontend) for load balancing, TLS termination, DDoS protection, and more. The GFE determines which ports are exposed to access the underlying services.
Two excellent documents about Cloud Run that help to understand the service:
Cloud Run container runtime contract
Upvotes: 2