Only one grayscale version can be released for a service. You can configure grayscale policies for the version.
Before releasing a new service version in the production environment and letting it serve all the live traffic, you can add a grayscale version and configure grayscale policies to serve just a proportion of the traffic. After the grayscale version has run stably for a period, it can serve as the default version to take over all traffic in place of the original version in the production environment.
Select Canary Release or Blue-Green Deployment as required. For details about the differences between the two forms, see Grayscale Release Overview.
Customize a grayscale release task name. Enter 4 to 63 characters, starting with a lowercase letter and ending with a letter or digit. Only lowercase letters, digits, and hyphens (-) are allowed.
Select the namespace to which the service belongs.
Select the service to be released from the drop-down list box. Services that are running grayscale tasks cannot be selected. They are automatically filtered out from the list.
Select the workload to which the service belongs.
Current service version number, which cannot be changed.
Select the cluster on which the grayscale version of the service will be deployed.
Enter the grayscale version number of the service.
Number of pods of the grayscale version. You can modify the number as required. Each pod of the grayscale version consists of containers deployed with the same image.
The image of the service is selected by default.
Select the image tag of the grayscale version.
Ensure that all pods of the grayscale version are running normally and configure the traffic policy when the startup progress reaches 100%. You can view the pod monitoring information, including Start Logs and Performance Monitoring on the View Status page.
Policy Type: The value can be Based on traffic ratio or Based on request content.
A specified ratio of traffic will be directed to the grayscale version. For example, 75% of the traffic is directed to the original version, and 25% is directed to the grayscale version. In actual applications, you can gradually increase the traffic ratio of the grayscale version and deliver policies to monitor the performance of the grayscale version.
Traffic ratio: You can set the traffic ratio for the original version and grayscale version. The system distributes traffic to the two versions based on the specific traffic ratio.
The grayscale version can be accessed only when the traffic meets the rules based on the cookies, custom headers, queries, operating systems, and browsers. For example, only HTTP requests whose cookies meet User=Internal can be forwarded to the grayscale version. Other requests are still received by the original version.
Regular expression: When the cookie of a request matches the configured regular expression, the request will be distributed to the grayscale version.
You can customize the key and value for filtering. The value supports the full match and regular expression.
You can customize the key and value for filtering. The value supports the full match and regular expression.
A traffic policy based on request content is valid only for the entry service that is directly accessed. If you want the traffic policy to be applied to all services, the header information of HTTP requests needs to be transferred in the service code.
For example, if you configured a grayscale policy based on the request content for service reviews and did not transfer the HTTP request header information in the service code, the grayscale policy will not take effect when you send requests to service productpage.
The reason is that when the productpage service calls the reviews service, the header information of the HTTP request you sent to productpage will be lost. As a result, the reviews service receives a request without the header information. The grayscale policy will not take effect.
It takes several seconds for a grayscale policy to take effect. You can view the traffic monitoring of the service and the health monitoring of the original version and grayscale version.