Rolling, Gray, Blue-Green Release

Before the software goes online, it is inevitable to test the usability and reliability of the software, and it cannot be shut down for maintenance, which affects the user experience, and can be rolled back in time when there is a problem with the new version; therefore, a complete deployment plan is required. Here are the principles, ideas, and implementation methods of Kato-based rolling release, grayscale release, and blue-green release.

1. Rolling Release

Overview

Rolling release refers to stopping the service of one instance or multiple instances, performing updates, and putting it into use again; it goes over and over again, until all the instances are updated to the new version.

The difference between the stateless component rolling update and the stateful component rolling update of the Kato platform:

  • Stateless component: When rolling update, a new instance will be generated first, and the new instance will run in the background after it is started. The platform will use the health monitoring mechanism to monitor the port to determine whether the application in the new instance is running normally, and once it is monitored that the application is running normally , New applications will be launched and old applications will be destroyed to complete the rolling release process.

  • Stateful components: If it is a non-clustered application, the old instance will stop running before generating a new instance. After the new instance is updated, the old instance will be abolished. If it is a clustered application, there is no need to worry about the service Interruption can be updated in batches. To ensure the operation of the service.

Prerequisites

  1. Kato in normal operation,
  2. For the running test component, refer to Source code construction to directly build the project.

Steps

Here is an example of stateless components

  1. Switch component build source code branch to devel branch,
  1. Click Build to proceed with the build operation,
  2. After the build is completed, a rolling upgrade will be performed automatically.

Show results

During the rolling upgrade process, you can dynamically view the instance creation status on the component scaling interface. A new instance is created and runs normally, and the old instance will be deleted. At this time, the new version is online. For the client, access to the service is not possible. Affected.


2. Grayscale Release

Overview

Grayscale publishing refers to a publishing method that can smoothly transition between black and white. Grayscale publishing can ensure the stability of the overall system. Problems can be found and adjusted at the initial grayscale to ensure their impact.

Prerequisites

  1. Kato in normal operation,
  2. The old and new versions of the running test components, refer to source code construction to directly build the project OK (here the master branch is the old version, and the devel branch is the new version),
  3. Have a test domain name.

Steps

From the perspective of traffic control, the first 10% traffic is switched to the new version, and the weight is gradually increased. Under normal circumstances, the weight of the old version is reduced to 0; that is, the gray-scale release is completed.

  1. Bind the test domain names to the two test components, and add the following two HTTP access policies to set the corresponding weights through Gateway -> Access Policy Management:
Web ServicesDomain NameWeight
Gray release old versionwww.katotest.com90
Grayscale releases a new versionwww.katotest.com10

Example

  1. Gradually reduce the weight of the old version and increase the weight of the new version as needed, until the weight of the old version is reduced to 0 to complete the grayscale release.

Show results

When you visit the test domain name during the weight switching process, the content you see when you refresh the page is different, and changes constantly with the weight adjustment, so as to reflect the gray release process.


3. Blue-green Release

Overview

Blue-green deployment is to keep the old version, deploy the new version and then test, confirm OK, cut the traffic to the new version, and then upgrade the old version to the new version at the same time.

Prerequisites

  1. Kato in normal operation,
  2. The old and new versions of the running test components, refer to source code construction to directly build the project OK (here the master branch is the old version, and the devel branch is the new version),
  3. Have a test domain name.

Steps

  1. Web service binding domain name
Web ServicesDomain NameWeight
Web V1www.katotest.com100
Web V2www.katotest.com0
  1. Reduce and increase the weight respectively through Gateway -> Access Policy Management; adjust the weight of Web V1 to 0, and adjust the weight of Web V2 to 100, which means switching between versions

Show results

Visit the test domain, check that the traffic has been transferred to Web V2, and the blue-green release has been completed.

You may also need to read:

One-click online/rollback based on version number

Kato-based component A/B testing practice