Google Associate Cloud Engineer Question 219
Select 2Google Cloud PlatformYou are managing a Cloud Run service and need to deploy a new version of your application with zero downtime. Which of the following steps should you take to ensure a smooth transition to the new version?
- A
Use the 'gcloud run deploy' command with a new image tag.
- B
Set the traffic to 100% for the new revision immediately after deployment.
- C
Deploy the new version to a new service and gradually shift traffic using the Console UI.
- D
Use the traffic management feature to gradually shift traffic from the old revision to the new one.
- E
Disable the old service immediately after deploying the new version.
Show answer and explanation
Correct answers: A, D
Explanation
To deploy a new version of a Cloud Run application with zero downtime, it's best to use the 'gcloud run deploy' command to create a new revision and leverage the traffic management feature to gradually shift traffic from the old revision to the new one. This approach minimizes the risk of service disruption and allows you to monitor the new version's performance before fully committing.
- A. Correct.
Using the 'gcloud run deploy' command with a new image tag allows you to deploy a new revision of your service.
- B. Incorrect.
Setting the traffic to 100% immediately after deployment can lead to potential downtime if there are issues with the new version. It's recommended to gradually shift traffic.
- C. Incorrect.
Deploying to a new service and using the Console UI to shift traffic is not the standard method for Cloud Run version deployments. Traffic management within the same service is preferred.
- D. Correct.
Using the traffic management feature allows you to gradually shift traffic between revisions, reducing the risk of downtime.
- E. Incorrect.
Disabling the old service immediately is not recommended as you should ensure the new version is stable before fully shifting traffic.