Deploying geographically distributed services on Kubernetes Engine
cloudplatform.googleblog.com
cloudplatform.googleblog.com
* GKE clusters currently can be only in 1 region (say, us-central1)
* But you can create multiple clusters around the world, and deploy the same app on them
* Google Cloud provides global anycast IPs for load balancers
* Anycast IPs are routed to the closest PoP/datacenter available to the visitor of your application
* Then, the traffic is routed to the closest GKE cluster (without leaving Google's private worldwide network)
* This way, you serve to the user from the nearest cluster
* If a region goes offline (disaster scenario) or is under high load, the load balancer will start sending traffic to other nearby clusters
I deployed the sample demo app provided at with this at http://35.190.71.87/ (probably won't work in a month or so). Depending on where you're visiting, you'll be routed to the closest datacenter the app is deployed in.
The demo app source code is here: https://github.com/GoogleCloudPlatform/k8s-multicluster-ingr... You can try it out yourself if you have a GCP account.
Disclaimer: I work on GKE at Google.
:mindblown:
Sometimes I forget just how big Google really is
We have to run proxies over the public Internet to work around poor latency between Singapore and Iowa, for instance.
(I work for GCP, would love to know more. My contact details are in my profile if you want to go into details)
As far as we know this is a known issue (?) that someone is doing something about.
There’s a thread on the insiders list about some other customers with similar issues.
With this information, the load balancer knows about the RPS (queries per second), CPU utilization, and number of connections established to each backend. In Kubernetes/GKE case, each "node pool" of a cluster is an "instance group" and GKE Ingress controller configures the LB with instance groups and health checks.
I believe the load balancing strategy (QPS, CPU, connections etc) is currently not configurable through Kubernetes since Ingress API does not have a good way of exposing cloud-specific configuration details, yet.
Health checks are good, but they tell you there's a problem seconds after you have already triggered it. :-) Better to have some concept of nominal capacity. Yeah, the Ingress API is not advanced at all and most people end up using controller-specific, non-portable annotations. I thought perhaps that was the case here. Hopefully there will be an improved API soon.
A common scenario is to setup Pod autoscaler and cluster autoscaler to scale clusters or add more clusters in the same region rather than route requests to a different region.
Disclaimer: I work on kubemci.
One cluster is deployed on one instance group.
So you can set max cpu utilization or RPS for a region.
Requests flow to different region when you breach the defined threshold for the defined metric