A containerized application gray upgrade method, system, storage medium and device
By using containerized application canary upgrade methods and leveraging image startup parameters and gateway traffic configuration, we have achieved efficient and reliable canary upgrades in microservice architectures. This solves the problems of high availability and resource optimization in service upgrades in microservice architectures and reduces upgrade risks.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-16
- Publication Date
- 2026-04-14
AI Technical Summary
Existing technologies cannot efficiently upgrade services in microservice architectures, especially since they cannot perform canary releases without downtime. They also require a large amount of physical resources and manual intervention, and pose upgrade risks and difficulties in traffic switching.
By adopting a containerized application canary upgrade approach, the service is started in canary mode using image startup parameters, canary verification and traffic pressure verification are performed, and production traffic is gradually introduced through the gateway. Combined with the rolling upgrade function, the smooth switching of service nodes and resource optimization are achieved.
It enables highly available canary upgrades in microservice architectures without additional resources or manual intervention, reducing upgrade risks, minimizing service interruptions, and improving upgrade efficiency and reliability.
Smart Images

Figure CN113778491B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of application grayscale upgrade technology, specifically relating to a containerized application grayscale upgrade method, system, storage medium and device. Background Technology
[0002] The statements in this section are merely background information related to the present invention and do not necessarily constitute prior art.
[0003] Currently, application service upgrades mainly include maintenance upgrades and blue-green deployment methods, but they all have certain drawbacks.
[0004] System downtime upgrades can generally only be performed during off-peak business hours. This method results in service unavailability during the upgrade, failing to meet the high availability requirements of internet applications. Traditional IT system upgrades typically require several hours to complete the upgrade and related testing.
[0005] Blue-green deployment involves continuously deploying the new version while maintaining the old one, then testing and confirming success. Once successful, traffic is switched to the new version, and the old version is simultaneously upgraded. This process requires no downtime and carries minimal risk. However, it requires substantial physical resources to deploy the new version of the system. During deployment, it relies on load balancing for traffic switching. This approach offers good support for traditional architectures, but for microservice architectures, where services cannot fully rely on load balancing for traffic switching between each other, it becomes less effective. Summary of the Invention
[0006] To address the aforementioned issues, this invention proposes a containerized application canary upgrade method, system, storage medium, and device. This invention is applicable to business systems with microservice architectures, enabling efficient upgrades of service nodes while ensuring high service availability.
[0007] According to some embodiments, the present invention adopts the following technical solution:
[0008] A method for canary rollout of containerized applications includes the following steps:
[0009] Use the image to start the service in grayscale mode using startup parameters;
[0010] Perform canary testing on the launched grayscale service. If the testing fails, stop the grayscale upgrade; otherwise, proceed to the next step.
[0011] By using the gateway's traffic configuration, production traffic is gradually introduced into the canary service to perform traffic pressure verification and observe whether there are any anomalies in the canary service. If there are anomalies, the inflow of production traffic is shut off; otherwise, the amount of production traffic introduced is gradually increased until the canary service node and the existing production node are under balanced pressure.
[0012] Based on the load of the canary service, add canary service nodes. Once the canary service nodes can handle the traffic normally, modify the gateway configuration to switch all traffic to the canary service and perform rolling upgrades on the remaining production nodes.
[0013] As an alternative implementation, in the step of using the image to start the service in grayscale mode with startup parameters, the same tested image is used to start the grayscale mode service with startup parameters.
[0014] As an alternative implementation, during the canary verification process, when a new gray-scale service is added, a gray-scale test account is used to access the service and perform canary verification.
[0015] As an alternative implementation method, if the verification fails and the gray-scale upgrade is stopped, offline testing is conducted. If the offline test passes, the gray-scale release is then carried out.
[0016] As an alternative implementation, during the process of gradually introducing production traffic into the canary service using gateway traffic configuration, the introduction starts from a set percentage and gradually increases the percentage of traffic introduced into the canary service.
[0017] As an alternative implementation method, observing whether there are any abnormalities in the gray-scale service specifically includes observing whether there are any abnormal logs or abnormal resource usage in the gray-scale service.
[0018] As an alternative implementation method, the specific process of performing a rolling upgrade on all remaining production nodes includes: using the rolling upgrade function, using the same image of the grayscale in the production mode, performing a rolling upgrade to replace all remaining production nodes; after the rolling upgrade is completed, modifying the gateway configuration to switch all traffic to the production nodes, and deleting the grayscale service nodes to release physical resources.
[0019] A containerized application canary rollout system includes:
[0020] The module for publishing canary services is configured to use an image to start the service in canary mode using startup parameters.
[0021] The canary testing module is configured to perform canary verification on the launched gray-scale service. If the verification fails, the gray-scale upgrade will stop; otherwise, proceed to the next step.
[0022] The traffic stress test module is configured to gradually introduce production traffic into the canary service using the gateway's traffic configuration to perform traffic stress verification, observe whether there are any anomalies in the canary service, shut down the inflow of production traffic if there are an anomalies, otherwise continue to gradually increase the amount of production traffic introduced until the canary service node and the existing production node are under balanced pressure.
[0023] The rolling upgrade module is configured to add gray-scale service nodes based on the load of the gray-scale service. Once the gray-scale service nodes can handle the traffic normally, the gateway configuration is modified to switch all traffic to the gray-scale service and perform rolling upgrades on the remaining production nodes.
[0024] A computer-readable storage medium for storing computer instructions, which, when executed by a processor, perform the steps in the above method.
[0025] An electronic device includes a memory and a processor, as well as computer instructions stored in the memory and running on the processor, wherein the computer instructions, when executed by the processor, perform the steps in the method described above.
[0026] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0027] This invention achieves canary release functionality without introducing other complex canary upgrade components and without adding any services.
[0028] Compared to blue-green deployment, this invention requires fewer physical resources while still ensuring uninterrupted service.
[0029] The use of the same image for the grayscale service and the new version generation service in this invention avoids problems such as the need for manual code modification after canary verification.
[0030] The upgrade process of this invention fully considers potential problems and provides canary testing and traffic stress verification; it minimizes the impact of upgrade anomalies through canary testing and traffic control.
[0031] This invention, through rolling upgrades and replacements, can appropriately increase the number of gray-scale service nodes based on the load of the gray-scale service, achieve gray-scale service deployment with a small amount of resources, and also avoid the problems caused by manual upgrades.
[0032] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0033] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.
[0034] Figure 1 This is a flowchart illustrating at least one embodiment of the present invention. Detailed implementation method:
[0035] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0036] It should be noted that the following detailed description is illustrative and intended to provide further explanation of the invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0037] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of exemplary embodiments according to the invention. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.
[0038] A canary deployment method for containerized applications, in this embodiment, leverages the service registry Eurake and gateway Zuul of SpringCloud to achieve canary deployment. Eurake's metadata is used to mark canary services, and Zuul's filters and built-in Ribbon are used to allocate access between canary users and production traffic.
[0039] In this embodiment, dynamics can also be achieved using apo llo, but this is not the main content of this invention and will not be described in detail here.
[0040] like Figure 1 As shown, this method includes steps such as deploying gray-scale services, canary testing, traffic pressure verification, and rolling upgrades.
[0041] Specifically, when deploying a canary service, an image file that has passed offline testing is used, and the service is started in canary mode according to the startup parameters.
[0042] In this embodiment, using the same image file to start the grayscale mode with startup parameters can avoid the defect that after the test is passed, manual code adjustment is still required, which may introduce new problems and cause production service failures.
[0043] After seeing the newly added gray-scale service in the registry center, use a gray-scale test account to access the service and perform canary verification. The canary verification process can use existing technology and will not be described in detail here.
[0044] In this embodiment, canary verification is performed to prevent mirroring from causing anomalies in normal traffic introduction. If a problem is found during canary verification, the gray-scale upgrade is stopped, and offline testing is conducted before the gray-scale release. If canary verification passes, the traffic pressure verification step is initiated.
[0045] Once the canary service passes the canary verification, production traffic is gradually introduced into the canary service using the traffic configuration of the gateway zuul in the configuration center.
[0046] In this embodiment, a 1% initial rollout can be implemented, closely monitoring for any abnormal logs or resource usage in the canary service. If any anomalies are detected, production traffic inflow is immediately stopped. If no issues are found, the traffic percentage is gradually increased until it is balanced with the existing production nodes. Then, after several hours of static observation, a rolling upgrade can be initiated.
[0047] By applying traffic pressure, we can verify whether the service will experience anomalies under real traffic and long-term operation. Since the initial traffic volume is small, any anomalies can be quickly switched back to the production node, minimizing the impact. This approach ensures thorough verification of the reliability of the canary service while also improving system availability.
[0048] Then proceed with the rolling upgrade process:
[0049] Based on the load of the canary service, appropriately increase the number of canary service nodes and implement the canary service deployment using a small amount of resources. After the canary nodes can normally handle traffic, modify the gateway ZUL configuration to switch all traffic to the canary service. In this embodiment, then utilize Kubernetes' rolling upgrade function, using the same image file as the canary service, and adopt a production mode to perform a rolling upgrade and replace all remaining production nodes. After the rolling upgrade is completed, modify the ZUL configuration to switch all traffic to the production nodes. Then, delete the canary service nodes to release physical resources.
[0050] Through the above stages, a production service upgrade is completed. The entire process is safe and controllable, ensuring service availability during the upgrade while fully considering potential problems and minimizing the impact through effective measures. This solution has been proven safe and reliable in a production environment.
[0051] The present invention also provides the following product examples:
[0052] A containerized application canary rollout system includes:
[0053] The module for publishing canary services is configured to use an image to start the service in canary mode using startup parameters.
[0054] The canary testing module is configured to perform canary verification on the launched gray-scale service. If the verification fails, the gray-scale upgrade will stop; otherwise, proceed to the next step.
[0055] The traffic stress test module is configured to gradually introduce production traffic into the canary service using the gateway's traffic configuration to perform traffic stress verification, observe whether there are any anomalies in the canary service, shut down the inflow of production traffic if there are an anomalies, otherwise continue to gradually increase the amount of production traffic introduced until the canary service node and the existing production node are under balanced pressure.
[0056] The rolling upgrade module is configured to add gray-scale service nodes based on the load of the gray-scale service. Once the gray-scale service nodes can handle the traffic normally, the gateway configuration is modified to switch all traffic to the gray-scale service and perform rolling upgrades on the remaining production nodes.
[0057] A computer-readable storage medium for storing computer instructions, which, when executed by a processor, perform the steps in the above method.
[0058] An electronic device includes a memory and a processor, as well as computer instructions stored in the memory and running on the processor, wherein the computer instructions, when executed by the processor, perform the steps in the method described above.
[0059] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0060] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0061] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0062] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0063] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made by those skilled in the art without creative effort within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for canary rollout of containerized applications, characterized by: Includes the following steps: When deploying a gray-scale service, use the same offline tested image file to start the service in gray-scale mode using startup parameters. Use the same tested image to start the gray-scale service using startup parameters. Perform canary verification on the launched grayscale service. If verification fails, stop the grayscale upgrade; otherwise, proceed to the next step. During the canary verification process, when a new grayscale service is added, use the grayscale test account to access the service and perform canary verification. If the verification fails and the gray-scale upgrade is stopped, then switch to offline testing. If the offline test passes, then the gray-scale release can be carried out. If the canary verification passes, proceed to the traffic pressure verification. By using the gateway's traffic configuration, production traffic is gradually introduced into the canary service to perform traffic pressure verification and observe whether there are any anomalies in the canary service. If there are anomalies, the inflow of production traffic is shut off; otherwise, the amount of production traffic introduced is gradually increased until the canary service node and the existing production node are under balanced pressure. Based on the load of the gray-scale service, add gray-scale service nodes. Once the gray-scale service nodes can handle traffic normally, modify the gateway configuration to switch all traffic to the gray-scale service. Utilize the rolling upgrade function and use the same image of the gray-scale service in production mode to perform rolling upgrades and replace all remaining production nodes. After the rolling upgrade is completed, modify the gateway configuration to switch all traffic to the production nodes and delete the gray-scale service nodes to release physical resources. By leveraging Spring Cloud's service registry Eurake and gateway Zuul, canary releases can be implemented. Eurake's metadata is used to mark canary services, and Zuul's filters and built-in ribbon are used to allocate access for canary users and production traffic. This approach is suitable for business systems with microservice architectures.
2. The containerized application canary rollout method as described in claim 1, characterized in that: In the process of gradually introducing production traffic into the canary service using gateway traffic configuration, the introduction starts from a set percentage and gradually increases the percentage of traffic introduced into the canary service.
3. The containerized application canary rollout method as described in claim 1, characterized in that: Observing whether there are any anomalies in the gray-scale service specifically includes observing whether there are any abnormal logs or abnormal resource usage in the gray-scale service.
4. A containerized application canary rollout system, employing the containerized application canary rollout method as described in any one of claims 1-3, characterized in that: include: The module for publishing canary services is configured to use an image to start the service in canary mode using startup parameters. The canary testing module is configured to perform canary verification on the launched gray-scale service. If the verification fails, the gray-scale upgrade will stop; otherwise, proceed to the next step. The traffic stress test module is configured to gradually introduce production traffic into the canary service using the gateway's traffic configuration to perform traffic stress verification, observe whether there are any anomalies in the canary service, shut down the inflow of production traffic if there are anomalies, otherwise continue to gradually increase the amount of production traffic introduced until the canary service node and the existing production node are under balanced pressure. The rolling upgrade module is configured to add gray-scale service nodes based on the load of the gray-scale service. Once the gray-scale service nodes can handle the traffic normally, the gateway configuration is modified to switch all traffic to the gray-scale service and perform rolling upgrades on the remaining production nodes.
5. A computer-readable storage medium, characterized in that: Used to store computer instructions, which, when executed by a processor, complete the steps of the method according to any one of claims 1-3.
6. An electronic device, characterized in that: It includes a memory and a processor, as well as computer instructions stored in the memory and running on the processor, which, when executed by the processor, perform the steps of the method according to any one of claims 1-3.
Citation Information
Patent Citations
Automatic gray release method and device, computer system and storage medium
CN109814910A
Automatic gray release method based on container and service grid technology
CN110427204A
Gray release method and system
CN111949311A