Cloud Run Revisions and Traffic Routing

30 minutes
  • 3 Learning Objectives

About this Hands-on Lab

In this lab, we’ll explore the traffic management options of Cloud Run. We’ll deploy an application, then roll out a breaking change and perform a rollback. Then, we’ll deploy a fix, with traffic splitting between our versions, before finally routing all traffic to the latest version. You should be familiar with the GCP console and Cloud Shell to perform this hands-on lab.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Deploy the Application
  1. Use either the gcloud SDK or the GCP web console to create the Cloud Run service.
  2. Use the container image with the blue tag from your project’s container registry to launch the blue version of the demo application.
Roll Back a Breaking Change
  1. Create a new revision of the service in Cloud Run by changing to the purple tag of the container image.
  2. Roll back to the previous version by routing 100% of traffic to the old revision.

Note: You can achieve the above with either the gcloud SDK or the GCP web console.

Perform a Gradual Rollout
  1. Create a new revision of the service with the green tag of the container image, but deploy it without routing traffic.
  2. Adjust the traffic splitting: Direct 50% of traffic to the new green version and 50% to the previous blue version.

Additional Resources

Log in to Google Cloud Platform by right-clicking Open Google Console and selecting the option to open it in a new private browser window. Then, sign in using the credentials provided on the lab page.

To complete this lab, you will need three container images to deploy. Once you have accessed the lab environment, activate the Cloud Shell. From there, download the zip file for the lab:

wget https://github.com/linuxacademy/content-google-cloud-run-deep-dive/raw/master/amazingapp.zip

Then, unzip it and run the build script to create the container images:

unzip amazingapp.zip
cd amazingapp
./buildall.sh

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?