0

I'm looking to find a solution to mitigate the impact of a regional / zonal outage for Cloud Functions like happened today (7.02.19).

My thought immediately went to a Load Balancer backend setup where there's a backend configuration that lets me hot-swap zones or regions.

My specific use-case doesn't really allow me to quickly swap out http://us-east1-project-id.cloudfunctions.net/my-function for http://us-east4-project-id.cloudfunctions.net/my-function-2

I feel like an LB in this situation is potentially a bad idea, but some place to point services at and then allows me to swap backends (manually or automatically) would be nice.

I've looked at a solution using NGINX to do this, though I feel like there's a way to do it.

Additionally, I've read a bit about Endpoints on GCP... though making this work isn't necessarily straight forward as it appears I also need to use some bits of Google App Engine.

1 Answer 1

0

Given these functions encode region and project into the host name, I don't think DNS CNAMEs help here. You could run a proxy that rewrites requests to the appropriate region and function.

However, where are you going to host this that is as reliable and scalable as the functions service in a region? Given the goal of surviving regional outages, in theory you could run this in some other datacenter, but that costs a latency penalty.

My specific use-case doesn't really allow me to quickly swap out http://us-east1-project-id.cloudfunctions.net/my-function for http://us-east4-project-id.cloudfunctions.net/my-function-2

Reconsider how the function URL is constructed. Making region project and function into variables makes a cut over procedure possible. I doubt writing a larger app to wrap the function is less work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.