Search code examples
google-cloud-platformgoogle-cloud-load-balancer

load balancing for unmanaged instance group


I have one primary vm in an unmanaged instance group. To perform updates and maintenance, I'll add an updated VM to the group and then proceed to remove the existing one to update. I was thinking it shouldn't be any downtime by doing so. However, whenever I make a change to the backend, the server will be unavailable for 30 seconds. How can I avoid this downtime? Is it due to the healthcheck configuration?

This is my healthcheck setup


Solution

  • Enable instance draining. This allows for existing connections to complete and begins the process of sending new traffic to the other instance.

    Now you can remove a VM from the instance group without downtime. Wait for the instance draining time plus 60 seconds before modifying the instance.

    Enabling connection draining