OpsCanary
Back to daily brief
gcpcloud runPractitioner

Mastering Cloud Run Rollouts and Traffic Management

5 min read Google Cloud DocsApr 23, 2026
PractitionerHands-on experience recommended

Cloud Run provides a powerful mechanism for managing application updates without downtime. This is crucial in production environments where user experience must remain uninterrupted. By utilizing traffic splitting, you can control which revisions receive traffic and how much, allowing for gradual rollouts or instant rollbacks when necessary.

When you adjust traffic for revisions, keep in mind that changes aren't instantaneous. Ongoing requests will complete, potentially directing traffic to either the new or previous revision during the transition. This ensures that users experience minimal disruption. You can specify traffic percentages using parameters like PERCENTAGE in your deployment commands, allowing for fine-tuned control over your service's behavior.

In practice, you'll want to leverage IAM roles to manage permissions effectively. This ensures that only authorized users can make changes to your Cloud Run services and revisions. Be cautious with session affinity, as it can impact how traffic is distributed between revisions. Always test your traffic configurations in a staging environment before deploying to production to avoid unexpected behavior.

Key takeaways

  • Utilize traffic splitting to control which revisions receive traffic and at what percentage.
  • Manage session affinity to influence traffic distribution during rollouts.
  • Ensure you have the necessary IAM roles to manage Cloud Run services effectively.
  • Be aware that traffic routing adjustments are not instantaneous; ongoing requests will complete before changes take effect.
  • Test traffic configurations in a staging environment to prevent disruptions in production.

Why it matters

Effective traffic management in Cloud Run can significantly reduce downtime during deployments, enhancing user experience and maintaining service reliability.

Code examples

gcloud
gcloudrunservicesupdate-trafficSERVICE--to-revisionsREVISION=100
YAML
apiVersion:serving.knative.dev/v1kind:Servicemetadata:name:SERVICEspec:...traffic:-revisionName:REVISIONpercent:100
Terraform
resource"google_cloud_run_v2_service""default"{name="my-service"location="us-central1"deletion_protection=false# set to true to prevent destruction of the resourcetemplate{}traffic{percent=100# This revision needs to already existrevision="green"type="TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION"}}

When NOT to use this

The official docs don't call out specific anti-patterns here. Use your judgment based on your scale and requirements.

Want the complete reference?

Read official docs

Test what you just learned

Quiz questions written from this article

Take the quiz →

Get the daily digest

One email. 5 articles. Every morning.

No spam. Unsubscribe anytime.