I am using google cloud load balancer to Auto scale instances in GCP. I have setup a Instance group of max 6 instances. When a instance is created, it runs a startup script (To install nginx, php, mongo, psql, composer, clone project).

Google Cloud load balancer forwards request to new instances firing up before the completion of automation script.

Is there a way to forward the request only after the Startup script has completed ?


The workaround I can think of in this situation is the cool down period. According to this document,

The cool down period is the number of seconds the autoscaler should wait after a virtual machine has started before the autoscaler starts collecting information from it.

Editing instance group for Cool-down period

However, it will be required to find out what value to put in this field which will give enough time for the new instances to fire up completely.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.