2
votes

This is my first time using GCP, and I'm trying to put my project on production, and I'm running into problems with getting websocket communication working. I've been googling around and I'm super unclear on if cloud run on GKE supports inbound/outbound websocket connections. The limitations docs say that cloud run fully managed does not work with inbound websockets, but does not say anything about cloud run on gke having issues with websockets.

I can post my ingress config and stuff, not really sure what exactly is relevant to this, but I've just followed their getting setup guide so everything is still set to the default for the most part.

2

2 Answers

3
votes

The short answer is no. However, WebSockets do work outbound. This is a known issue on Cloud Run. You can use either just GKE or App Engine Flex as recommended alternatives.

2
votes

The short answer, as of January 2021, is yes! You will need to use the beta api when deploying your service. Details are here: https://cloud.google.com/blog/products/serverless/cloud-run-gets-websockets-http-2-and-grpc-bidirectional-streams