Create a GCS bucket
Create an instance template
Create an instance group
Configure autoscaling for the instance group
Autoscaling an Instance Group with Custom Cloud Monitoring Metrics
- Deploy an autoscaling Compute Engine instance group.
- Create a custom metric used to scale the instance group.
- Use the Cloud Console to visualize the custom metric and instance group size.
The Node.js script is used to seed a custom metric with values that the instance group can respond to. In a production environment, you would base autoscaling on a metric that is relevant to your use case.
The application includes the following components:
- Compute Engine instance template - A template used to create each instance in the instance group.
- Cloud Storage - A bucket used to host the startup script and other script files.
- Compute Engine startup script - A startup script that installs the necessary code components on each instance. The startup script is installed and started automatically when an instance starts. When the startup script runs, it in turn installs and starts code on the instance that writes values to the Cloud monitoring custom metric.
- Compute Engine instance group - An instance group that autoscales based on the Cloud monitoring metric values.
- Compute Engine instances - A variable number of Compute Engine instances.
- Custom Cloud Monitoring metric - A custom monitoring metric used as the input value for Compute Engine instance group autoscaling.
Join Qwiklabs to read the rest of this lab...and more!
- Get temporary access to the Google Cloud Console.
- Over 200 labs from beginner to advanced levels.
- Bite-sized so you can learn at your own pace.