A site reliability engineer needs to optimize a latency-sensitive microservice running on Cloud Run named `telemetry-service` in the `europe-west1` region. To prevent cold starts during peak traffic hours, the service must maintain at least 5 warm container instances at all times, while restricting the upper autoscaling limit to 50 instances to maintain budget boundaries. Which `gcloud` command should be executed to apply these scaling configurations?
- Execute `gcloud run services update telemetry-service --region=europe-west1 --min-instances=5 --max-instances=50`.Answer
- BExecute `gcloud functions deploy telemetry-service --region=europe-west1 --min-instances=5 --max-instances=50`.
- CExecute `gcloud run services update-traffic telemetry-service --region=europe-west1 --to-revisions=MIN=5,MAX=50`.
- DGrant the service account running the workload the primitive `roles/editor` role at the project level to enable instance capacity management.
Answer
The command `gcloud run services update telemetry-service --region=europe-west1 --min-instances=5 --max-instances=50` properly configures autoscaling limits for Cloud Run.
Executing `gcloud run services update telemetry-service --region=europe-west1 --min-instances=5 --max-instances=50` correctly updates the active configuration of the existing Cloud Run service. Specifying `--min-instances=5` keeps 5 instances ready to process incoming requests without cold start latency, while `--max-instances=50` ensures that Cloud Run will not scale beyond 50 concurrent instances.
Step-by-Step Solution
Key Concept
Cloud Run Autoscaling and Instance Management