A DevOps engineer manages a production Cloud Run service named `billing-service` deployed in the `us-central1` region. To test a performance optimization patch in production with minimal risk, the engineer deployed a new revision named `billing-service-00002-patch` using the `--no-traffic` flag. Currently, of production traffic continues to be routed to the baseline revision `billing-service-00001-base`. The engineer must now configure the service to route of incoming traffic to `billing-service-00002-patch` while leaving the remaining on `billing-service-00001-base`.
Which `gcloud` command should the engineer execute to implement this precise traffic split?
- gcloud run services update-traffic billing-service --region us-central1 --to-revisions billing-service-00002-patch=15,billing-service-00001-base=85Cevap
- Bgcloud run deploy billing-service --region us-central1 --image gcr.io/my-project/billing-service:latest --update-traffic
- Cgcloud functions deploy billing-service --region us-central1 --traffic-split billing-service-00002-patch=15
- Dgcloud run services update billing-service --region us-central1 --set-env-vars TRAFFIC_SPLIT=15
Cevap
The command `gcloud run services update-traffic billing-service --region us-central1 --to-revisions billing-service-00002-patch=15,billing-service-00001-base=85` correctly adjusts the traffic allocation between existing Cloud Run revisions.
The correct command utilizes `gcloud run services update-traffic` with the `--to-revisions` flag to explicitly allocate of traffic to `billing-service-00002-patch` and to `billing-service-00001-base`. This adheres directly to GCP Cloud Run traffic management specifications.
Adım Adım Çözüm
Anahtar Kavram
Cloud Run Revision Traffic Splitting
Tahmini Süre:2m 0s