Skip to main content

Canary Release

When you modify code and publish a new CloudRun service version, you can choose automatic canary release or manual canary release. Canary release lets you switch traffic gradually during rollout and reduce the risk of sending all traffic to a new version at once.

Release modes​

CloudRun supports the following release modes:

  • Automatic canary release: Suitable for low-risk changes where you want the latest version to take traffic immediately after the release is complete.
  • Manual canary release: Suitable when you need to validate the new version gradually, or validate it for specific users or request rules.

For either mode, the canary process continues only after the new version is created successfully. If the new version fails to be created, the system does not start canary release and online traffic remains on the old version.

Automatic canary release​

After you choose automatic canary release, the system automatically switches service traffic to the latest version when the new version is published.

Automatic canary release is suitable when:

  • The new version contains small changes and has been verified in a testing environment.
  • You want to reduce the operational cost of manually configuring traffic.
  • All online requests can use the latest version immediately after publishing.

After automatic canary release is complete, the old version no longer handles online traffic. To roll back, adjust the service version in version management or publish another version.

Manual canary release​

After you choose manual canary release, the new version does not automatically take over all online traffic after it is created successfully. You need to configure a canary plan yourself and route part of the requests to the new version for verification.

Manual canary release supports the following configuration methods:

  • Canary by traffic percentage: Randomly route a specified percentage of requests to the new version. For example, route 10% of traffic first, then increase to 50% and 100% after stability is verified.
  • Canary by specific rules: Route matching requests to the new version by rules such as URL parameters. For example, only test users, a specified channel, or requests with specific parameters access the new version.

For traffic configuration details, see Traffic Configuration Instructions.

Complete or cancel canary release​

Manual canary release is not intended to remain in progress permanently. After verification, explicitly end the canary process:

  • Complete canary release and use the latest version: After the new version passes verification, switch all traffic to the latest version and end the canary process.
  • Cancel canary release and use the old version: If the new version does not meet expectations, cancel this canary release and continue using the old version for online traffic.

Before completing or canceling canary release, keep observing the new version's logs, monitoring metrics, and business request results to confirm that the service status meets expectations.

Failure protection​

If the new version fails during creation, build, or startup, the system does not enter the canary process and does not automatically change the current online traffic configuration. The old version continues to handle online requests.

In this case, check the build logs, service logs, and version status, fix the issue, and publish the new version again.