Cloud Run Traffic Splitting and Tagged Revisions for Testing

PCDOE By islever Editorial Last updated

Managing multiple environments (e.g., staging, production). Implementing and managing pipelines.

Short answer

C Deploy the new version with a tag without serving traffic, test it, then gradually roll out the tagged version.

Question

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?
  1. 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.
  2. 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.
  3. 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
  4. 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.

Key Takeaways

The exam tests your ability to distinguish between traffic-splitting (canary) and tag-based isolation; the trap is choosing split-traffic options that expose users to untested code or green-blue strategies that are overkill for simple version testing.

This question tests the correct use of Cloud Run tagged revisions to isolate testing from live traffic, ensuring minimal user impact during extensive staging validation.

Common mistake: Candidates often choose Option D (Green/Blue deployment) because it seems to offer 'zero impact,' but creating entirely new environments is inefficient and unnecessary when Cloud Run supports tagging existing services for isolated testing.

Expert Analysis

Why the Answer Is Correct

Option C is the correct answer because it leverages Cloud Run's tagging feature to deploy a new revision without serving any traffic initially. This allows developers to run extensive integration and functional tests in the staging environment without affecting end-users or other applications consuming the service. Once validated, the tag can be gradually promoted to production, aligning with best practices for risk mitigation.

Why the Other Options Are Wrong

Options A and B involve splitting traffic (canary deployments), which exposes a percentage of real users to the new version before testing is complete, violating the requirement to minimize user impact during extensive testing. Option D suggests deploying a separate environment (Green/Blue pattern), which adds significant operational overhead and complexity compared to simply using tags on the same service instance.

Community Comment Notes

Several community members like activist noted that D offers instant rollback, but as ricardovazz pointed out, "A common use case for this feature is to use it for testing... serving no traffic," confirming C is the standard approach. User filipemotta correctly identified that this method avoids negative impact while allowing thorough testing.

Official Reference

https://cloud.google.com/run/docs/rollouts-rollbacks-traffic-migration#deploy-with-tags

This link opens the official vendor documentation in a new tab.

Exam Strategy

When asked about testing new versions with zero user impact, look for options that deploy to a non-production environment or use tags to serve NO traffic. Avoid traffic-splitting options unless the question explicitly asks for a gradual rollout to users.

Frequently Asked Questions

Why not use traffic splitting for testing?

Traffic splitting sends real user requests to the new version. If you need to test extensively without impacting users, you must isolate the new version completely using tags.

Is Green/Blue better than Tags?

Green/Blue involves managing two separate environments/services. Cloud Run Tags allow you to test different versions within the same service, which is more efficient for staged rollouts.

More PCDOE FAQ →

Discussion 20 contributions

Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.

From public community threads 20

  1. activist 👍 7
    Answers A and B split traffic, but C has a gradual rollout which doesn't have instant rollback. D with the blue/green deployment has instant rollback with no impact to either users or developers. I believe the answer is D.
  2. filipemotta 👍 5 Answered C
    This approach allows you to deploy and test the new version without impacting users, as no traffic is directed to the new version initially. After thorough testing in the staging environment, you can confidently roll out the new version to a small percentage of users in the production environment, gradually increasing it while monitoring performance and stability. This method offers a controlled and safe way to introduce changes.
  3. khoukha 👍 4 Answered C
    Deploy it without serving a traffic. this approach is the optimal since we need to test it intensively. this will avoid the negative impact
  4. nhiguchi 👍 4 Answered A
    I think A. need a canary to reduce the sphere of influence.
  5. alpha_canary 👍 3 Answered C
    https://cloud.google.com/run/docs/rollouts-rollbacks-traffic-migration#:~:text=A%20common%20use,the%20tagged%20revision.
Show 15 more comments
  1. ABZ10 👍 3 Answered D
    D should be it
  2. ricardovazz 👍 2 Answered C
    https://cloud.google.com/run/docs/rollouts-rollbacks-traffic-migration#deploy-with-tags A common use case for this feature is to use it for testing and vetting of a new service revision before it serves any traffic, in this typical sequence: 1Run integration tests on a container during development. 2Deploy the container to a Google Cloud project that you use only for staging, serving no traffic, and test against a tagged revision. 3Deploy it to production, without serving traffic, and test against a tagged revision in production. 4Migrate traffic to the tagged revision. The tag lets you directly test the new revision at a specific URL, without serving traffic.
  3. xhilmi 👍 2 Answered A
    Choose A. This approach allows for thorough testing while minimizing the risk of impacting users and developers. It provides a controlled rollout with the ability to monitor and react to any issues that may arise during the deployment process. Option A aligns with best practices for deploying and testing new versions in a microservices environment.
  4. Feliphus 👍 2
    But, after reading this link, https://cloud.google.com/run/docs/rollouts-rollbacks-traffic-migration, I could choose C perfectly. I don't know between C or D, you don't have to use the word "green" for the tag
  5. lelele2023 👍 2
    shouldn't be D since the question said that "you need to test the new version extensively in the staging and production environments.", D is a new environment. I will go with A
  6. Andrei_Z 👍 2
    I would go for D as it is the only one that will not impact users or devs
  7. BleHi 👍 1 Answered A
    A. Deploying the new version to the staging environment and allowing only 1% of traffic to the latest version minimizes user and developer impact, as the majority of traffic continues to be served by the current version. Testing the latest version in the staging environment ensures that any issues can be identified and addressed before rolling out the new version to production. not C cause: Deploying the new version with a new-release tag without serving traffic in the staging environment delays the testing process and does not provide an accurate representation of how the new version performs under real-world conditions with actual traffic.
  8. Feliphus 👍 1
    Answer C says "gradually", then it can not be the correct if we have to minimize user and developer impact. Answer D is the only who says "send all the traffic", I understand this is the key in this question if you wnat to minimize user and developer impact. Answer A & B establish different ratios -> gradually
  9. BlackCoffee 👍 1 Answered C
    The correct answer is 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.
  10. activist 👍 1
    Rethinking answer is C for using release tag. "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. "
  11. ManishKS 👍 1
    A, B, and C involve splitting traffic, which may not provide the level of isolation required for extensive testing without impacting users and developers Correct Answer is D
  12. 288e9f1 👍 1 Answered C
    I will go with C
  13. 6a8c7ad 👍 1 Answered D
    D. No impact
  14. cloudgenius 👍 1
    Why not D?
  15. xhilmi 👍 1 Answered A
    Choose A

Reader comments & corrections

No reader corrections yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

Practice All PCDOE Questions

Access 75 questions with complete answers and detailed explanations.

View Full PCDOE Practice Test →

← Back to PCDOE Study Guide