Question

Difficulty: HardManaging Cloud Run Resources

A Cloud Engineer notices elevated 5xx error rates following a recent deployment to a production Cloud Run service. To restore stability, the engineer must immediately route all live traffic back to the previous stable revision, reconfigure operational instance limits to handle expected traffic spikes, and clean up the broken revision. Arrange the operational steps in the correct logical sequence to execute this remediation workflow.

  1. 1List the existing service revisions using `gcloud run revisions list --service=[SERVICE_NAME]` to identify the exact revision ID of the previous stable deployment.
  2. 2Execute `gcloud run services update-traffic [SERVICE_NAME] --to-revisions=[STABLE_REVISION]=100` to immediately route all incoming production traffic away from the faulty revision.
  3. 3Execute `gcloud run services update [SERVICE_NAME] --min-instances=2 --max-instances=50` to adjust scaling bounds on the active configuration.
  4. 4Execute `gcloud run revisions delete [FAULTY_REVISION]` after verifying that the degraded revision is receiving 0% of traffic.

Answer

The correct operational sequence is: 1) List revisions to identify the stable revision ID, 2) Shift 100% of production traffic to the stable revision using `gcloud run services update-traffic`, 3) Update service instance scaling limits using `gcloud run services update`, and 4) Delete the faulty revision using `gcloud run revisions delete`.
Remediating a failing release requires identifying the target revision first, shifting 100% of live traffic to that healthy revision to resolve user-facing errors, modifying operational parameters (min/max instances) on the service configuration, and finally purging the inactive faulty revision.

Step-by-Step Solution

1
Inspect current service revisions
Obtained the precise revision names for both the degraded deployment and the prior stable revision.
Traffic management commands require accurate revision identifiers.
2
Re-route production traffic to the stable revision
Live traffic is immediately redirected away from the failing container revision.
Restoring end-user availability is the immediate priority during a production outage.
3
Reconfigure service autoscaling constraints
Minimum and maximum instance limits are applied to the active service deployment.
Updating service settings ensures cold starts are mitigated while protecting against runaway container creation.
4
Decommission the degraded revision
The faulty revision is safely removed from Google Cloud.
Revisions receiving zero traffic can be safely deleted to maintain clean operational state.

Key Concept

Cloud Run Traffic Management and Revision Lifecycle Operations
Rate this question