PROFESSIONAL-CLOUD-DEVOPS-ENGINEER practice question 19 of 25

[Building and implementing CI/CD pipelines for a service] You are building and deploying a microservice on Cloud Run for your organization Your service is used by many applications internally You are deploying a new release, and you need to test the new version extensively in the staging and production environments You must minimize user and developer impact. What should you do?

Full set: 205 questions
Answer options
A: Deploy the new version of the service to the staging environment Split the traffic, and allow 1 % of traffic through to the latest version Test the latest version If the test passes gradually roll out the latest version to the staging and production environments
B: Deploy the new version of the service to the staging environment Split the traffic, and allow 50% of traffic through to the latest version Test the latest version If the test passes, send all traffic to the latest version Repeat for the production environment
C: Deploy the new version of the service to the staging environment with a new-release tag without serving traffic Test the new-release version If the test passes; gradually roll out this tagged version Repeat for the production environment Correct answer
D: Deploy a new environment with the green tag to use as the staging environment Deploy the new version of the service to the green environment and test the new version If the tests pass, send all traffic to the green environment and delete the existing staging environment Repeat for the production environment
Correct Answer:
C. Deploy the new version of the service to the staging environment with a new-release tag without serving traffic Test the new-release version If the test passes; gradually roll out this tagged version Repeat for the production environment
Explanation

This approach provides the highest level of safety and control. Deploying the new version as a new revision with a specific tag (e.g., new-release) allows it to be tested in isolation via its unique tag-based URL without affecting any production traffic. Once the staging tests pass, this exact, validated revision can be gradually rolled out to production by slowly shifting traffic. This method ensures the new version is thoroughly vetted before any end-users are exposed, minimizing impact as required.

Why Incorrect

A. This option exposes 1% of traffic to the new version immediately, before any isolated testing can occur, which introduces unnecessary risk.
B. Splitting traffic 50/50 is a high-risk strategy that exposes a large user base to a potentially unstable version, violating the "minimize user impact" requirement.
D. Creating and destroying entire environments for a single service update is overly complex and inefficient. Cloud Run's native revision and traffic-splitting features are designed for this purpose.

References

1. Google Cloud Documentation, "Testing and rolling out new revisions". It states, "By default, when you deploy a new revision, it replaces the previous revision and starts serving all traffic... You can change this behavior by deploying a new revision without diverting traffic to it." It also describes using tags: "Tags provide a stable URL for a specific revision."

2. Google Cloud Documentation, "Rollbacks, gradual rollouts, and traffic migration". This page details the process: "You can gradually roll out a new revision... You can also use this feature to split traffic between two revisions." This confirms that deploying a revision, testing it, and then gradually migrating traffic is the recommended pattern.

Scroll to Top