Route configuration method and device, equipment, storage medium and computer program
By obtaining the routing configuration information of the target microservice in the routing configuration interface and sending 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 configuration efficiency is improved and the availability of microservices is ensured.
Patent Information
- Application Number
- CN202311680905.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-09-28
- Filing Date
- 2023-12-07
- Publication Date
- 2025-03-28
AI Technical Summary
Under the K8s containerized microservice architecture, the routing configuration of multiple routing nodes is inefficient 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 target routing information, and sends configuration instructions to the routing nodes 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 CN119728516A_ABST
Abstract
Description
[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”, 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, device, equipment, storage medium and computer program. Background Art
[0003] In the microservice architecture based on K8s containerization, the scheduling and load balancing of business traffic are generally completed by the collaboration of internal and external routing nodes. Among them, the external routing node is responsible for forwarding user traffic to the corresponding K8s cluster, and the internal routing node is responsible for forwarding user traffic flowing into the K8s cluster to the corresponding microservice.
[0004] In the related art, when configuring the service access route of a certain 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 based on the K8s cluster to which the microservice belongs, and determines the external routing node corresponding to the region based on the network region (Region) to which the K8s cluster belongs, and then 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. Summary of the invention
[0006] The present application provides a routing configuration method, apparatus, device, storage medium and computer program, which can improve the configuration efficiency when configuring multiple routing nodes. The technical solution is as follows.
[0007] In a first aspect, a routing configuration method is provided, the method comprising:
[0008] 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 an 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 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 strategy, wherein the routing configuration strategy 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 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 completed.
[0009] 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 according to the routing configuration information. Then, based on the target routing information of the at least one routing node, according to the routing configuration strategy, a routing configuration instruction is sent to the at least one routing node to control the at least one routing node to perform the routing configuration operations in sequence according to the configuration order. In this way, the competition conditions for the routing configuration of multiple routing nodes to take effect are avoided, thereby improving the routing configuration efficiency when configuring the target microservice access route.
[0010] 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 routing configuration instructions 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 their 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.
[0011] That is, the present 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, thereby ensuring that the routing configuration of multiple routing nodes takes effect without competition conditions.
[0012] 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 a root routing node that receives user traffic.
[0013] That is, when configuring the access route of the 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.
[0014] 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 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.
[0015] Optionally, the at least one routing node also 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 also includes: sending a first deletion instruction to the third routing node, and the first deletion instruction instructs the third routing node to delete the routing information of the original microservice.
[0016] That is, when the access route of the original microservice is switched between different clusters, the routing information of at least one routing node on the original microservice access path after the switch is configured first, and then the routing information of the relevant routing nodes on the original microservice access path before the switch is deleted.
[0017] Optionally, the at least one routing node also 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 also 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.
[0018] That is, when the access route of the original microservice is switched between different regions, the routing information of at least one routing node on the original microservice access path after the switch is configured first, and then the routing information of the relevant routing nodes on the original microservice access path before the switch is deleted.
[0019] 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.
[0020] That is, when deleting the access route of the original microservice, the routing information of the original microservice on the root routing node can be directly deleted. Of course, after deleting the routing information of the original microservice on the root routing node, the routing information of the next routing node can be configured in sequence, and finally the routing information on the routing node connected to the original microservice can be deleted.
[0021] Optionally, 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.
[0022] 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.
[0023] In a second aspect, a routing configuration device is provided, wherein the routing configuration device has the function of implementing the routing configuration method in the first aspect. The routing configuration device includes at least one module, and the at least one module is used to implement the routing configuration method provided in the first aspect.
[0024] In a third aspect, a computing device cluster is provided, the computing device cluster comprising at least one computing device, each computing device comprising a processor and a memory;
[0025] 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.
[0026] 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.
[0027] 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.
[0028] The technical effects obtained by the above-mentioned second, third, fourth and fifth aspects are similar to the technical effects obtained by the corresponding technical means in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 This is a schematic diagram of scheduling user traffic under a microservice architecture provided in an embodiment of the present application;
[0030] Figure 2 It is a flowchart of a routing configuration method provided in an embodiment of the present application;
[0031] Figure 3 This is a schematic diagram of a routing configuration for a newly added microservice provided in an embodiment of the present application;
[0032] Figure 4 This is a schematic diagram of routing switching of an original microservice provided in an embodiment of the present application;
[0033] Figure 5 This is a schematic diagram of routing switching of another original microservice provided in an embodiment of the present application;
[0034] Figure 6 This is a schematic diagram of route deletion of an original microservice provided in an embodiment of the present application;
[0035] Figure 7 It is a logical schematic diagram of a global routing controller performing routing configuration of multiple cascade routing nodes provided by an embodiment of the present application;
[0036] Figure 8 It is a structural diagram of a routing configuration device provided in an embodiment of the present application;
[0037] Fig. 9 is a schematic diagram of the structure of a computing device provided in an embodiment of the present application;
[0038] Fig.10 is a schematic diagram of the structure of a computing device cluster provided in an embodiment of the present application;
[0039] Fig.11 It is a schematic diagram of the network connection relationship of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0040] 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 in conjunction with the accompanying drawings.
[0041] 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.
[0042] First, the professional terms involved in the embodiments of the present application are introduced.
[0043] 1. Load balancing (LB)
[0044] 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 in order to optimize resource use, maximize throughput, minimize response time, and avoid overload.
[0045] 2. Elastic load balancing (ELB)
[0046] A traffic scheduling service that distributes access requests to multiple elastic servers at the back end according to forwarding rules. It can expand the external service capabilities of the application system through traffic distribution and improve the fault tolerance of the application.
[0047] 3. Disaster Recovery
[0048] Two or more systems with the same functions are established in two geographically distant locations. The health status of these systems can be monitored or functions can be switched. When one of the systems stops working due to an accident (such as fire, earthquake, etc.), the application can be switched to another system for operation.
[0049] 4. Region
[0050] Based on the geographical location, the set of infrastructure services in a region can be called a region. For example, servers in City A and Province B can be called servers in Region A and servers in Region B respectively.
[0051] 5. Availability zone (AZ)
[0052] A region is usually composed of multiple AZs, and an AZ is usually composed of multiple data centers. Two AZs are designed to be independent of each other. They have independent power supply systems, independent networks, etc. If one AZ fails, it will not affect the normal operation of the other AZ.
[0053] 6. Kubernetes (K8s for short)
[0054] K8s is an open source container orchestration engine from Google that supports automated deployment, large-scale scalability, and containerized application management. When deploying an application in a production environment, you usually need to deploy multiple instances of the application to load balance application requests. In K8s, you can create multiple containers, each of which runs an application instance, and then use the built-in load balancing strategy to manage, discover, and access this group of application instances, without requiring the operation and maintenance personnel to perform complex manual configuration and processing for these details.
[0055] 7. Istio
[0056] 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 also supports how these microservices communicate and share data with each other.
[0057] 8. Intelligent Proxy (Envoy)
[0058] An L7 proxy and communication bus designed for large modern service architectures, with 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, etc.
[0059] Next, the application scenarios of the routing configuration method provided in the embodiments of the present application are introduced.
[0060] See also Figure 1 In the microservice deployment architecture shown, the scheduling and load balancing of business traffic are 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.
[0061] See also 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.
[0062] It should be noted that Figure 1 Taking the example of associating an external routing node with an internal routing node of a cluster and deploying two microservices in the cluster as an example, it does not constitute a limitation 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.
[0063] 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.
[0064] Moreover, since configuring the routing information of multiple routing nodes is an asynchronous operation, there is a conditional competition for the routing configuration of multiple cascaded routing nodes to take effect, which may cause the microservice to be unavailable. For example, when the target microservice is a newly added microservice, if the routing configuration of the external routing node takes effect before the routing configuration of the internal routing node takes effect, when the external routing node routes user traffic to the internal routing node according to the configured routing information, the internal routing node cannot route user traffic to the corresponding microservice according to the configured routing information because the routing configuration has not yet taken effect, resulting in microservice access failure.
[0065] 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.
[0066] See also Figure 2 , Figure 2 This is a flowchart of a routing configuration method provided in an embodiment of the present application, which is applied to any computing device or computing device cluster. The method includes the following steps.
[0067] Step 201: Provide a routing configuration interface, which 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.
[0068] The routing configuration interface is used for 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.
[0069] In some embodiments, the routing configuration information is used to indicate the routing configuration operation of the target microservice, and the routing configuration information may include configuring the routing information of the target microservice, changing the routing information of the target microservice, and deleting the routing information of the target microservice.
[0070] 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, the context information indicates the cluster to which the target microservice belongs, and the identifier may be the number of the target microservice.
[0071] 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 in the cluster.
[0072] After determining the deployment address of the target microservice based on the routing configuration information, the computing device obtains network topology information, and determines at least one routing node on the access path of the target microservice based on the network topology information and the deployment address of the target microservice. The network topology information includes routing relationships between multiple routing nodes and multiple microservices in the microservice architecture.
[0073] In some embodiments, at least one routing node existing 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.
[0074] Among them, the load balancing gateway and proxy server 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, an Envoy instance, a Kong instance, etc. The Ingress gateway and the 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.
[0075] 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.
[0076] Step 202: Based on the routing configuration information, determine the target routing information of at least one routing node, where 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.
[0077] Among them, the target routing information of the routing node includes the node address of the routing node cascaded by 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 by the routing node.
[0078] 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, and 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.
[0079] When the access path of the target microservice includes multiple cascaded routing nodes, that is, the number of nodes of the at least one routing node is multiple, the multiple cascaded routing nodes will route the user traffic to the target microservice in sequence. At this time, the target routing information of the multiple routing nodes includes the address of the next routing node in the cascade, or the deployment address of the target microservice. Among them, the target routing information of the root routing node that receives the user traffic is the address of the next routing node in the cascade, and the target routing information of the routing node connected to the target microservice is the deployment address of the target microservice.
[0080] Step 203: Based on the target routing information of 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 of the at least one routing node.
[0081] 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.
[0082] 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 in the cluster, that is, the target microservice is migrated and deployed in the container or grid indicated by namespace2, at this time, you only need 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.
[0083] 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 the following multiple routing nodes to configure the target routing information corresponding to the multiple routing nodes in the cluster in turn.
[0084] 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 can be: sending a first configuration instruction to the 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, sending a second configuration instruction to the second routing node, the second configuration instruction carries the target routing information of the second routing node.
[0085] 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, the methods of configuring the target routing information for the first routing node and the second routing node in turn according to the routing configuration strategy will also be different, which will be introduced separately below.
[0086] 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 a root routing node that receives user traffic.
[0087] The number of second routing nodes can be one or more. When the number of second routing nodes is one, the second routing node is directly connected to the first routing node and the root routing node; when the number of second routing nodes is more than one, 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, and there is at least one second routing node cascaded in sequence between the two second routing nodes.
[0088] See also Figure 3 , the routing configuration process of the newly added microservice can be as follows: first send a first configuration instruction to the 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 is the same as the target routing information, it means that the routing configuration of the first routing node is completed, then send 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, then the routing configuration of the newly added microservice is completed.
[0089] It should be understood that Figure 3 The example in which the number of second routing nodes is one and the second routing node is a root routing node that receives user traffic is taken only 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.
[0090] Optionally, when there are multiple second routing nodes, that is, the second routing node includes multiple sub-routing nodes, the above routing configuration strategy also 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 the routing configuration order of the sub-routing node close to the first routing node among each sub-routing node is earlier than that of the sub-routing node close to the root routing node. That is, the routing configuration strategy indicates that the routing configuration operation is performed in sequence "from the inside to the outside" in the order of "the first routing node connected to the newly added microservice - the second routing node - the root routing node".
[0091] 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.
[0092] In the second routing configuration situation, 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.
[0093] That is, the routing configuration information indicates that the routing information of the original microservice is changed so that the user traffic is forwarded through the first routing node when the original microservice is subsequently accessed.
[0094] It should be noted that the first routing node before and after the switching may be in different clusters in the same area as the third routing node, or may be 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.
[0095] 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.
[0096] That is, the first routing node and the third routing node are in different clusters in 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.
[0097] See also Figure 4In 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, 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.
[0098] 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 also be sent to the third routing node, the first deletion instruction instructing the third routing node to delete the routing information of the original microservice.
[0099] 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.
[0100] 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.
[0101] 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.
[0102] 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.
[0103] See also Figure 5In 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 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, 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.
[0104] 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 also be sent to the fourth routing node, the second deletion instruction instructing the fourth routing node to delete the routing information of the original microservice.
[0105] 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.
[0106] 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.
[0107] 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.
[0108] 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.
[0109] In the third routing configuration situation, the target microservice includes the original microservice, the routing configuration information indicates to delete the routing information of the original microservice, the first routing node is the 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 the routing node between the original microservice and the first routing node.
[0110] The number of the second routing nodes can be one or more. When the number of the second routing nodes is one, the second routing node is directly connected to the first routing node and the original microservice; when the number of the second routing nodes is more than one, one second routing node is directly connected to the original microservice, and there is at least one second routing node cascaded in sequence between the second routing node and the first routing node (root routing node).
[0111] See also Figure 6 , the route deletion process of the original microservice can be as follows: first, a first configuration instruction is sent to the first routing node that receives user traffic, and 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, it means that the routing configuration of the first routing node is completed, and then a second configuration instruction is sent to the second routing node, and 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 route deletion of the original microservice is completed.
[0112] It should be understood that Figure 6 The example in which the number of the second routing node is one and the second routing node is a routing node connected to the microservice is taken only 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.
[0113] Optionally, when there are multiple second routing nodes, that is, the second routing node includes multiple sub-routing nodes, the above routing configuration strategy 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. That is, the routing deletion operation is performed in sequence "from the outside to the inside" in the order of "first routing node (root routing node) - second routing node - routing node connected to the microservice".
[0114] 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.
[0115] 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.
[0116] It should be noted that during the routing configuration process, the real-time routing information of the routing node can reflect the routing configuration progress of the routing node. For the same routing node, if the real-time routing information of the routing node is the same as the target routing information, it means that the routing node has completed the routing configuration operation according to the target routing information, that is, the target routing information has taken effect on the routing node. If the real-time routing information of the routing node is the same as the target routing information, it means that the routing node has not received the target routing information, or has not completed the routing configuration operation according to the target routing information, that is, the target routing information has not taken effect on the routing node.
[0117] In some embodiments, the implementation process of step 204 may be: after the computing device sends the configuration instruction to the at least one routing node, the computing device obtains the real-time routing information from the at least one routing node according to the routing collection cycle. Alternatively, the multiple routing nodes managed by the computing device periodically report their own real-time routing information to the computing device according to the routing reporting cycle, so that the computing device can obtain the real-time routing information of the at least one routing node.
[0118] The route collection period and the route reporting period are arbitrary values set by the administrator, and 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.
[0119] 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 completed.
[0120] Corresponding to the above step 203, 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, it is determined that the routing configuration of the target microservice is completed. 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, it is determined that the routing configuration of the target microservice is completed.
[0121] That is, if the number of nodes of at least one routing node is multiple, 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.
[0122] In summary, in the embodiment of the present application, after the computing device 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 according to the routing configuration information. Then, based on the target routing information of the at least one routing node, according to the routing configuration strategy, a routing configuration instruction is sent to the at least one routing node to control the at least one routing node to perform the routing configuration operation in sequence according to the configuration order, so as to avoid the conditional competition of the routing configuration of multiple routing nodes to take effect, thereby improving the routing configuration efficiency when configuring the access route of the target microservice.
[0123] In some embodiments, when implementing the above-mentioned routing configuration method, the present application also provides a global routing controller (global route controller, GRC), which supports users (the user here refers to the administrator using the global routing controller) to configure 7-layer routing rules. The core components of the global routing controller include:
[0124] (1) Web Console
[0125] The web console provides a web interface that administrators can operate. It supports the configuration of various routing rules, the configuration of the backend-pointing microservices (running in a cluster, and the microservices may be across clouds, regions, or availability zones) for domain names, contexts, etc., and supports the allocation or change of user traffic weights for different backend microservices.
[0126] 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 a deployment address of the target microservice.
[0127] (2) Routing Configuration Service
[0128] 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.
[0129] (3) Real-time information service
[0130] 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.
[0131] (4) Routing Change Engine
[0132] The routing change engine dynamically generates the next routing configuration instruction based on the status gap between the final state database and the real-time database, so that the overall routing configuration of the system smoothly transitions to the next routing configuration state. After generating the next routing configuration instruction, the routing change engine can write the next routing configuration instruction into the change instruction database.
[0133] (5) Change Instruction Service
[0134] 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.
[0135] It should be noted that the above-mentioned 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 this embodiment of the present application.
[0136] 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.
[0137] See also Figure 7 , Assume that there are two external routing nodes deployed in the business plane: routing node A and routing node B, and three internal routing nodes: routing node C, routing node D, and routing node E, where 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, and there is a microservice deployed in each of these three clusters. The global routing controller works in the management plane, and users are not aware of the routing configuration in the management plane when accessing the business plane.
[0138] 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:
[0139] S1: The administrator enters the routing configuration information of the target microservice through the web console of the global routing controller.
[0140] S2: The routing configuration service generates target routing information of at least one routing node on the access path of the target microservice according to the routing configuration information, and stores the target routing information of the at least one routing node in the final state database.
[0141] S3: The routing change engine obtains the real-time routing information and the 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 strategy, and stores the next routing configuration instruction in the change instruction database.
[0142] The routing configuration policy indicates the routing configuration order of the at least one routing node, and the next routing configuration instruction carries the routing information of the routing node that is determined to perform the routing configuration operation in the next step based on the routing configuration order indicated by the routing configuration policy.
[0143] S4: The change instruction service obtains the routing configuration instruction from the change instruction database and provides an ADS service of a 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.
[0144] 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.
[0145] 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.
[0146] 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.
[0147] 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.
[0148] 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 the multi-node routing configuration is similar. The implementation process of the above embodiment can be referred to and will not be repeated here.
[0149] Figure 8 is a schematic diagram of the structure of a routing configuration device provided by an embodiment of the present application. The routing configuration device can be implemented by software, hardware, or a combination of both to form part or all of a computing device. Figure 8The route configuration device 800 includes: an information acquisition module 801, a route determination module 802, a route configuration module 803, a route acquisition module 804 and a determination module 805.
[0150] The information acquisition module 801 is used to 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. There is at least one routing node on the access path of the target microservice.
[0151] The routing determination module 802 is used to determine the target routing information of at least one routing node based on the routing configuration information, where the target routing information is the routing information of at least one routing node when the target microservice can be accessed through the at least one routing node;
[0152] A routing configuration module 803, 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, wherein the routing configuration policy indicates a routing configuration order of at least one routing node;
[0153] The routing acquisition module 804 is used to acquire the 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;
[0154] The determination module 805 is used to determine that the routing configuration of the target microservice is completed if the real-time routing information of at least one routing node is the same as the respective target routing information.
[0155] Among them, the information acquisition module, the route determination module, the route configuration module, the route acquisition module and the determination module can all be implemented by software, or can be implemented by hardware. Exemplarily, the implementation of the route configuration module is introduced below by taking the route configuration module as an example. Similarly, the implementation of the information acquisition module, the route determination module, the route acquisition module and the determination module can refer to the implementation of the route configuration module.
[0156] As an example of a software functional unit, the routing configuration module may include code running on a computing instance. Among them, the computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Further, the above-mentioned 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 a data center or multiple data centers with similar geographical locations. Among them, usually a region may include multiple AZs.
[0157] Similarly, multiple hosts / virtual machines / containers used to run the code can be distributed in the same virtual private cloud (VPC) or in multiple VPCs. Usually, a VPC is set up in one region. For cross-region communication between two VPCs in the same region and between VPCs in different regions, a communication gateway needs to be set up in each VPC to achieve interconnection between VPCs through the communication gateway.
[0158] As an example of a hardware functional unit, the routing configuration module may include at least one computing device, such as a server, etc. Alternatively, the routing configuration module may also be a device 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.
[0159] The multiple computing devices included in the routing configuration module can be distributed in the same area or in different areas. 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 computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.
[0160] 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 functions of the routing configuration device are realized by respectively implementing different steps in the routing configuration method through the information acquisition module, the routing determination module, the routing configuration module, the routing acquisition module, and the determination module.
[0161] 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;
[0162] The routing configuration module 803 includes:
[0163] 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;
[0164] A second configuration unit, configured to send a second configuration instruction to a 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;
[0165] The determination module 805 is specifically used for:
[0166] 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.
[0167] 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 a root routing node that receives user traffic.
[0168] 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, 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.
[0169] 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 device 800 further includes:
[0170] 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.
[0171] 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 device 800 further includes:
[0172] 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.
[0173] 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 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.
[0174] Optionally, 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.
[0175] 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.
[0176] In an embodiment of the present application, the routing configuration device determines 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 according to the routing configuration information. Then, based on the target routing information of the at least one routing node, according to the routing configuration strategy, 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, so as to avoid the conditional competition of the routing configuration of multiple routing nodes, thereby improving the routing configuration efficiency when configuring the access route of the target microservice.
[0177] It should be noted that when the routing configuration device provided in the above embodiment configures routing information on at least one routing node, only the division of the above functional modules is used 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 is 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 belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0178] See also Fig. 9 , Fig. 9 1 is a schematic diagram of a computing device provided in an embodiment of the present application, wherein 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.
[0179] 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.
[0180] The bus 102 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig. 9 The bus 104 is represented by only one line, but does not mean that there is only one bus or one type of bus. The bus 104 may include a path for transmitting information between various components of the computing device 100 (eg, the memory 106, the processor 104, and the communication interface 108).
[0181] The processor 104 may include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0182] The memory 106 may include a volatile memory, such as a random access memory (RAM). The processor 104 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).
[0183] The memory 106 stores executable program codes, and the processor 104 executes the executable program codes to respectively implement the functions of the aforementioned information acquisition module, route determination module, route configuration module, route acquisition module, and determination module, thereby implementing the route configuration method. That is, the memory 106 stores instructions for executing the route configuration method.
[0184] The communication interface 103 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.
[0185] The embodiment of the present application also provides 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 smart phone.
[0186] like Fig.10 As shown, 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.
[0187] In some possible implementations, the memory 106 of one or more computing devices 100 in the computing device cluster may also store partial instructions for executing the routing configuration method. In other words, the combination of one or more computing devices 100 may jointly execute instructions for executing the routing configuration method.
[0188] It should be noted that the memory 106 in different computing devices 100 in the computing device cluster can store different instructions, which are respectively used to execute part of the functions of the routing configuration device. That is, the instructions stored in the memory 106 in different computing devices 100 can implement the functions of one or more modules among the information acquisition module, the routing determination module, the routing configuration module, the routing acquisition module and the determination module.
[0189] In some possible implementations, one or more computing devices in the computing device cluster may be connected via a network, which may be a wide area network or a local area network. Fig.11 A possible implementation is shown. Fig.11 As shown, 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. At the same time, the memory 106 in the computing device 100B stores instructions for executing the functions of the route configuration module and the determination module.
[0190] Fig.11 The connection method between the computing device clusters shown can be considered to be 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.
[0191] It should be understood that Fig.11 The functions of the computing device 100A shown in FIG. 1 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.
[0192] The present application embodiment also provides another computing device cluster. The connection relationship between the computing devices in the computing device cluster can be similar to that of Fig.10 and Fig.11 The connection mode of the computing device cluster is shown in FIG. The difference is that 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.
[0193] In some possible implementations, the memory 106 of one or more computing devices 100 in the computing device cluster may also store partial instructions for executing the routing configuration method. In other words, the combination of one or more computing devices 100 may jointly execute instructions for executing the routing configuration method.
[0194] The present application also provides a computer program product including instructions. The computer program product may be a software or 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, the at least one computing device executes the above Figure 2 The routing configuration method shown.
[0195] 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 tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk). The computer-readable storage medium includes instructions that instruct the computing device to execute the above Figure 2 The routing configuration method shown.
[0196] It should be understood that the "multiple" 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 only a description of the association relationship of the 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 the clear description of the technical solution of the embodiments of the present application, in the embodiments of the present application, the words "first", "second" and the like are used to distinguish between the same items or similar items with basically the same functions and effects. Those skilled in the art can understand that the words "first", "second" and the like do not limit the quantity and execution order, and the words "first", "second" and the like do not limit them to be necessarily different.
[0197] 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 the present 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 relevant laws, regulations and standards of relevant countries and regions.
[0198] 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 it. 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 cause the essence of the corresponding technical solutions to deviate 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, the computing device cluster comprising at least one computing device, each of the computing devices comprising 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
Cited By
Routing configuration method and apparatus, and device, storage medium and computer program
EP4780014A1
Routing configuration method and apparatus, and device, storage medium and computer program
WO2025066311A1