Your company is using HTTPS requests to trigger a public Cloud Run-hosted service accessible at the https://booking-engine-abcdef.a.run.app URL. You need to give developers the ability to test the latest revisions of the service before the service is exposed to customers. What should you do?
A. Run the gcloud run deploy booking-engine –no-traffic –tag dev command. Use the https://dev–booking-engine-abcdef.a.run.app URL for testing.
B. Run the gcloud run services update-traffic booking-engine –to-revisions LATEST=1 command. Use the https://booking-engine-abcdef.a.run.app URL for testing.
C. Pass the curl –H “Authorization:Bearer $(gcloud auth print-identity-token)” auth token. Use the https://booking-engine-abcdef.a.run.app URL to test privately.
D. Grant the roles/run.invoker role to the developers testing the booking-engine service. Use the https://booking-engine-abcdef.private.run.app URL for testing.
Disclaimer
This is a practice question. There is no guarantee of coming this question in the certification exam.
Answer
A
Explanation
A. Run the gcloud run deploy booking-engine –no-traffic –tag dev command. Use the https://dev–booking-engine-abcdef.a.run.app URL for testing.
(To enable developers to test the latest revisions of a Cloud Run-hosted service before exposing it to customers, the recommended approach is to use the –no-traffic flag during deployment, as outlined in Option A.
By running the command gcloud run deploy booking-engine –no-traffic –tag dev, you deploy the service with no traffic routed to it initially. Subsequently, developers can test the latest revisions using the URL https://dev–booking-engine-abcdef.a.run.app. This allows for a controlled and private testing environment where developers can validate the service’s functionality and behavior before making it publicly accessible. Utilizing a dedicated URL with the –tag option ensures that developers can interact with the specific version intended for testing, facilitating a smooth and secure testing process.)
B. Run the gcloud run services update-traffic booking-engine –to-revisions LATEST=1 command. Use the https://booking-engine-abcdef.a.run.app URL for testing.
(100% of traffic will be route to the latest revision.)
C. Pass the curl –H “Authorization:Bearer $(gcloud auth print-identity-token)” auth token. Use the https://booking-engine-abcdef.a.run.app URL to test privately.
(Not helpful.)
D. Grant the roles/run.invoker role to the developers testing the booking-engine service. Use the https://booking-engine-abcdef.private.run.app URL for testing.
(Not helpful.)