0

I am looking to add autoscaling to my Google Compute Engine via the instructions I have found here: https://cloud.google.com/compute/docs/autoscaler

My original Compute Engine instance has a static ip and I have the domain (example: domain.com) which points to this static ip (via Google Domains). So when my users visit my domain.com site, they are pointed to the static ip original Compute Engine instance. This works perfectly for now. However, with autoscaling, I believe new instances may spin up with different ephemeral ips other than my original Compute Engine static ip. Is this correct?

Therefore, my worry/confusion is that when there is enough traffic to spin up multiple servers coming into my domain.com address (which points to my static IP original Compute Engine instance), I am not sure how this traffic would then distributed to the additional instances that spin up since users are accessing my site through the domain (pointing at the static ip) and not the new ips for the instances that spin up.

My question is: how do I get my current instance and all the new ones that spin up to open/function through my domain.com address? Is this automatic? Or do I need to do something in either Google Domains, the Managed Instance Group, or elsewhere?

Chrono
  • 3
  • 1
  • https://cloud.google.com/load-balancing – Michael Hampton Oct 22 '20 at 16:36
  • Okay, so it sounds like I have to set up the load balancer to get the static IP I need for the domain. Then, the load balancer will distribute the traffic to the servers under the Managed Instance Group (MIG) when my domain points to my load balancer static ip. But I am not able to do the MIG without the load balancer static IP. Does this sound correct? – Chrono Oct 22 '20 at 20:40

1 Answers1

0

You may follow the below steps: -Create a snapshot of your existing VM. -Create a custom image using the snapshot. -Create a MIG template using the custom image -Create a MIG -Configure a LB to get a static ip and the LB will distribute the traffic to the servers under the Managed Instance Group (MIG) when your domain points to your load balancer static ip.

Your understanding of the last comment is correct.