We have multiple instances in auto-managed instance group. Executing below code results in:
- New instances are being created and validated with health check (without removing old instances yet). Everything still works fine at this stage.
- New instances turn green. Everything still works fine at this stage.
- 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