Soru

Zorluk: Çok zorManaging Cloud Run Resources

A cloud engineer needs to execute a gradual canary rollout of a new container image for an existing Cloud Run service named `order-processor`. The rollout must first direct 10% of live traffic to the new revision using a revision tag for testing, verify stability, and finally route 100% of traffic to the new revision. Arrange the following deployment and traffic management steps in the correct operational sequence.

  1. 1Deploy the updated container image using `gcloud run deploy order-processor` with `--no-traffic` and `--tag canary-v2` to create an isolated, tagged revision.
  2. 2Execute `gcloud run services update-traffic order-processor --to-tags canary-v2=10` to split production traffic between the main deployment and the canary tag.
  3. 3Analyze latency metrics and HTTP status code distribution in Cloud Logging filtered by the `canary-v2` revision tag.
  4. 4Execute `gcloud run services update-traffic order-processor --to-latest` to route 100% of main production traffic to the new revision.

Cevap

The correct operational sequence is: 1) Deploy the container image with `--no-traffic` and `--tag canary-v2`, 2) Split 10% of production traffic to `canary-v2` using `gcloud run services update-traffic`, 3) Analyze metrics and error rates in Cloud Logging for `canary-v2`, 4) Shift 100% of traffic to the verified revision using `--to-latest`.
The deployment sequence begins by isolating the new revision using `gcloud run deploy` with `--no-traffic` and `--tag canary-v2`. Next, a canary split is established with `gcloud run services update-traffic --to-tags canary-v2=10`. Telemetry and error logs are then monitored in Cloud Logging specifically for the canary revision. Once stability is verified, all live production traffic is promoted to the new revision using `--to-latest`.

Adım Adım Çözüm

1
Deploy container image with traffic suppression and revision tagging
A new Cloud Run revision is created receiving 0% of production traffic, exposed via a dedicated revision tag `canary-v2`.
Deploying with `--no-traffic` prevents unvalidated code from serving main production requests immediately.
2
Configure canary traffic split via gcloud CLI
The Cloud Run service routes 10% of incoming production requests to the revision tagged `canary-v2`.
`gcloud run services update-traffic` with `--to-tags` sets explicit percentage allocations for specific revision tags.
3
Analyze revision telemetry in Cloud Operations
Container instance behavior, HTTP 5xx rates, and request latencies for the canary revision are verified.
Empirical log verification ensures the revision can sustain production load without errors before full promotion.
4
Promote the verified revision to serve 100% of traffic
The service updates its main endpoint to direct 100% of live traffic to the latest fully-validated revision.
Using `--to-latest` completes the canary deployment by promoting the tested revision to full production.

Anahtar Kavram

Cloud Run revision tagging, traffic splitting, and canary release workflows
Bu soruyu puanla