Routing configuration method and apparatus, and device, storage medium and computer program
By obtaining the routing configuration information of the target microservice in the routing configuration interface and sending routing configuration instructions in turn according to the routing configuration policy, the problems of low routing configuration efficiency and race conditions of multiple routing nodes are solved, and efficient and reliable routing configuration is achieved.
Patent Information
- Application Number
- PCT/CN2024/100229
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-12-07
- Filing Date
- 2024-06-19
- Publication Date
- 2025-04-03
AI Technical Summary
Under the K8s containerized microservice architecture, the routing configuration efficiency of multiple routing nodes is low and there are conditional competition problems, which may lead to unavailability of microservices.
Provide a routing configuration method, which obtains the routing configuration information of the target microservice through the routing configuration interface, determines the routing node and its target routing information on the access path of the target microservice, and sends routing configuration instructions in turn according to the routing configuration policy to avoid the race conditions for the routing configuration to take effect.
The efficiency of routing configuration of multiple routing nodes is improved, and the race conditions for routing configuration to take effect is avoided, thereby ensuring the availability of microservices.
Smart Images

Figure CN2024100229_03042025_PF_FP_ABST
Abstract
Description
Routing configuration method, device, equipment, storage medium and computer program
[0001] This application claims priority to Chinese patent application No. 202311287924.X filed on September 28, 2023, with invention name “A gateway configuration method, device and system”, and claims priority to Chinese patent application No. 202311680905.3 filed on December 7, 2023, with invention name “Routing configuration method, device, equipment, storage medium and computer program”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of network technology, and in particular to a routing configuration method, apparatus, device, storage medium, and computer program. Background Art
[0003] In a microservices architecture based on K8s containers, traffic scheduling and load balancing are typically accomplished through the collaboration of internal and external routing nodes. External routing nodes are responsible for forwarding user traffic to the corresponding K8s cluster, while internal routing nodes are responsible for forwarding user traffic flowing into the K8s cluster to the corresponding microservice.
[0004] In related technologies, when configuring the service access route for a microservice, it is necessary to adjust the node routing information of multiple internal and external routing nodes on the service access path. Specifically, the administrator first determines the internal routing node corresponding to the K8s cluster to which the microservice belongs, and determines the external routing node corresponding to the network region (Region) to which the K8s cluster belongs. Then, the administrator adjusts the node routing information of the internal routing node through the routing controller of the internal routing node; and adjusts the node routing information of the external routing node through the routing controller of the external routing node.
[0005] However, when the above method performs routing configuration asynchronously on multiple routing nodes, the configuration efficiency of service access routing is low; when there is competition among the routing configurations of multiple routing nodes, the microservice may become unavailable.
[0006] Summary of the Invention
[0007] The present application provides a routing configuration method, apparatus, device, storage medium, and computer program that can improve the efficiency of configuring multiple routing nodes. The technical solution is as follows.
[0008] In a first aspect, a routing configuration method is provided, the method comprising:
[0009] A routing configuration interface is provided, wherein the routing configuration interface is used to obtain routing configuration information of a target microservice, wherein the routing configuration information includes a deployment address of the target microservice, and there is at least one routing node on the access path of the target microservice; based on the routing configuration information, target routing information of the at least one routing node is determined, wherein the target routing information is the routing information of the at least one routing node when the target microservice can be accessed through the at least one routing node; based on the target routing information of the at least one routing node, a routing configuration instruction is sent to the at least one routing node in accordance with a routing configuration policy, wherein the routing configuration policy indicates a routing configuration order of the at least one routing node; real-time routing information of the at least one routing node is obtained, wherein the real-time routing information is the current routing information of the at least one routing node; if the real-time routing information of the at least one routing node is the same as the respective target routing information, then it is determined that the routing configuration of the target microservice is complete.
[0010] It can be seen that after the present application obtains the routing configuration information of the target microservice in the routing configuration interface, it can determine at least one routing node on the access path of the target microservice and the target routing information of the at least one routing node based on the routing configuration information. Then, based on the target routing information of the at least one routing node, according to the routing configuration policy, a routing configuration instruction is sent to the at least one routing node to control the at least one routing node to perform routing configuration operations in sequence according to the configuration order. In this way, the competition condition of the routing configuration of multiple routing nodes is avoided, thereby improving the routing configuration efficiency when configuring the access route of the target microservice.
[0011] Optionally, the at least one routing node includes a first routing node and a second routing node, and the routing configuration policy indicates that the routing configuration order of the first routing node is earlier than that of the second routing node; the sending of a routing configuration instruction to the at least one routing node based on the target routing information of the at least one routing node in accordance with the routing configuration policy includes: sending a first configuration instruction to the first routing node, the first configuration instruction carrying the target routing information of the first routing node; if the real-time routing information of the first routing node is the same as the target routing information, sending a second configuration instruction to the second routing node, the second configuration instruction carrying the target routing information of the second routing node; if the real-time routing information of the at least one routing node is the same as the respective target routing information, determining that the routing configuration of the target microservice is completed includes: if the real-time routing information of the second routing node is the same as the target routing information, determining that the routing configuration of the target microservice is completed.
[0012] That is, this application configures routing information for at least one routing node in turn according to the routing configuration strategy, and sends configuration instructions to the next node only after the previous routing node completes the configuration operation of the routing information, ensuring that the routing configuration of multiple routing nodes takes effect without competition conditions.
[0013] Optionally, the target microservice includes a newly added microservice, the first routing node is a routing node connected to the newly added microservice, and the first routing node is connected to the second routing node, and the second routing node includes a routing node between the first routing node and the root routing node that receives user traffic.
[0014] That is, when configuring the access route of a newly added microservice, first configure the routing information of the routing node connected to the newly added microservice, then configure the routing information of the next routing node in sequence, and finally configure the routing information of the root routing node.
[0015] Optionally, the target microservice includes an original microservice, and the routing configuration information indicates that the original microservice is switched from a third routing node to the first routing node, the third routing node is the routing node connected to the original microservice before the switching, and the first routing node is the routing node connected to the original microservice after the switching.
[0016] Optionally, the at least one routing node further includes the third routing node, and the second routing node is a routing node connected to the first routing node and the third routing node; if the real-time routing information of the second routing node is the same as the target routing information, the method further includes: sending a first deletion instruction to the third routing node, the first deletion instruction instructing the third routing node to delete the routing information of the original microservice.
[0017] That is, when switching the access route of the original microservice between different clusters, first configure the routing information of at least one routing node on the original microservice access path after the switch, and then delete the routing information of the relevant routing nodes on the original microservice access path before the switch.
[0018] Optionally, the at least one routing node further includes the third routing node and the fourth routing node, the second routing node is a routing node connected to the first routing node, and the fourth routing node is a routing node connected to the third routing node; if the real-time routing information of the second routing node is the same as the target routing information, the method further includes: sending a second deletion instruction to the fourth routing node, the second deletion instruction instructing the fourth routing node to delete the routing information of the original microservice.
[0019] That is, when switching the access route of the original microservice between different areas, first configure the routing information of at least one routing node on the original microservice access path after the switch, and then delete the routing information of the relevant routing nodes on the original microservice access path before the switch.
[0020] Optionally, the target microservice includes an original microservice, the routing configuration information indicates deletion of routing information of the original microservice, the first routing node is a root routing node for receiving user traffic, and the first routing node is connected to the second routing node, and the second routing node includes a routing node between the original microservice and the first routing node.
[0021] That is, when deleting the access route to the original microservice, you can directly delete the routing information of the original microservice on the root routing node. Of course, you can also delete the routing information of the original microservice on the root routing node, then configure the routing information of the next routing node in sequence, and finally delete the routing information on the routing node connected to the original microservice.
[0022] Optionally, the routing configuration information further includes one or more of a domain name, context information, and an identifier of the target microservice, wherein the domain name indicates the network area to which the target microservice belongs, and the context information indicates the cluster to which the target microservice belongs.
[0023] Optionally, the at least one routing node includes one or more of a load balancing gateway, a proxy server, an Ingress gateway, and a Gateway gateway.
[0024] In a second aspect, a routing configuration device is provided, which has the function of implementing the routing configuration method in the first aspect. The routing configuration device includes at least one module, which is used to implement the routing configuration method provided in the first aspect.
[0025] According to a third aspect, a computing device cluster is provided, wherein the computing device cluster includes at least one computing device, each computing device including a processor and a memory;
[0026] The processor of the at least one computing device is used to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the routing configuration method described in the first aspect above.
[0027] In a fourth aspect, a computer-readable storage medium is provided, comprising computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster executes the routing configuration method described in the first aspect.
[0028] In a fifth aspect, a computer program product comprising instructions is provided. When the instructions are executed by a computing device cluster, the computing device cluster executes the routing configuration method described in the first aspect.
[0029] The technical effects obtained in the above-mentioned second, third, fourth and fifth aspects are similar to those obtained by the corresponding technical means in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] FIG1 is a schematic diagram of user traffic scheduling under a microservice architecture provided by an embodiment of the present application;
[0031] FIG2 is a flow chart of a routing configuration method provided in an embodiment of the present application;
[0032] FIG3 is a schematic diagram of a routing configuration of a newly added microservice provided in an embodiment of the present application;
[0033] FIG4 is a schematic diagram of routing switching of an original microservice provided in an embodiment of the present application;
[0034] FIG5 is a schematic diagram of routing switching of another original microservice provided in an embodiment of the present application;
[0035] FIG6 is a schematic diagram of route deletion of an original microservice provided in an embodiment of the present application;
[0036] FIG7 is a logical diagram of a global routing controller performing routing configuration of multiple cascaded routing nodes provided by an embodiment of the present application;
[0037] FIG8 is a schematic structural diagram of a routing configuration device provided in an embodiment of the present application;
[0038] FIG9 is a schematic diagram of the structure of a computing device provided in an embodiment of the present application;
[0039] FIG10 is a schematic diagram of the structure of a computing device cluster provided in an embodiment of the present application;
[0040] FIG11 is a schematic diagram of a network connection relationship of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0041] In order to make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0042] Before explaining the routing configuration method provided in the embodiment of the present application, the professional terms and application scenarios involved in the embodiment of the present application are first introduced.
[0043] First, the professional terms involved in the embodiments of this application are introduced.
[0044] 1. Load balancing (LB)
[0045] A computer technology used to distribute the load among multiple computing devices (cluster of computing devices), servers (server groups), network connections, central processing units (CPUs), disk drives, or other resources to optimize resource use, maximize throughput, minimize response time, and avoid overload.
[0046] 2. Elastic load balancing (ELB)
[0047] A traffic scheduling service that distributes access requests to multiple elastic servers at the backend according to forwarding rules. This can expand the external service capabilities of the application system through traffic distribution and improve the fault tolerance of the application.
[0048] 3. Disaster Recovery
[0049] Establish two or more systems with the same functions in two geographically distant locations. These systems can monitor their health status or switch functions. When one of the systems stops working due to an accident (such as fire or earthquake), the application can be switched to the other system for operation.
[0050] 4. Region
[0051] Based on geographic location, a collection of infrastructure services in a region can be called a region. For example, servers in City A and Province B can be called Region A servers and Region B servers, respectively.
[0052] 5. Availability zone (AZ)
[0053] A region typically consists of multiple AZs, and an AZ typically consists of multiple data centers. Two AZs are designed to be independent of each other, with independent power systems, networks, and other features. A failure in one AZ will not affect the normal operation of the other AZs.
[0054] 6. Kubernetes (K8s)
[0055] Kubernetes is an open-source container orchestration engine from Google that supports automated deployment, massive scalability, and containerized application management. When deploying an application in a production environment, multiple instances are typically deployed to load balance application requests. In Kubernetes, multiple containers can be created, each running an application instance. Built-in load balancing policies enable management, discovery, and access to this group of application instances, eliminating the need for complex manual configuration and management by operations personnel.
[0056] 7. Istio
[0057] A service mesh that provides a transparent, language-independent way to flexibly and easily automate application network functions. Istio is a common solution for managing the different microservices that make up cloud-native applications and how these microservices communicate and share data with each other.
[0058] 8. Intelligent Proxy (Envoy)
[0059] An L7 proxy and communication bus designed for large modern service architectures. It has the following features: support for L3 / L4 / L7 filters, support for L7 Hypertext Transfer Protocol (HTTP) routing, support for Google Remote Procedure Call (gRPC) / HTTP2 / HTTP3, service discovery, and dynamic configuration.
[0060] Next, the application scenarios of the routing configuration method provided in the embodiments of the present application are introduced.
[0061] Referring to the microservice deployment architecture shown in Figure 1, the scheduling and load balancing of business traffic is generally completed by multiple routing nodes working together. Among them, the external routing node is responsible for routing user traffic to the cluster, and the internal routing node is responsible for routing user traffic outside the cluster to the corresponding workload (i.e., microservice). Among them, the cluster can be implemented through K8s or Istio, and this embodiment of the application does not limit this.
[0062] Referring to Figure 1, when configuring the routing of microservice 1, it is necessary to configure corresponding routing information on both the external routing node and the internal routing node, so that when user traffic accesses microservice 1, the external routing node routes the user traffic to the internal routing node in the cluster according to the configured routing information, and the internal routing node routes the user traffic to microservice 1 according to the configured routing information.
[0063] It should be noted that Figure 1 only uses an external routing node to associate with an internal routing node of a cluster, and two microservices are deployed in the cluster as an example. It does not constitute a restriction on the number of routing nodes, the number of clusters, and the number of microservices deployed in the cluster that can be set in the microservice deployment architecture.
[0064] Based on the above microservice deployment architecture, when configuring the service access route of the target microservice, it is usually necessary to configure the routing information of multiple routing nodes on the access path of the target microservice. However, each routing node has its own independent routing controller, and the corresponding routing controller needs to be operated separately to configure the routing information of multiple routing nodes. When configuring the routing information, mismatches and omissions are prone to occur, which may cause the target microservice to be unavailable.
[0065] Furthermore, because configuring routing information for multiple routing nodes is an asynchronous operation, there is a race condition between the routing configurations of the cascaded routing nodes, which may cause the microservice to become unavailable. For example, if the target microservice is a newly added microservice, and the routing configuration of the external routing node takes effect before the routing configuration of the internal routing node, when the external routing node routes user traffic to the internal routing node based on the configured routing information, the internal routing node will not be able to route user traffic to the corresponding microservice based on the configured routing information because the routing configuration has not yet taken effect, resulting in microservice access failure.
[0066] Based on this, an embodiment of the present application provides a routing configuration method, which uses a computing device to manage the routing configuration information and routing configuration timing of all routing nodes in the microservice architecture, and controls each routing node to perform routing configuration operations in sequence according to the specified routing configuration order, thereby avoiding conditional competition for the routing configuration of multiple routing nodes to take effect, thereby improving the routing configuration efficiency.
[0067] Please refer to Figure 2, which is a flowchart of a routing configuration method provided in an embodiment of the present application, which is applicable to any computing device or computing device cluster. The method includes the following steps.
[0068] Step 201: Provide a routing configuration interface, which is used to obtain routing configuration information of a target microservice. The routing configuration information includes the deployment address of the target microservice, and there is at least one routing node on the access path of the target microservice.
[0069] The routing configuration interface is used by the administrator to input routing configuration information of the target microservice. After the administrator inputs the routing configuration information of the target microservice, the computing device can obtain the routing configuration information and execute the following steps 202 to 205.
[0070] In some embodiments, the routing configuration information is used to indicate a routing configuration operation of a target microservice. The routing configuration information may include configuring routing information of a target microservice, changing routing information of a target microservice, and deleting routing information of a target microservice.
[0071] Optionally, the routing configuration information further includes one or more of a domain name, context information, and an identifier of the target microservice, wherein the domain name indicates the network region to which the target microservice belongs, the context information indicates the cluster to which the target microservice belongs, and the identifier may be the number of the target microservice.
[0072] As an example, the routing configuration information may be: https: / / domain / ms1, and the backend of the routing configuration information points to the access address ms1.namespace1 of the target microservice ms1 within the cluster.
[0073] After determining the deployment address of the target microservice based on the routing configuration information, the computing device obtains network topology information and, based on the network topology information and the deployment address of the target microservice, determines at least one routing node on the access path to the target microservice. The network topology information includes routing relationships between multiple routing nodes and multiple microservices in the microservice architecture.
[0074] In some embodiments, at least one routing node on the access path of the target microservice includes one or more of a load balancing gateway, a proxy server, an Ingress gateway, and a Gateway gateway.
[0075] Among them, load balancing gateways and proxy servers usually act as external routing nodes outside the cluster to route user traffic to the corresponding cluster. The load balancing gateway can be an elastic load balancing (ELB) gateway, application load balancing (ALB), network load balancing (NLB), etc.; the proxy server can be an Nginx instance, Envoy instance, Kong instance, etc. The Ingress gateway and Gateway gateway usually act as internal routing nodes of the cluster to route user traffic outside the cluster to the corresponding microservices. The Ingress gateway is the gateway of the K8s cluster, and its underlying layer can be implemented by Nginx instances and Envoy instances; the Gateway gateway is the gateway of the Istio cluster, and its underlying layer is implemented by Envoy instances by default.
[0076] It should be noted that, with the changes in the microservice architecture, external routing nodes and internal routing nodes may derive other types of gateways or proxy devices. The embodiments of the present application do not limit the specific type and implementation method of at least one routing node, and only use the above-mentioned types as examples.
[0077] Step 202: Based on the routing configuration information, determine target routing information of at least one routing node, where the target routing information is routing information of the at least one routing node when the target microservice can be accessed through the at least one routing node.
[0078] The target routing information of a routing node includes the node address of the routing node cascaded with the routing node in the target microservice access path, or the deployment address of the target microservice. Whether the target routing information includes the node address of the routing node or the deployment address of the target microservice depends on whether the routing node is directly connected to the target microservice. When the routing node is directly connected to the target microservice, the target routing information of the routing node includes the deployment address of the target microservice; when there are other routing nodes between the routing node and the target microservice, the target routing information of the routing node includes the node address of the next routing node cascaded with the routing node.
[0079] When there is only one routing node on the access path of the target microservice, that is, the number of nodes of the at least one routing node is one, the routing node is directly connected to the target microservice. The routing node can directly route user traffic to the target microservice. At this time, the target routing information of the routing node is the deployment address of the target microservice.
[0080] When the access path to the target microservice includes multiple cascaded routing nodes (i.e., when the at least one routing node mentioned above is multiple), the multiple cascaded routing nodes sequentially route user traffic to the target microservice. In this case, the target routing information for the multiple routing nodes includes the address of the next routing node in the cascade or the deployment address of the target microservice. The target routing information for the root routing node that receives user traffic is the address of the next routing node in the cascade, while the target routing information for the routing node connected to the target microservice is the deployment address of the target microservice.
[0081] Step 203: Based on the target routing information of the at least one routing node, a routing configuration instruction is sent to the at least one routing node according to a routing configuration policy, where the routing configuration policy indicates a routing configuration order for the at least one routing node.
[0082] In some embodiments, the at least one routing node includes a first routing node, and the implementation process of step 203 is: sending a first configuration instruction to the first routing node, where the first configuration instruction carries target routing information of the first routing node.
[0083] As an example, assuming that the target microservice is ms1, when the deployment address of the target microservice is changed from ms1.namespace1 to namespace2 within the cluster, that is, the target microservice is migrated and deployed in the container or grid indicated by namespace2, at this time, it is only necessary to modify the target routing information of the first routing node in the cluster so that when the user traffic entering the cluster flows through the first routing node, the first routing node forwards the user traffic according to namespace2, so that the user can access the target microservice ms1.
[0084] It should be understood that this example only uses one routing node in the cluster as an example. When the cluster includes multiple routing nodes, you can refer to the routing configuration method of multiple routing nodes described below and configure the target routing information corresponding to the multiple routing nodes in the cluster in turn.
[0085] In some embodiments, at least one routing node includes a first routing node and a second routing node, and the routing configuration policy indicates that the routing configuration order of the first routing node is earlier than that of the second routing node. Based on this, the implementation process of step 203 may be: sending a first configuration instruction to the first routing node, the first configuration instruction carrying the target routing information of the first routing node; if the real-time routing information of the first routing node is the same as the target routing information, sending a second configuration instruction to the second routing node, the second configuration instruction carrying the target routing information of the second routing node.
[0086] It should be noted that the routing configuration information may be for configuring routing information for a newly added microservice, or for configuring switching routing information for the original microservice, or for deleting routing information for the original microservice. Therefore, based on different routing configuration information, the positions of the first routing node and the second routing node on the access path of the target microservice are also different. Then, according to the routing configuration strategy, the methods of configuring the target routing information for the first routing node and the second routing node in turn will also be different, which will be introduced separately below.
[0087] In the first routing configuration, the target microservice includes a newly added microservice, the first routing node is a routing node connected to the newly added microservice, and the first routing node is connected to the second routing node, and the second routing node includes a routing node between the first routing node and the root routing node that receives user traffic.
[0088] The number of second routing nodes can be one or more. When there is one second routing node, the second routing node is directly connected to the first routing node and the root routing node. When there are multiple second routing nodes, a second routing node close to the newly added microservice is connected to the first routing node, and a second routing node close to the side receiving user traffic is connected to the root routing node. There is at least one second routing node cascaded between these two second routing nodes.
[0089] Referring to Figure 3 , the routing configuration process for a newly added microservice can be as follows: first, a first configuration instruction is sent to a first routing node connected to the newly added microservice. The first configuration instruction carries the target routing information of the first routing node. If the real-time routing information of the first routing node matches the target routing information, indicating that the routing configuration of the first routing node is complete, a second configuration instruction is sent to a second routing node. The second configuration instruction carries the target routing information of the second routing node. This process continues until the real-time routing information of the second routing node matches the target routing information, completing the routing configuration of the newly added microservice.
[0090] It should be understood that Figure 3 only takes the number of second routing nodes as one, and the second routing node is the root routing node that receives user traffic as an example, and does not constitute a limitation on the number of routing nodes that can be set between the root routing node and the first routing node.
[0091] Optionally, when there are multiple second routing nodes, that is, when the second routing node includes multiple sub-routing nodes, the routing configuration policy further indicates that the routing configuration order of the first routing node connected to the newly added microservice is earlier than that of each sub-routing node, and that the routing configuration order of the sub-routing node closer to the first routing node is earlier than that of the sub-routing node closer to the root routing node. In other words, the routing configuration policy instructs that routing configuration operations be performed sequentially, "from the inside out," in the order of "first routing node connected to the newly added microservice - second routing node - root routing node."
[0092] It should be noted that "inside" refers to the side close to the newly added microservice on the access path of the newly added microservice, and "outside" refers to the side that receives user traffic, that is, the side close to the root routing node.
[0093] In the second routing configuration scenario, the target microservice includes the original microservice, and the routing configuration information indicates that the original microservice is switched from the third routing node to the first routing node. The third routing node is the routing node connected to the original microservice before the path switching, and the first routing node is the routing node connected to the original microservice after the path switching.
[0094] That is, the routing configuration information indicates that the routing information of the original microservice is changed so that user traffic is forwarded through the first routing node when the original microservice is subsequently accessed.
[0095] It should be noted that the first routing node before and after the switch may be in different clusters in the same area as the third routing node, or in different clusters in different areas. When the positional relationship between the first routing node and the third routing node is different, the routing switching method of the original microservice is also different, which will be introduced below.
[0096] In the first routing switching mode, the at least one routing node that needs to be configured for routing further includes a third routing node, and the second routing node is a routing node connected to the first routing node and the third routing node.
[0097] That is, the first routing node and the third routing node are in different clusters within the same area. A second routing node is provided in the area to route user traffic to a different cluster. The first routing node and the third routing node in different clusters both need to be connected to the second routing node.
[0098] Referring to Figure 4, within a region, when the access path of the original microservice is switched from the third routing node in cluster 2 to the first routing node in cluster 1, the switching process may be: sending a first configuration instruction to the switched first routing node, the first configuration instruction carrying the target routing information of the first routing node; if the real-time routing information of the first routing node is the same as the target routing information, indicating that the routing configuration of the first routing node is completed, then sending a second configuration instruction to the second routing node, the second configuration instruction carrying the target routing information of the second routing node, until the real-time routing information of the second routing node is the same as the target routing information, the routing configuration of the original microservice after the switch is completed.
[0099] In some embodiments, after determining that the real-time routing information of the second routing node is the same as the target routing information, a first deletion instruction may be sent to the third routing node, where the first deletion instruction instructs the third routing node to delete the routing information of the original microservice.
[0100] Among them, the first deletion instruction can carry the identifier or deployment address of the original microservice, which is not limited in this embodiment of the present application.
[0101] That is, in order to avoid storing redundant routing information on the routing nodes, after configuring the routing information of the original microservice on the first routing node and the second routing node, the routing information of the original microservice can be deleted on the third routing node.
[0102] In the second routing switching mode, the at least one routing node that needs to be configured for routing also includes a third routing node and a fourth routing node, the second routing node is a routing node connected to the first routing node, and the fourth routing node is a routing node connected to the third routing node.
[0103] That is, the first routing node and the third routing node are in different areas, and each area is equipped with routing nodes that route user traffic to different clusters. At this time, the first routing node is connected to the second routing node that receives user traffic in the corresponding area, and the third routing node is connected to the fourth routing node that receives user traffic in the corresponding area.
[0104] Referring to Figure 5, in different regions, when the access path of the original microservice is switched from the third routing node in cluster 2 of region 2 to the first routing node in cluster 1 of region 1, the switching process can be: sending a first configuration instruction to the switched first routing node, the first configuration instruction carries the target routing information of the first routing node; if the real-time routing information of the first routing node is the same as the target routing information, indicating that the routing configuration of the first routing node is completed, then sending a second configuration instruction to the second routing node, the second configuration instruction carries the target routing information of the second routing node, until the real-time routing information of the second routing node is the same as the target routing information, the routing configuration of the original microservice after the switch is completed.
[0105] In some embodiments, after determining that the real-time routing information of the second routing node is the same as the target routing information, a second deletion instruction may be sent to the fourth routing node, where the second deletion instruction instructs the fourth routing node to delete the routing information of the original microservice.
[0106] The second deletion instruction carries the identifier or deployment address of the original microservice, so that the fourth routing node can delete the routing information related to the original microservice from the routing information stored in itself based on the identifier or deployment address.
[0107] Optionally, if the real-time routing information of the fourth routing node is the same as the target routing information, the first deletion instruction may continue to be sent to the third routing node to instruct the third routing node to also delete the routing information of the original microservice.
[0108] Among them, the first deletion instruction can carry the identifier or deployment address of the original microservice, which is not limited in this embodiment of the present application.
[0109] That is, in order to avoid storing redundant routing information on each routing node, after configuring the routing information of the original microservice on the first routing node and the second routing node, the routing information of the original microservice can be deleted on the fourth routing node and the third routing node in turn.
[0110] In the third routing configuration scenario, the target microservice includes the original microservice, the routing configuration information indicates that the routing information of the original microservice is deleted, the first routing node is the root routing node that receives user traffic, and the first routing node is connected to the second routing node, and the second routing node includes the routing node between the original microservice and the first routing node.
[0111] The number of second routing nodes can be one or more. When there is one second routing node, the second routing node is directly connected to the first routing node and the original microservice. When there are multiple second routing nodes, one second routing node is directly connected to the original microservice, and there is at least one second routing node cascaded between the second routing node and the first routing node (root routing node).
[0112] Referring to Figure 6 , the route deletion process for the original microservice can be as follows: first, a first configuration instruction is sent to the first routing node that receives user traffic. The first configuration instruction carries the target routing information of the first routing node. If the real-time routing information of the first routing node matches the target routing information, indicating that the routing configuration of the first routing node is complete, a second configuration instruction is sent to the second routing node. The second configuration instruction carries the target routing information of the second routing node. This process continues until the real-time routing information of the second routing node matches the target routing information, completing the route deletion of the original microservice.
[0113] It should be understood that Figure 6 only takes the number of second routing nodes as one, and the second routing node is a routing node connected to the microservice as an example, and does not constitute a limitation on the number of routing nodes that can be set between the first routing node and the original microservice.
[0114] Optionally, when there are multiple second routing nodes, that is, when the second routing node includes multiple sub-routing nodes, the above routing configuration policy indicates that the routing configuration order of the first routing node is earlier than that of each sub-routing node, and the routing configuration order of each sub-routing node is earlier than that of the sub-routing node connected to the microservice. In other words, the route deletion operation is performed in the order of "first routing node (root routing node) - second routing node - routing node connected to the microservice" from the outside to the inside.
[0115] It should be noted that "inside" refers to the side close to the original microservice on the access path of the original microservice, and "outside" refers to the side that receives user traffic, that is, the side close to the root routing node.
[0116] Step 204: Acquire real-time routing information of at least one routing node, where the real-time routing information is current routing information of the at least one routing node.
[0117] It should be noted that during the routing configuration process, a routing node's real-time routing information can reflect the routing configuration progress of that routing node. For the same routing node, if the routing node's real-time routing information is identical to the target routing information, it indicates that the routing node has completed the routing configuration operation according to the target routing information, i.e., the target routing information has taken effect on the routing node. If the routing node's real-time routing information is identical to the target routing information, it indicates that the routing node has not yet received the target routing information or has not yet completed the routing configuration operation according to the target routing information, i.e., the target routing information has not taken effect on the routing node.
[0118] In some embodiments, step 204 may be implemented as follows: after the computing device sends the configuration instruction to the at least one routing node, the computing device may obtain real-time routing information from the at least one routing node according to a routing collection period. Alternatively, the multiple routing nodes managed by the computing device may periodically report their real-time routing information to the computing device according to a routing reporting period, so that the computing device can obtain the real-time routing information of the at least one routing node.
[0119] The route collection period and the route reporting period are arbitrary values set by the administrator. The values of the route collection period and the route reporting period can be the same or different, and the embodiment of the present application does not limit this. For example, the route collection period can be 10 seconds and the route reporting period can be 30 seconds.
[0120] Step 205: If the real-time routing information of at least one routing node is the same as the respective target routing information, it is determined that the routing configuration of the target microservice is complete.
[0121] Corresponding to step 203 above, when the at least one routing node includes a first routing node, if the real-time routing information of the first routing node is the same as the target routing information, then the routing configuration of the target microservice is determined to be complete. When the at least one routing node includes a first routing node and a second routing node, and the routing configuration policy indicates that the routing configuration order of the first routing node is earlier than that of the second routing node, if the real-time routing information of the second routing node is the same as the target routing information, then the routing configuration of the target microservice is determined to be complete.
[0122] That is, if there are multiple routing nodes, when the real-time routing information of the last routing node that receives the routing configuration instruction is the same as the corresponding target routing information, it is determined that the routing configuration of the target microservice is completed.
[0123] In summary, in an embodiment of the present application, after a computing device obtains the routing configuration information of a target microservice in a routing configuration interface, it can determine, based on the routing configuration information, at least one routing node on the access path to the target microservice, as well as the target routing information of the at least one routing node. Then, based on the target routing information of the at least one routing node, and in accordance with the routing configuration policy, a routing configuration instruction is sent to the at least one routing node to control the at least one routing node to sequentially execute routing configuration operations in the configuration order. This avoids competition among the routing configurations of multiple routing nodes, thereby improving the efficiency of routing configuration when configuring the access route to the target microservice.
[0124] In some embodiments, when implementing the above-mentioned routing configuration method, the embodiments of the present application further provide a global routing controller (GRC), which supports users (here users refer to administrators using the global routing controller) to configure 7-layer routing rules. The core components of the global routing controller include:
[0125] (1) Web console
[0126] The web console provides a web interface that administrators can operate. It supports configuring various routing rules, configuring the backend microservices pointed to by domain names, contexts, etc. (running in a cluster, and the microservices may be across clouds, regions, or availability zones), and supports allocating or changing the weight of user traffic for different backend microservices.
[0127] In a specific implementation, the web console is used to receive routing configuration information of a target microservice input by an administrator, where the routing configuration information includes the deployment address of the target microservice.
[0128] (2) Routing Configuration Service
[0129] The routing configuration service determines at least one routing node on the target microservice access path by analyzing the network topology information; and based on the administrator's routing configuration information, generates target routing information corresponding to the at least one routing node, and stores the target routing information in the final state database.
[0130] (3) Real-time information services
[0131] The real-time information service is used to collect or receive the real-time routing information of each routing node, form a real-time routing configuration, and store the real-time routing information of each routing node in a real-time database.
[0132] (4) Routing Change Engine
[0133] The routing change engine dynamically generates the next routing configuration instruction based on the state difference between the final state database and the real-time database, allowing the overall routing configuration of the system to smoothly transition to the next routing configuration state. After generating the next routing configuration instruction, the routing change engine can write the next routing configuration instruction to the change instruction database.
[0134] (5) Change Instruction Service
[0135] The change instruction service obtains routing configuration instructions from the change instruction database and provides aggregated discovery services (ADS) in the form of remote procedure calls, so that each routing node can update routing information incrementally and losslessly to complete the routing configuration in sequence.
[0136] It should be noted that the final state database, real-time database and change instruction database can be three independently deployed databases, or can be merged into one database, which is not limited in the embodiment of the present application.
[0137] Taking the secondary associated routing node as an example, the process of implementing multi-node routing configuration and management by the global routing controller is explained.
[0138] As shown in Figure 7, assume that the business plane has two external routing nodes deployed: routing node A and routing node B, and three internal routing nodes: routing node C, routing node D, and routing node E. Routing node C is a routing node in the first cluster, routing node D is a routing node in the second cluster, and routing node E is a routing node in the third cluster. Each of these clusters has a microservice deployed. The global routing controller operates on the management plane, and users accessing the business plane are unaware of the routing configuration in the management plane.
[0139] Based on this, the global routing controller manages routing nodes A, B, C, D, and E. The process of implementing global routing management and configuration includes the following steps:
[0140] S1: The administrator enters the routing configuration information of the target microservice through the web console of the global routing controller.
[0141] S2: The routing configuration service generates target routing information of at least one routing node on the access path of the target microservice based on the routing configuration information, and stores the target routing information of the at least one routing node in the final state database.
[0142] S3: The routing change engine obtains the real-time routing information and target routing information of the at least one routing node from the final state database and the real-time database respectively, generates the next routing configuration instruction according to the routing configuration policy, and stores the next routing configuration instruction in the change instruction database.
[0143] The routing configuration policy indicates the routing configuration order of the at least one routing node, and the next routing configuration instruction carries routing information of the routing node that is determined to perform the routing configuration operation next based on the routing configuration order indicated by the routing configuration policy.
[0144] S4: The change instruction service obtains the routing configuration instruction from the change instruction database and provides an ADS service of remote procedure call that can be recognized by the routing node, so that the corresponding routing node can obtain the routing configuration instruction to perform the routing configuration operation.
[0145] S5: The at least one routing node incrementally obtains the routing configuration instruction to be executed currently from the change instruction service, and executes the routing configuration instruction to make it effective, thereby forming new routing information.
[0146] S6: During the above process, the at least one routing node continuously / periodically reports its own real-time routing information to the real-time information service, and the real-time information service writes the real-time routing information of the at least one routing node into the real-time database.
[0147] S7: Execute the above steps S3-S7 in a loop until the target routing information of each routing node in the at least one routing node on the access path of the target microservice is consistent with the corresponding real-time routing information in the real-time database, and the routing configuration of the target microservice is completed.
[0148] In the above process, routing node A, routing node B, routing node C, routing node D and routing node E can all communicate with the real-time information service to report their own real-time routing information; they can also interact with the change instruction service to obtain the routing configuration instructions they need to execute.
[0149] It should be understood that in the above process, the routing configuration information of the target microservice is different, and the routing nodes existing on the access path of the target microservice are also different, but the logic for implementing multi-node routing configuration is similar. You can refer to the implementation process of the above embodiment and will not repeat it here.
[0150] Figure 8 is a schematic diagram of the structure of a routing configuration device provided in an embodiment of the present application. The routing configuration device can be implemented as part or all of a computing device using software, hardware, or a combination of both. Referring to Figure 8 , the routing configuration device 800 includes: an information acquisition module 801, a routing determination module 802, a routing configuration module 803, a routing acquisition module 804, and a determination module 805.
[0151] The information acquisition module 801 is used to provide a routing configuration interface, which is used to obtain routing configuration information of the target microservice. The routing configuration information includes the deployment address of the target microservice and the existence of at least one routing node on the access path of the target microservice.
[0152] The routing determination module 802 is configured to determine target routing information of at least one routing node based on the routing configuration information, where the target routing information is routing information of at least one routing node when a target microservice can be accessed through the at least one routing node.
[0153] A routing configuration module 803 is configured to send a routing configuration instruction to at least one routing node based on target routing information of at least one routing node and in accordance with a routing configuration policy, where the routing configuration policy indicates a routing configuration order for the at least one routing node;
[0154] The routing acquisition module 804 is used to acquire real-time routing information of at least one routing node, where the real-time routing information is the current routing information of at least one routing node;
[0155] The determination module 805 is configured to determine that the routing configuration of the target microservice is complete if the real-time routing information of at least one routing node is the same as the respective target routing information.
[0156] The information acquisition module, route determination module, route configuration module, route acquisition module, and determination module can all be implemented via software or hardware. By way of example, the implementation of the route configuration module will be described below using the route configuration module as an example. Similarly, the implementation of the information acquisition module, route determination module, route acquisition module, and determination module can refer to the implementation of the route configuration module.
[0157] As an example of a software functional unit, a routing configuration module may include code running on a computing instance. The computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Furthermore, the computing instance may be one or more. For example, the routing configuration module may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code may be distributed in the same region (Region) or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including one data center or multiple geographically close data centers. Typically, a region may include multiple AZs.
[0158] Similarly, multiple hosts / virtual machines / containers running the code can be distributed within the same virtual private cloud (VPC) or across multiple VPCs. Typically, a VPC is set up within a region. Inter-region communication between two VPCs within the same region, or between VPCs in different regions, requires a communication gateway within each VPC to interconnect the VPCs.
[0159] As an example of a hardware functional unit, the routing configuration module may include at least one computing device, such as a server. Alternatively, the routing configuration module may be implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0160] The multiple computing devices included in the routing configuration module can be distributed in the same zone or in different zones. The multiple computing devices included in the routing configuration module can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the routing configuration module can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of servers, ASICs, PLDs, CPLDs, FPGAs, GALs, and other computing devices.
[0161] It should be noted that, in other embodiments, the routing configuration module can be used to execute any step in the routing configuration method, the information acquisition module can be used to execute any step in the routing configuration method, and similarly, the routing determination module, the routing acquisition module, and the determination module can also be used to execute any step in the routing configuration method. That is, the steps that the information acquisition module, the routing determination module, the routing configuration module, the routing acquisition module, and the determination module are responsible for implementing can be specified as needed, and the full functionality of the routing configuration device can be achieved by having the information acquisition module, the routing determination module, the routing configuration module, the routing acquisition module, and the determination module each implement different steps in the routing configuration method.
[0162] Optionally, the at least one routing node includes a first routing node and a second routing node, and the routing configuration policy indicates that the routing configuration order of the first routing node is earlier than that of the second routing node;
[0163] The routing configuration module 803 includes:
[0164] A first configuration unit is configured to send a first configuration instruction to the first routing node, where the first configuration instruction carries target routing information of the first routing node;
[0165] a second configuration unit, configured to send a second configuration instruction to the second routing node if the real-time routing information of the first routing node is the same as the target routing information, the second configuration instruction carrying the target routing information of the second routing node;
[0166] The determination module 805 is specifically configured to:
[0167] If the real-time routing information of the second routing node is the same as the target routing information, it is determined that the routing configuration of the target microservice is complete.
[0168] Optionally, the target microservice includes a newly added microservice, the first routing node is a routing node connected to the newly added microservice, and the first routing node is connected to the second routing node, and the second routing node includes a routing node between the first routing node and the root routing node that receives user traffic.
[0169] Optionally, the target microservice includes the original microservice, and the routing configuration information indicates that the original microservice is switched from the third routing node to the first routing node, where the third routing node is the routing node connected to the original microservice before the switch, and the first routing node is the routing node connected to the original microservice after the switch.
[0170] Optionally, the at least one routing node further includes a third routing node, and the second routing node is a routing node connected to the first routing node and the third routing node; if the real-time routing information of the second routing node is the same as the target routing information, the apparatus 800 further includes:
[0171] The routing deletion module is used to send a first deletion instruction to the third routing node, where the first deletion instruction instructs the third routing node to delete the routing information of the original microservice.
[0172] Optionally, the at least one routing node further includes a third routing node and a fourth routing node, the second routing node is a routing node connected to the first routing node, and the fourth routing node is a routing node connected to the third routing node; if the real-time routing information of the second routing node is the same as the target routing information, the apparatus 800 further includes:
[0173] The routing deletion module is used to send a second deletion instruction to the fourth routing node, where the second deletion instruction instructs the fourth routing node to delete the routing information of the original microservice.
[0174] Optionally, the target microservice includes the original microservice, the routing configuration information indicates that the routing information of the original microservice is deleted, the first routing node is the root routing node that receives user traffic, and the first routing node is connected to the second routing node, and the second routing node includes a routing node between the original microservice and the first routing node.
[0175] Optionally, the routing configuration information further includes one or more of a domain name, context information, and an identifier of the target microservice, wherein the domain name indicates the network area to which the target microservice belongs, and the context information indicates the cluster to which the target microservice belongs.
[0176] Optionally, at least one routing node includes one or more of a load balancing gateway, a proxy server, an Ingress gateway, and a Gateway gateway.
[0177] In an embodiment of the present application, a routing configuration device determines, based on the routing configuration information, at least one routing node on the access path to the target microservice, as well as the target routing information for the at least one routing node. Then, based on the target routing information of the at least one routing node and in accordance with a routing configuration policy, a routing configuration instruction is sent to the at least one routing node to control the at least one routing node to sequentially execute routing configuration operations in the configuration order. This avoids contention among the routing configurations of multiple routing nodes, thereby improving routing configuration efficiency when configuring the access route to the target microservice.
[0178] It should be noted that the routing configuration device provided in the above embodiment, when configuring routing information on at least one routing node, uses the division of the above functional modules as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the routing configuration device provided in the above embodiment and the routing configuration method embodiment are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0179] Please refer to Figure 9, which is a schematic diagram of the structure of a computing device provided in an embodiment of the present application. The computing device 100 includes a bus 102, a processor 104, a memory 106, and a communication interface 108. The processor 104, the memory 106, and the communication interface 108 communicate with each other via the bus 102. The embodiment of the present application does not limit the number of processors and memories in the computing device 100.
[0180] When implementing the technical solution provided in the embodiment of the present application, the computing device 100 can act as a global routing controller to manage routing information on at least one routing node.
[0181] Bus 102 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, among others. Buses may be classified as address buses, data buses, control buses, and the like. For ease of illustration, FIG9 illustrates a single bus line, but this does not imply a single bus or type of bus. Bus 102 may include a path for transmitting information between various components of computing device 100 (e.g., memory 106, processor 104, and communication interface 108).
[0182] The processor 104 may include any one or more processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0183] The memory 106 may include volatile memory, such as random access memory (RAM). The processor 104 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).
[0184] Memory 106 stores executable program code, and processor 104 executes the executable program code to implement the functions of the aforementioned information acquisition module, route determination module, route configuration module, route acquisition module, and determination module, thereby implementing the routing configuration method. In other words, memory 106 stores instructions for executing the routing configuration method.
[0185] The communication interface 108 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 100 and other devices or a communication network.
[0186] Embodiments of the present application also provide a computing device cluster. The computing device cluster includes at least one computing device. The computing device can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop computer, a laptop computer, or a smartphone.
[0187] As shown in Figure 10, the computing device cluster includes at least one computing device 100. The memory 106 in one or more computing devices 100 in the computing device cluster may store the same instructions for executing the routing configuration method.
[0188] In some possible implementations, the memory 106 of one or more computing devices 100 in the computing device cluster may also store some instructions for executing the routing configuration method. In other words, the combination of one or more computing devices 100 can jointly execute the instructions for executing the routing configuration method.
[0189] It should be noted that the memory 106 in different computing devices 100 in the computing device cluster can store different instructions, each for executing part of the functions of the routing configuration apparatus. In other words, the instructions stored in the memory 106 in different computing devices 100 can implement the functions of one or more of the information acquisition module, the routing determination module, the routing configuration module, the routing acquisition module, and the determination module.
[0190] In some possible implementations, one or more computing devices in a computing device cluster may be connected via a network. The network may be a wide area network (WAN) or a local area network (LAN), etc. FIG11 illustrates a possible implementation. As shown in FIG11 , two computing devices 100A and 100B are connected via a network. Specifically, the network is connected via a communication interface in each computing device. In this type of possible implementation, the memory 106 in the computing device 100A stores instructions for executing the functions of the information acquisition module, the route determination module, and the route acquisition module. Simultaneously, the memory 106 in the computing device 100B stores instructions for executing the functions of the route configuration module and the determination module.
[0191] The connection method between the computing device clusters shown in Figure 11 can be based on the fact that the routing configuration method provided in this application needs to store real-time routing information and target routing information. Therefore, it is considered to entrust the functions implemented by the routing configuration module and the determination module to the computing device 100B for execution.
[0192] It should be understood that the functions of the computing device 100A shown in FIG11 may also be completed by multiple computing devices 100. Similarly, the functions of the computing device 100B may also be completed by multiple computing devices 100.
[0193] The present application also provides another computing device cluster. The connection relationship between the computing devices in this computing device cluster can be similar to the connection methods of the computing device clusters shown in Figures 10 and 11. However, the memory 106 in one or more computing devices 100 in this computing device cluster can store the same instructions for executing the routing configuration method.
[0194] In some possible implementations, the memory 106 of one or more computing devices 100 in the computing device cluster may also store some instructions for executing the routing configuration method. In other words, the combination of one or more computing devices 100 can jointly execute the instructions for executing the routing configuration method.
[0195] The present application also provides a computer program product including instructions. This computer program product can be software or a program product including instructions that can be run on a computing device or stored in any available medium. When the computer program product is run on at least one computing device, it causes the at least one computing device to execute the routing configuration method shown in FIG. 2 .
[0196] The present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center that contains one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive). The computer-readable storage medium includes instructions that instruct the computing device to execute the routing configuration method shown in FIG. 2 above.
[0197] It should be understood that the "plurality" mentioned herein refers to two or more. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is merely a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in order to facilitate a clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. Those skilled in the art will understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit them to be different.
[0198] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in the embodiments of this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with the relevant laws, regulations and standards of relevant countries and regions.
[0199] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the protection scope of the technical solutions of the embodiments of the present application.
Claims
1. A routing configuration method, characterized in that: The method comprises: Provide a routing configuration interface, the routing configuration interface is used to obtain routing configuration information of the target microservice, the routing configuration information includes the deployment address of the target microservice, and there is at least one routing node on the access path of the target microservice; Determine target routing information of the at least one routing node based on the routing configuration information, where the target routing information is routing information of the at least one routing node when the target microservice can be accessed through the at least one routing node; Based on the target routing information of the at least one routing node, sending a routing configuration instruction to the at least one routing node according to a routing configuration policy, wherein the routing configuration policy indicates a routing configuration order of the at least one routing node; Acquire real-time routing information of the at least one routing node, where the real-time routing information is current routing information of the at least one routing node; If the real-time routing information of the at least one routing node is the same as the respective target routing information, it is determined that the routing configuration of the target microservice is completed.
2. The method according to claim 1, characterized in that The at least one routing node includes a first routing node and a second routing node, and the routing configuration policy indicates that the routing configuration order of the first routing node is earlier than that of the second routing node; The sending a routing configuration instruction to the at least one routing node based on the target routing information of the at least one routing node and in accordance with the routing configuration policy comprises: Sending a first configuration instruction to the first routing node, where the first configuration instruction carries target routing information of the first routing node; If the real-time routing information of the first routing node is the same as the target routing information, sending a second configuration instruction to the second routing node, where the second configuration instruction carries the target routing information of the second routing node; If the real-time routing information of the at least one routing node is the same as the respective target routing information, determining that the routing configuration of the target microservice is completed includes: If the real-time routing information of the second routing node is the same as the target routing information, it is determined that the routing configuration of the target microservice is completed.
3. The method according to claim 2, characterized in that The target microservice includes a newly added microservice, the first routing node is a routing node connected to the newly added microservice, and the first routing node is connected to the second routing node, and the second routing node includes a routing node between the first routing node and a root routing node that receives user traffic.
4. The method according to claim 2, characterized in that The target microservice includes an original microservice, and the routing configuration information indicates that the original microservice is switched from a third routing node to the first routing node, the third routing node is a routing node connected to the original microservice before the switching, and the first routing node is a routing node connected to the original microservice after the switching.
5. The method according to claim 4, characterized in that The at least one routing node further includes the third routing node, and the second routing node is a routing node connected to the first routing node and the third routing node; if the real-time routing information of the second routing node is the same as the target routing information, the method further includes: A first deletion instruction is sent to the third routing node, where the first deletion instruction instructs the third routing node to delete the routing information of the original microservice.
6. The method according to claim 4, characterized in that The at least one routing node further includes the third routing node and the fourth routing node, the second routing node is a routing node connected to the first routing node, and the fourth routing node is a routing node connected to the third routing node; if the real-time routing information of the second routing node is the same as the target routing information, the method further includes: A second deletion instruction is sent to the fourth routing node, where the second deletion instruction instructs the fourth routing node to delete the routing information of the original microservice.
7. The method according to claim 2, characterized in that The target microservice includes an original microservice, the routing configuration information indicates deleting routing information of the original microservice, the first routing node is a root routing node for receiving user traffic, and the first routing node is connected to the second routing node, and the second routing node includes a routing node between the original microservice and the first routing node.
8. The method according to any one of claims 1 to 7, characterized in that: The routing configuration information also includes one or more of a domain name, context information, and an identifier of the target microservice, wherein the domain name indicates a network area to which the target microservice belongs, and the context information indicates a cluster to which the target microservice belongs.
9. The method according to any one of claims 1 to 8, characterized in that The at least one routing node includes one or more of a load balancing gateway, a proxy server, an Ingress gateway, and a Gateway gateway.
10. A routing configuration device, characterized in that: The device comprises: An information acquisition module, used to provide a routing configuration interface, wherein the routing configuration interface is used to obtain routing configuration information of a target microservice, wherein the routing configuration information includes a deployment address of the target microservice, and there is at least one routing node on an access path of the target microservice; A routing determination module, configured to determine target routing information of the at least one routing node based on the routing configuration information, wherein the target routing information is routing information of the at least one routing node when the target microservice can be accessed through the at least one routing node; a routing configuration module, configured to send a routing configuration instruction to the at least one routing node based on the target routing information of the at least one routing node and in accordance with a routing configuration policy, wherein the routing configuration policy indicates a routing configuration order of the at least one routing node; A routing acquisition module, used to acquire real-time routing information of the at least one routing node, wherein the real-time routing information is current routing information of the at least one routing node; The determination module is used to determine that the routing configuration of the target microservice is completed if the real-time routing information of the at least one routing node is the same as the respective target routing information.
11. The device according to claim 10, characterized in that The at least one routing node includes a first routing node and a second routing node, and the routing configuration policy indicates that the routing configuration order of the first routing node is earlier than that of the second routing node; The routing configuration module includes: A first configuration unit, configured to send a first configuration instruction to the first routing node, where the first configuration instruction carries target routing information of the first routing node; a second configuration unit, configured to send a second configuration instruction to the second routing node if the real-time routing information of the first routing node is the same as the target routing information, wherein the second configuration instruction carries the target routing information of the second routing node; The determination module is specifically used for: If the real-time routing information of the second routing node is the same as the target routing information, it is determined that the routing configuration of the target microservice is completed.
12. The device according to claim 11, characterized in that The target microservice includes a newly added microservice, the first routing node is a routing node connected to the newly added microservice, and the first routing node is connected to the second routing node, and the second routing node includes a routing node between the first routing node and a root routing node that receives user traffic.
13. The device according to claim 11, characterized in that The target microservice includes an original microservice, and the routing configuration information indicates that the original microservice is switched from a third routing node to the first routing node, the third routing node is a routing node connected to the original microservice before the switching, and the first routing node is a routing node connected to the original microservice after the switching.
14. The device according to claim 13, characterized in that The at least one routing node further includes the third routing node, and the second routing node is a routing node connected to the first routing node and the third routing node; if the real-time routing information of the second routing node is the same as the target routing information, the device further includes: The routing deletion module is used to send a first deletion instruction to the third routing node, where the first deletion instruction instructs the third routing node to delete the routing information of the original microservice.
15. The device according to claim 13, characterized in that The at least one routing node further includes the third routing node and the fourth routing node, the second routing node is a routing node connected to the first routing node, and the fourth routing node is a routing node connected to the third routing node; if the real-time routing information of the second routing node is the same as the target routing information, the device further includes: The routing deletion module is used to send a second deletion instruction to the fourth routing node, where the second deletion instruction instructs the fourth routing node to delete the routing information of the original microservice.
16. The device according to claim 11, characterized in that The target microservice includes an original microservice, the routing configuration information indicates deleting routing information of the original microservice, the first routing node is a root routing node for receiving user traffic, and the first routing node is connected to the second routing node, and the second routing node includes a routing node between the original microservice and the first routing node.
17. The device according to any one of claims 10 to 16, characterized in that The routing configuration information also includes one or more of a domain name, context information, and an identifier of the target microservice, wherein the domain name indicates a network area to which the target microservice belongs, and the context information indicates a cluster to which the target microservice belongs.
18. The device according to any one of claims 10 to 17, characterized in that The at least one routing node includes one or more of a load balancing gateway, a proxy server, an Ingress gateway, and a Gateway gateway.
19. A computing device cluster, characterized in that: The computing device cluster includes at least one computing device, each of which includes a processor and a memory; The processor of the at least one computing device is used to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the routing configuration method according to any one of claims 1 to 9.
20. A computer-readable storage medium, characterized in that: The method comprises computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster executes the routing configuration method according to any one of claims 1 to 9.
21. A computer program product comprising instructions, characterized in that When the instruction is executed by a computing device cluster, the computing device cluster executes the routing configuration method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Route configuration method and device, equipment, storage medium and computer program
CN119728516A
Micro-service processing method and device based on routing, computer equipment and medium
CN112965700A
Route configuration method, network equipment, communication system and storage medium
CN114363735A
Multi-hop data transmission method and apparatus
US20210185750A1
CN202311287924A