GCP Backend service connection draining options for deployments

6/18/2019

Have anybody ever tried to achieve GC HTTP(S) load balancer backend connection draining by either

  1. Setting the capacity of the respective instance groups inside the backend service to 0% (0 RPS)
  2. Removing the instance group(s) from the backend service
  3. Changing the backend service in the URL map to point to another backend service.

I would like to achieve A/B testing deployment with a GCLB in front of two GKE clusters. The docs only say connection draining is triggered for a specific instance when an instance is removed from the instance group (automatically or manually): https://cloud.google.com/load-balancing/docs/enabling-connection-draining

-- ebensom
google-cloud-http-load-balancer
google-cloud-platform
google-compute-engine
google-kubernetes-engine
load-balancing

1 Answer

6/19/2019

Those are very particular scenarios, however the expected behaviour is the following:

  1. Setting a max rate per instance or max rate (per instance group) to zero (when the balancing mode is rate), won't drain existing connections. Balancing mode simply helps the load balancer rank backends (instance groups in this situation) from most to least attractive to handle new connections. When the balancing mode is rate and the max RPS is zero, that just means that the backend is "not attractive" even when it is servicing zero requests. But if all backends have RPS set to zero, or if they don't but are near capacity, it's possible that a backend with RPS of zero is equally (as unattractive) as all the other backends.
  2. Removing the instance group as a backend from the backend service will most likely not respect any connection draining because that removes the load balancer from the equation.
  3. This scenario is pretty similar to the above statement, without the downside of removing the load balancer. However I think that pointing the URL map to different backend won't trigger connection draining since instances will be reachable, despite you are refering to a different backend. Downtime is expected, but draining shouldn't be activated.
-- Carlos Cuevas
Source: StackOverflow