0
votes

Is it possible to mirror the traffic of one Cloud Run revision onto another?

We have a running Cloud Run service (one revision with 100% traffic), and we want to evaluate a change of in our algorithm, without actually deploying it to production. It would be ideal, if we can just deploy a second revision (with 0% traffic, but with a revision URL) and mirror all incoming requests onto this URL.

I've seen, that you can mirror traffic using an Internal HTTP(S) Load Balancer (https://cloud.google.com/load-balancing/docs/l7-internal/setting-up-traffic-management#multiple_allowed_in_a_url_map ). However, as far as I understand, I can't use an Internal HTTP(S) Load Balancer for Cloud Run, but only for VMs (Compute Engine).

For the serverless NEGs, it's possible to create External HTTP(S) Load Balancer, but those don't support this feature.

Am I understand it correctly, that it's not possible to mirror the traffic of Cloud Run with load balancers? Are there any other solutions? Or do we need need to deploy our own load balancer (e.g. Nginx), and define our mirroring strategy there?

1
Your question asks the question Is it possible which usually means yes as in almost everything is possible given enough time, resources and money. Your question asks for opinions and/or recommendations. Rewrite your question into an on-topic question that states a problem, what you have tried, and objectives/errors. Cloud Run does not provide mirroring. HTTP(S) Load Balancers do not provide mirroring. That leaves you with the option to implement your own solution.John Hanley

1 Answers

2
votes

AFAIK, you can't mirror the request. you need, as you said, to deploy a proxy that split the traffic.

You can use another CLoud Run in front of your target service and then duplicate the request to the service tags. Nginx is an option, you can deploy it on Cloud Run for example.