Question

Difficulty: MediumManaging Compute Engine Resources

An Associate Cloud Engineer needs to perform a controlled canary rollout of a new application revision across an existing Managed Instance Group (MIG) named `frontend-mig`. The deployment strategy requires testing the updated software on a fraction of the instances before fully updating the entire group. In what order should the engineer execute the following `gcloud` operations to complete this canary deployment safely?

  1. 1Create a new Compute Engine instance template (`frontend-template-v2`) containing the updated application image and configuration.
  2. 2Run `gcloud compute instance-groups managed rolling-action start-update frontend-mig` with `--canary-version` pointing to `frontend-template-v2` and a `--target-size` specifying a small percentage of instances.
  3. 3Monitor application performance and instance health using `gcloud compute instance-groups managed list-instances frontend-mig` to verify canary stability.
  4. 4Execute `gcloud compute instance-groups managed rolling-action start-update frontend-mig` specifying `frontend-template-v2` as the primary `--version` to rollout to 100% of the instances.

Answer

The correct sequence of operations is: 1) Create the new instance template (`frontend-template-v2`), 2) Initiate the canary update by specifying `--canary-version` with a restricted target size, 3) Verify canary instance health using `list-instances`, and 4) Promote `frontend-template-v2` to the primary version for full deployment across all instances in the group.
The proper administrative workflow for a canary update on Compute Engine Managed Instance Groups requires creating the new instance template first. Next, the engineer initiates a rolling update using canary flags to deploy the template to a minor subset of instances. After verifying instance state and application health, the engineer promotes the new template to cover 100% of the MIG.

Step-by-Step Solution

1
Define the target configuration.
A new instance template (`frontend-template-v2`) is created in Google Cloud.
Managed Instance Groups deploy VMs based on instance templates; any software or OS update requires a new template object.
2
Start canary update on MIG.
A subset of instances in `frontend-mig` are replaced with VMs running `frontend-template-v2`.
Using `rolling-action start-update` with `--canary-version` limits risk by updating only a specified portion of the fleet.
3
Validate canary instance health.
Instance status and autohealing health checks confirm the canary instances are running correctly.
Canary testing requires operational verification before scaling the change to production capacity.
4
Complete rolling update across the entire group.
All instances in `frontend-mig` are updated to `frontend-template-v2`.
Setting the new template as the primary version completes the deployment process.

Key Concept

Managed Instance Group Rolling Updates and Canary Deployments
Rate this question