See Google Cloud Fundamentals Part 1
Custom Machine Type
Instance Group
Group of VM instances managed as a single entity.
There are 2 types of Instance groups. 1)Managed 2) Unmanaged
Managed Instance Group (MIG)
Let's create managed instance group:
Under the Compute Engine, go to Instance Group
You may find managed and unmanaged groups there.
Managed (Stateful) is for database type of things. For web applications and APIs we use Managed (Stateless).
Let's create a Stateless Managed Instance:
- First give it a name
- Choose an instance template
- Choose Multiple Zone
- On the Auto Scaling. Choose minimum : 2 and maximum: 2
- In Autoscaling metrics, you can see "CPU Utilisation","HTTP Load balancing utilisation", "Cloud monitoring metric". Choose CPU utilisation and keep the default value.
- Don't need to on Predictive autoscaling( checks last weeks data etc to scale)
- You can select cooldown period where you will choose how long you want to wait before checking the metrics.
- You can enable scale in counts. For example: you have 100 instacnces and you want to reduce each time 10 instacnes.You can choose Don't scale by more than : 10 and 10min which will reduce 10instancecs per 10 min.
- In Auto healing , go to create a health check . Give it a name and change the protocol to "HTTP" . Under Health Criteria, check interval can be 5seconds to check instances after every 5seconds. If you choose 5 seconds for Timeout and the instance does not get any response for 5 seconds, it will be considered as timeout. Healthy threshold means how many consecutive success is needed to mark it as healthy.
- Initial delay (how much your instance need to boot up)
- Press Create
Load Balancing
- Go to Network services and choose load balancing.
- Select HTTP(S) Load balancing.
Give the load balancer a name.
The Backend Configuration is where we want to redirect the incoming traffics. Here we are going to use Managed Instance Group as Backend Configuration. From there create a Backend service.
Use Cloud CDN, if you want to cache static contents like HTML, CSS.
Add health Check and then create .
Host and path rules has rules how one ones to redirect traffic to the back end. Keep host and path empty and instance group as selected to send traffic to the instance group.
Frontend Configuration is where you would receive the traffic.
and done. Go to review finalize and Create.
The load balancer is ready.
Top comments (0)