Soru

Zorluk: OrtaManaging Cloud Run Resources

A Cloud Engineer needs to execute a safe canary rollout of a updated container image for an existing Cloud Run service named `order-processor`. Arrange the operational steps in the correct order from first to last to complete the canary deployment and traffic transition without risking immediate full-production downtime.

  1. 1Deploy the new revision using `gcloud run deploy order-processor --image LOCATION-docker.pkg.dev/PROJECT_ID/REPO/IMAGE:TAG --no-traffic --tag canary`.
  2. 2Send test HTTP requests to the tag-specific URL `https://canary---order-processor-REGION.a.run.app` to validate revision functionality.
  3. 3Execute `gcloud run services update-traffic order-processor --to-tags canary=10` to route 10% of live traffic to the canary revision.
  4. 4Execute `gcloud run services update-traffic order-processor --to-latest` to route 100% of live traffic to the new revision after health metrics remain stable.

Cevap

The correct sequence for a Cloud Run canary rollout is: 1) Deploy the new image using `--no-traffic` and assign a revision tag. 2) Direct verification requests to the tag-specific URL. 3) Route a small percentage of live traffic to the tagged revision. 4) Shift 100% of live production traffic to the latest revision.
A safe canary deployment in Cloud Run follows a distinct lifecycle: first creating the new revision isolated with `--no-traffic` and a dedicated tag, testing the tag-specific URL directly, initiating a partial live traffic split using `gcloud run services update-traffic --to-tags`, and finally updating the service traffic to 100% (`--to-latest`) once stability is verified.

Adım Adım Çözüm

1
Deploy revision with traffic suppression and a revision tag
A new revision is instantiated without receiving traffic from the primary service URL.
The `--no-traffic` flag prevents automatic 100% traffic assignment to new deployments.
2
Validate revision via tag-specific endpoint URL
Functionality is verified on `https://canary---order-processor-REGION.a.run.app`.
Revision tags provide isolated subdomains for pre-release validation.
3
Apply canary traffic split using CLI
10% of incoming live traffic is routed to the `canary` tag, while 90% remains on the previous stable revision.
`gcloud run services update-traffic --to-tags` manages granular percentage traffic allocation.
4
Promote latest revision to receive full traffic load
100% of production traffic is routed to the new revision.
Using `--to-latest` completes the canary deployment once stability is confirmed under live load.

Anahtar Kavram

Cloud Run Revision Tagging and Traffic Splitting Sequence
Bu soruyu puanla