2

We have multiple instances in auto-managed instance group. Executing below code results in:

  1. New instances are being created and validated with health check (without removing old instances yet). Everything still works fine at this stage.
  2. New instances turn green. Everything still works fine at this stage.
  3. Old instances are being removed. At this stage, website is down with "Connection error". It stays down for 10-20s and then comes back up with updated version.

I tried adding min-ready but I don't think it affects anything. I think that new instances are not being picked up by load balancer in time?

We use TCP load balancer. How can we avoid downtime?

gcloud beta --project "PROJECT_ID" compute instance-groups managed rolling-action replace "INSTANCE_GROUP --region=europe-west2 --max-unavailable=0 --max-surge=3 --min-ready=75s

2 Answers 2

1

From the docs, the --max-unavailable value will be equal to the number of zones minimum for a regional managed group.

Moreover, it seems that the option --min-ready is not available anymore in GA, but there is no information about it !

As for now, in order to be sure to have enough running instances, you should try to write a script that will start a few VMs in your managed group just before the rolling update, and then stop them after the rolling update is finished.

1

I would like to add on top of user morellet.d's answer and say that you can use the flag "--min-ready", however, this flag is only available on the "beta" version of the gcloud command "cloud beta compute instance-groups managed rolling-action replace"

But overall, morellet.d's solution/answer of writing a script that will start VMs in your managed group just before the rolling update, and then stop them after the rolling update is finished is a great idea, and using the flag "--min-ready" will help you provide a minimum time for which a newly created instance should be ready to be considered available to use.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .