Containerized Nacos blue-green publishing method and system

Through the containerized Nacos blue-green release method, the blue-green release strategy and health check mechanism is used to achieve unconscious upgrades and rapid rollback of Nacos services, solving the business interruption caused by upgrades during containerized deployment of Nacos, and ensuring the stability and reliability of the service.

CN119966818APending Publication Date: 2025-05-09QIMING INFORMATION TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510155517.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-12
Publication Date
2025-05-09

AI Technical Summary

Technical Problem

When deploying Nacos in containerized deployment, Nacos upgrades usually require downtime maintenance, resulting in business interruption and user perception problems. Especially in microservice architectures, updates may lead to instability of the entire system.

Method used

The containerized Nacos blue-green release method is adopted to upgrade the Nacos service without perception through the blue-green release strategy. Specific steps include containerized deployment of Nacos service cluster, planning tags, creating an independent Kubernetes Service, switching to Nacos blue and green clusters, and automatically switching back to the old version using the health check mechanism to ensure the stability of the service.

Benefits of technology

It realizes smooth upgrades of Nacos services, avoids business interruptions and user perception problems, provides a fast rollback mechanism, ensures the stability and reliability of services, and improves deployment flexibility and efficiency through containerized deployment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119966818A_ABST
    Figure CN119966818A_ABST
Patent Text Reader

Abstract

The invention discloses a containerized Nacos blue-green publishing method and system. The method comprises the following steps: S1, deploying a Nacos service cluster in a containerized manner; s2, planning labels for the two Nacos service clusters; s3, creating an independent Kubernetes Service (Kubernetes Service); and S4, switching the Nacos blue-green cluster. The system comprises a containerization module, a configuration dictionary ConfigMap, a Service module, a blue-green issuing strategy and a health examination mechanism. According to the method, the service interruption in the service upgrading process is solved, the new version and the old version run in parallel through a blue-green deployment strategy, and version updating can be realized without shutdown; a quick rollback mechanism is provided, and when a new version fails to deploy or has a problem, the new version is quickly recovered to an old version; deployment and management of the Nacos service are simplified through the containerization technology, and rapid deployment and dynamic expansion of the service are achieved through automatic tools and scripts.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to computer network and distributed fields, and in particular to a method and system for containerized Nacos blue-green publishing. Background Art

[0002] Nacos is an open source service registration and discovery platform from Alibaba. It is widely used in microservice architecture. Nacos provides service registration, discovery, configuration management and other functions to help manage and govern microservice applications.

[0003] With the popularity of cloud-native applications, containerization technologies such as Docker and Kubernetes have become the first choice for deploying and managing applications. The continuous update and iteration of services have become the key to maintaining service quality and continuous delivery capabilities. However, when Nacos is currently deployed in a container, Nacos upgrades often require downtime for maintenance, resulting in business interruptions and user-perceived problems, accompanied by temporary unavailability of services or performance degradation, affecting user experience. Especially in a microservice architecture, updates may cause instability in the entire system.

[0004] Therefore, how to achieve smooth upgrade of Nacos services has become a technical challenge that needs to be urgently solved in the field of cloud-native applications. Summary of the invention

[0005] The purpose of the present invention is to propose a method and system for containerized Nacos blue-green release in response to the above technical problems, and to use the blue-green release strategy to perform a non-perceptual upgrade of the Nacos service.

[0006] A method for containerized Nacos blue-green release includes the following sub-steps: S1: Containerized deployment of Nacos service cluster; S2: Plan labels for two sets of Nacos service clusters; S3: Create an independent Kubernetes Service; S4: Switch the Nacos blue-green cluster.

[0007] Furthermore, a method for containerized Nacos blue-green release is provided, wherein S1 includes the following sub-steps: S11: Deploy two Nacos service clusters, six Nacos service Pods, and four Service addresses on the container orchestration platform; S12: Two Nacos clusters share a set of databases and configuration dictionaries ConfigMap to ensure data and configuration consistency, and prepare for client-unaware cluster switching; The Nacos service cluster is a three-node cluster; The container orchestration platform includes Kubernetes; S13: Clusters communicate internally through independent Kubernetes Services and provide external services through Services.

[0008] Furthermore, a method for containerizing Nacos blue-green release is provided, wherein S2 includes the following sub-steps: S21: Define cluster labels as nacos-blue and nacos-green to distinguish Nacos clusters.

[0009] Further, a method for containerizing Nacos blue-green release, the S3 includes the following sub-steps: S31: Kubernetes Service uniformly exposes Nacos cluster services to the outside world; S32; Nacos cluster service determines the final destination of traffic accessing the Nacos cluster through the label selector and switches different Nacos blue-green clusters.

[0010] Further, a method for containerized Nacos blue-green release, the S4 includes the following sub-steps: S41: Modify the label content of the independent Kubernetes Server label selector and forward all request traffic from the original cluster to the Nacos blue cluster; S42: To prevent the local cache problem of the Nacos client from causing the client to still access the old cluster, shut down the original Nacos cluster; S43: With the help of the health detection mechanism of the Nacos client, the Nacos client is forced to clear the local cache and automatically connect to the new cluster, so that the client is not aware of the traffic switch.

[0011] A containerized Nacos blue-green release system, including a containerized module, a configuration dictionary ConfigMap, a Service module, a blue-green release strategy, and a health check mechanism; The containerization module packages the application and its dependencies into a container image to achieve consistent deployment and rapid expansion of the application; The configuration dictionary ConfigMap is a key resource object for storing configuration information in the Kubernetes environment; The Service module defines the way to access and expose container applications, so that external users can access applications running in one or more Pods through fixed addresses. The blue-green release strategy is a zero-downtime deployment strategy that is achieved by running two identical production environments simultaneously; The production environment includes a blue environment and a green environment; The health check mechanism automatically detects the status of the service instance and automatically performs recovery or restart operations when an anomaly is detected.

[0012] Furthermore, a containerized Nacos blue-green release system, wherein the containerized module includes a Docker container platform and Kubernetes; The Docker container platform provides a mechanism for packaging, distributing and running containers; Kubernetes, as a container orchestration tool, supports automatic deployment, expansion, and management of containerized applications.

[0013] Furthermore, a containerized Nacos blue-green release system is provided, wherein the configuration dictionary ConfigMap function is to store the configuration information of Nacos itself in the containerized Nacos blue-green release scenario, so that the Nacos service can directly read the configuration from the configuration dictionary ConfigMap when starting and running, without hard-coding the configuration in the image or traditional configuration file; The function of the Service module is to provide a unified access interface to the Pod group, maintain the persistence of the access address, and not affect the front-end access when the back-end Pod changes; The blue-green release strategy function is to deploy and fully test in the green environment. After confirmation, the production traffic will be smoothly migrated from the blue environment to the green environment to achieve seamless upgrade.

[0014] The beneficial effects of the present invention are as follows: a method and system for containerized Nacos blue-green release, through the blue-green release strategy, the old and new versions run simultaneously, until the new version is fully ready and passes the health check, and then the traffic is smoothly switched to the new version, so as to achieve zero-perception upgrade of the business; if there is a problem with the new version, it is immediately switched back to the old version to ensure the stability and reliability of the service; the containerized deployment method improves the flexibility and efficiency of deployment, and supports rapid deployment and expansion in a variety of cloud platforms and environments; the containerized technology ensures the consistency of application operation in different environments, and reduces the problems caused by environmental differences. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 It is a flowchart of the method of containerized Nacos blue-green release.

[0016] Figure 2 It is a structural diagram of a containerized Nacos blue-green release system. DETAILED DESCRIPTION

[0017] In order to have a clearer understanding of the technical features, purposes and effects of the present invention, specific embodiments of the present invention are now described with reference to the accompanying drawings.

[0018] As attached Figure 1 As shown, a method for containerized Nacos blue-green release includes the following sub-steps: S1: Containerized deployment of Nacos service cluster; S2: Plan labels for two sets of Nacos service clusters; S3: Create an independent Kubernetes Service; S4: Switch the Nacos blue-green cluster.

[0019] Furthermore, a method for containerized Nacos blue-green release is provided, wherein S1 includes the following sub-steps: S11: Deploy two Nacos service clusters, six Nacos service Pods, and four Service addresses on the container orchestration platform; S12: Two Nacos clusters share a set of databases and configuration dictionaries ConfigMap to ensure data and configuration consistency, and prepare for client-unaware cluster switching; The Nacos service cluster is a three-node cluster; The container orchestration platform includes Kubernetes; S13: Clusters communicate internally through independent Kubernetes Services and provide external services through Services.

[0020] Furthermore, a method for containerizing Nacos blue-green release is provided, wherein S2 includes the following sub-steps: S21: Define cluster labels as nacos-blue and nacos-green to distinguish Nacos clusters.

[0021] Further, a method for containerizing Nacos blue-green release, the S3 includes the following sub-steps: S31: Kubernetes Service uniformly exposes Nacos cluster services to the outside world; S32; Nacos cluster service determines the final destination of traffic accessing the Nacos cluster through the label selector and switches different Nacos blue-green clusters.

[0022] Further, a method for containerized Nacos blue-green release, the S4 includes the following sub-steps: S41: Modify the label content of the independent Kubernetes Server label selector and forward all request traffic from the original cluster to the Nacos blue cluster; S42: To prevent the local cache problem of the Nacos client from causing the client to still access the old cluster, shut down the original Nacos cluster; S43: With the help of the health detection mechanism of the Nacos client, the Nacos client is forced to clear the local cache and automatically connect to the new cluster, so that the client is not aware of the traffic switch.

[0023] As attached Figure 2 As shown, a containerized Nacos blue-green release system includes a containerized module, a configuration dictionary ConfigMap, a Service module, a blue-green release strategy, and a health check mechanism; The containerization module packages the application and its dependencies into a container image to achieve consistent deployment and rapid expansion of the application; The configuration dictionary ConfigMap is a key resource object for storing configuration information in the Kubernetes environment; The Service module defines the way to access and expose container applications, so that external users can access applications running in one or more Pods through fixed addresses. The blue-green release strategy is a zero-downtime deployment strategy that is achieved by running two identical production environments simultaneously; The production environment includes a blue environment and a green environment; The health check mechanism automatically detects the status of the service instance and automatically performs recovery or restart operations when an anomaly is detected.

[0024] Furthermore, a containerized Nacos blue-green release system, wherein the containerized module includes a Docker container platform and Kubernetes; The Docker container platform provides a mechanism for packaging, distributing and running containers; Kubernetes, as a container orchestration tool, supports automatic deployment, expansion, and management of containerized applications.

[0025] Furthermore, a containerized Nacos blue-green release system is provided, wherein the configuration dictionary ConfigMap function is to store the configuration information of Nacos itself in the containerized Nacos blue-green release scenario, so that the Nacos service can directly read the configuration from the configuration dictionary ConfigMap when starting and running, without hard-coding the configuration in the image or traditional configuration file; The function of the Service module is to provide a unified access interface to the Pod group, maintain the persistence of the access address, and not affect the front-end access when the back-end Pod changes; The blue-green release strategy function is to deploy and fully test in the green environment. After confirmation, the production traffic will be smoothly migrated from the blue environment to the green environment to achieve seamless upgrade.

[0026] This solution solves the business interruption during the service upgrade process through a containerized Nacos blue-green release method and system. Through the blue-green deployment strategy, the old and new versions run in parallel, and version updates can be achieved without downtime. It provides a fast rollback mechanism. When the new version deployment fails or there are problems, it can be quickly restored to the old version to ensure service continuity and stability. Containerization technology simplifies the deployment and management of Nacos services, and realizes rapid deployment and dynamic expansion of services through automated tools and scripts, reducing the complexity of manual operations.

[0027] The above shows and describes the basic principles and main features of the present invention and the advantages of the present invention. It should be understood by those skilled in the art that the present invention is not limited to the above embodiments. The above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention to be protected. The scope of protection of the present invention is defined by the attached claims and their equivalents.

Claims

1. A method for containerized Nacos blue-green release, characterized in that: It includes the following sub-steps: S1: Containerized deployment of Nacos service cluster; S2: Plan labels for two sets of Nacos service clusters; S3: Create an independent Kubernetes Service; S4: Switch the Nacos blue-green cluster.

2. According to claim 1, a method for containerized Nacos blue-green release is characterized in that: The S1 comprises the following sub-steps: S11: Deploy two Nacos service clusters, six Nacos service Pods, and four Service addresses on the container orchestration platform; S12: Two Nacos clusters share a set of databases and configuration dictionaries ConfigMap to ensure data and configuration consistency, and prepare for client-unaware cluster switching; The Nacos service cluster is a three-node cluster; The container orchestration platform includes Kubernetes; S13: Clusters communicate internally through independent Kubernetes Services and provide external services through Services.

3. According to claim 1, a method for containerized Nacos blue-green release is characterized in that: The S2 comprises the following sub-steps: S21: Define cluster labels as nacos-blue and nacos-green to distinguish Nacos clusters.

4. According to claim 1, a method for containerized Nacos blue-green release is characterized in that: The S3 comprises the following sub-steps: S31: Kubernetes Service uniformly exposes Nacos cluster services to the outside world; S32; Nacos cluster service determines the final destination of traffic accessing the Nacos cluster through the label selector and switches different Nacos blue-green clusters.

5. According to claim 1, a method for containerized Nacos blue-green release is characterized in that: The S4 comprises the following sub-steps: S41: Modify the label content of the independent Kubernetes Server label selector and forward all request traffic from the original cluster to the Nacos blue cluster; S42: To prevent the local cache problem of the Nacos client from causing the client to still access the old cluster, shut down the original Nacos cluster; S43: With the help of the health detection mechanism of the Nacos client, the Nacos client is forced to clear the local cache and automatically connect to the new cluster, so that the client is not aware of the traffic switch.

6. A system for containerized Nacos blue-green release, implemented based on a method for containerized Nacos blue-green release according to any one of claims 1 to 5, characterized in that: Including containerized modules, configuration dictionary ConfigMap, Service module, blue-green release strategy, and health check mechanism; The containerization module packages the application and its dependencies into a container image to achieve consistent deployment and rapid expansion of the application; The configuration dictionary ConfigMap is a key resource object for storing configuration information in the Kubernetes environment; The Service module defines the way to access and expose container applications, so that external users can access applications running in one or more Pods through fixed addresses. The blue-green release strategy is a zero-downtime deployment strategy that is achieved by running two identical production environments simultaneously; The production environment includes a blue environment and a green environment; The health check mechanism automatically detects the status of the service instance and automatically performs recovery or restart operations when an anomaly is detected.

7. A containerized Nacos blue-green release system according to claim 6, characterized in that: The containerization module includes Docker container platform and Kubernetes; The Docker container platform provides a mechanism for packaging, distributing and running containers; Kubernetes, as a container orchestration tool, supports automatic deployment, expansion, and management of containerized applications.

8. A containerized Nacos blue-green release system according to claim 6, characterized in that: The configuration dictionary ConfigMap function is to store the configuration information of Nacos itself in the blue-green release scenario of containerized Nacos, so that the Nacos service can directly read the configuration from the configuration dictionary ConfigMap when it is started and running, without hard-coding the configuration in the image or traditional configuration file; The Service module function is to provide a unified access interface to the Pod group, maintain the persistence of the access address, and not affect the front-end access when the back-end Pod changes; The blue-green release strategy function is to deploy and fully test in the green environment. After confirmation, the production traffic will be smoothly migrated from the blue environment to the green environment to achieve seamless upgrade.