Soru

Zorluk: OrtaManaging Cloud Run Resources

A cloud engineer needs to update an existing Cloud Run service named `analytics-service` in the `us-central1` region to meet two operational requirements: ensure that unauthenticated invocations are disallowed, and cap the maximum number of container instances at 50 to limit billing exposure. Which of the following commands achieve these requirements? (Select TWO.)

  1. gcloud run services update analytics-service --no-allow-unauthenticated --region=us-central1Cevap
  2. gcloud run services update analytics-service --max-instances=50 --region=us-central1Cevap
  3. C
    gcloud functions deploy analytics-service --max-instances=50 --region=us-central1
  4. D
    gcloud projects add-iam-policy-binding my-project --member="allUsers" --role="roles/owner" --region=us-central1

Cevap

To enforce authentication and set autoscaling limits on an existing Cloud Run service, use 'gcloud run services update analytics-service --no-allow-unauthenticated --region=us-central1' and 'gcloud run services update analytics-service --max-instances=50 --region=us-central1'.
To update an existing Cloud Run service, the 'gcloud run services update' command is used. Disallowing unauthenticated access requires the '--no-allow-unauthenticated' flag, while capping active instances requires setting the '--max-instances' flag.

Adım Adım Çözüm

1
Identify the CLI tool appropriate for managing Cloud Run services.
Use 'gcloud run services update' rather than 'gcloud functions' or project-level IAM commands.
Cloud Run service operational configurations are managed via the 'gcloud run' command family.
2
Determine the flag required to restrict access to authenticated invokers only.
Select the option specifying '--no-allow-unauthenticated'.
This removes 'allUsers' access on the service's IAM policy, enforcing Cloud IAM authentication for incoming requests.
3
Determine the flag required to set maximum container autoscaling limits.
Select the option specifying '--max-instances=50'.
The '--max-instances' flag directly controls the upper bound of active instances provisioned by Cloud Run.

Anahtar Kavram

Cloud Run Resource Management via gcloud CLI
Bu soruyu puanla