Load balancing method and device based on containerized micro-service architecture and medium

By deploying the proxy component and the centralized load balancing component on the client side to work together, the dynamic distribution of service configuration information and traffic direct flow in the Kubernetes cluster is realized, which solves the problem of high load on the API Server and improves the efficiency and performance of load balancing. .

CN118540277APending Publication Date: 2024-08-23BEIJING VOLCANO ENGINE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410889797.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-03
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

In the Kubernetes cluster, the API Server has a high load due to slow distribution of service configuration information, which affects the load balancing efficiency.

Method used

The proxy component deployed on the client side intercepts the first message of the client's source container accessing the microservice cluster, encapsulates it using a tunnel and sends it to the centralized load balancing component to achieve dynamic distribution and traffic pass-through, and reduce the distribution of service configuration information. Pressure and forward pressure.

Benefits of technology

It achieves high throughput and low-latency load balancing, reduces the load pressure on the API Server, and shortens the communication link.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118540277A
    Figure CN118540277A
Patent Text Reader

Abstract

The invention relates to a containerized micro-service architecture-based load balancing method and device and a medium. The distribution pressure of service configuration information is reduced through a centralized load balancing component. The method comprises the following steps: intercepting a first message initiated when a source container of a client accesses a target service in a micro-service cluster through an agent component on a client side, and sending the first message to a centralized load balancing component after tunnel packaging; wherein the centralized load balancing component is configured to be only responsible for the first message distribution of each container of the client to access each service in the micro-service cluster; distributing the first message to a target container of the target service through a centralized load balancing component; the first response message is received through the proxy component on the client side, a first connection tracking record of communication between the source container and the target container is generated based on the first response message, and the first connection tracking record is used for recording the network address translation relation between the source container and the target container so that the source container and the target container can conduct traffic straight-through.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a load balancing method, device, and medium based on a containerized microservice architecture. Background Art

[0002] Service discovery and load balancing are two of the most important components of a microservices architecture. For example, in the Kubernetes (container cluster management system) microservices architecture, Services are typically used to provide a unified service entry point for a group of container applications with the same functionality, and to provide load balancing to distribute requests to backend containers.

[0003] In related technologies, each node uses its own proxy service to obtain and distribute service configuration information from the API server (the gateway of the Kubernetes cluster). This information is then used to distribute messages. When a Kubernetes cluster contains a large number of nodes, the API server is highly loaded, slowing down the distribution of service configuration information. Summary of the Invention

[0004] This summary is provided to briefly introduce concepts that will be described in detail in the detailed description below. This summary is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.

[0005] In a first aspect, the present disclosure provides a load balancing method based on a containerized microservice architecture, the method comprising: The proxy component deployed on the client side intercepts the first message initiated by the client's source container to access the destination service in the microservice cluster, encapsulates it using a tunnel, and sends it to the centralized load balancing component; wherein the centralized load balancing component is configured to be responsible only for distributing the first message from each container of the client to each service in the microservice cluster, and forwards the message to the target container of the target service through the tunnel; Distributing the first message to a destination container of the destination service through the centralized load balancing component, so that the destination container generates a first response message for the first message; The first response message is received by the proxy component on the client side, and a first connection tracking record for communication between the source container and the destination container is generated based on the first response message, where the first connection tracking record is used to record the network address translation relationship between the source container and the destination container, so that the source container and the destination container can directly pass traffic after the first message is established based on the network address translation relationship.

[0006] In a second aspect, the present disclosure provides a load balancing device based on a containerized microservice architecture, the device comprising: The sending module is used to intercept the first message initiated by the source container of the client to access the destination service in the microservice cluster through the proxy component deployed on the client side, and send it to the centralized load balancing component after tunnel encapsulation; wherein, the centralized load balancing component is configured to be responsible for distributing only the first message of each container of the client accessing each service in the microservice cluster, and forwarding the message to the target container of the target service through the tunnel; a distribution module, configured to distribute the first message to a destination container of the destination service through the centralized load balancing component, so that the destination container generates a first response message for the first message; A receiving module is used to receive the first response message through the proxy component on the client side, and generate a first connection tracking record for communication between the source container and the destination container based on the first response message, wherein the first connection tracking record is used to record the network address translation relationship between the source container and the destination container, so that the source container and the destination container can directly pass traffic through the tunnel after the first message is established based on the network address translation relationship.

[0007] In a third aspect, the present disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of any one of the methods described in the first aspect.

[0008] In a fourth aspect, the present disclosure provides an electronic device, comprising: a storage device having a computer program stored thereon; A processing device is used to execute the computer program in the storage device to implement the steps of any one of the methods described in the first aspect above.

[0009] In a fifth aspect, the present disclosure provides a computer program product, comprising a computer program, which, when executed by a processor, implements the steps of any one of the methods in the first aspect.

[0010] Through the above technical solution, the first message initiated by the source container accessing the destination service is distributed to the destination container of the destination service through the centralized load balancing component, thereby realizing the dynamic distribution of the first message. Then, the proxy component deployed on the client side receives the destination container to generate the first response message for the first message, and generates the first connection tracking record of the communication between the source container and the destination container based on the first response message, so that the source container and the destination container can directly pass the traffic after the first message is established based on the network address translation relationship. In this way, the service configuration information in the API Server is obtained through the centralized load balancing component, which can reduce the distribution pressure of the service configuration information. And through the method of one-time dynamic distribution and subsequent direct communication, the forwarding pressure of the centralized load balancing component can also be reduced, which has the advantages of high throughput and low latency.

[0011] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] The above and other features, advantages and aspects of the various embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that the originals and elements are not necessarily drawn to scale. In the drawings: Figure 1 This is a schematic diagram showing a load sharing process according to an exemplary embodiment of the present disclosure; Figure 2 This is a schematic diagram showing a distributed load sharing process according to an exemplary embodiment of the present disclosure; Figure 3 is a schematic diagram showing a process of centralized load sharing according to an exemplary embodiment of the present disclosure; Figure 4 This is a flow chart illustrating a load balancing method based on a containerized microservice architecture according to an exemplary embodiment of the present disclosure; Figure 5 This is a process diagram of a load balancing method based on a containerized microservice architecture according to an exemplary embodiment of the present disclosure; Figure 6 This is a schematic diagram of a processing flow of a load balancer according to an exemplary embodiment of the present disclosure; Figure 7 is a schematic diagram of a processing flow of an agent component according to an exemplary embodiment of the present disclosure; Figure 8 is a schematic diagram of a processing flow of an agent component according to an exemplary embodiment of the present disclosure; Figure 9is a schematic diagram of a load balancing system based on a containerized microservice architecture according to an exemplary embodiment of the present disclosure; Figure 10 This is a structural block diagram of a load balancing device based on a containerized microservice architecture according to an exemplary embodiment of the present disclosure; Figure 11 The figure is a schematic structural diagram of an electronic device according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0013] The following describes embodiments of the present disclosure in more detail with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.

[0014] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0015] As used herein, the term "including" and its variations are open-ended, i.e., "including but not limited to." The term "based on" means "based, at least in part, on." The term "one embodiment" means "at least one embodiment," the term "another embodiment" means "at least one additional embodiment," and the term "some embodiments" means "at least some embodiments." Other terms are defined in the following description.

[0016] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0017] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, they should be understood as "one or more".

[0018] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0019] It is understandable that before using the technical solutions disclosed in the various embodiments of this disclosure, the type, scope of use, usage scenarios, etc. of the personal information involved in this disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0020] For example, in response to a user's active request, a prompt message is sent to the user to clearly inform the user that the operation requested will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the electronic device, application, server, storage medium, or other software or hardware that performs the operations of the disclosed technical solution based on the prompt message.

[0021] As an optional but non-limiting implementation, in response to receiving a user's active request, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. Furthermore, the pop-up window may also contain a selection control for the user to select "agree" or "disagree" to provide personal information to the electronic device.

[0022] It is understandable that the above notification and user authorization process are merely illustrative and do not limit the implementation of the present disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0023] At the same time, it is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.

[0024] Take the Kubernetes system as an example, refer to Figure 1 The client sends a request message to the destination service in the microservice cluster. The service provides load balancing and distributes the request message to the backend container (Pod), called the endpoint. The service needs to be aware of the creation and deletion of the service and backend Pods in order to maintain the correspondence between the service cluster IP (service address) and the endpoint Pod IP (endpoint container address), that is, the service configuration information. It can also provide load balancing based on the service configuration information to achieve traffic distribution.

[0025] Reference Figure 2 Or 3, where the Service can be created directly by the user, and the Endpoint can be automatically created by the Kubernetes system based on the user's configuration in the Service. The Endpoint Controller is used to create and maintain the Endpoint, and the Endpoint is used to store Pod information.

[0026] Related technologies provide a distributed traffic distribution method, such as Figure 2 As shown, a proxy component deployed on each node detects service creation and endpoint updates in the Kubernetes API server and dynamically distributes these updates to the node's kernel forwarding rules. Traffic from client pods accessing services is directly translated through the proxy component, enabling pods to access endpoints. The proxy supports load balancing using IPtables (a tool for configuring kernel-provided network packet filtering rules) and IPVS (IP Virtual Server, a type of load balancer).

[0027] The above approach relies on a proxy component deployed on each node to detect changes to all services and their associated endpoints in the API server, thereby updating and maintaining service configuration information. As the number of nodes in the cluster increases, the number of proxy components and the number of connections established with the API server also increase. Furthermore, as the cluster scales, the number of pods and services typically increases as well, leading to an exponential increase in the amount of data required to be transmitted between each node and the API server. This high load can slow the delivery of service configuration information.

[0028] Related technologies provide a centralized traffic distribution method, such as Figure 3 As shown, an external centralized load balancing component (LoadBalancer) can be used to implement traffic distribution in the Kubernetes system. The principle is to direct all Service traffic to a unified LoadBalancer. The LoadBalancer perceives changes in the Service and its associated Endpoints. Therefore, the relevant Service configuration information does not need to be distributed on each node. The traffic from the client's Pod accessing the Service can be directly distributed in the LoadBalancer.

[0029] The above approach uses a centralized load balancing component as the central node, which can reduce the number of components that need to interact with the API server. However, all traffic accessing the service is distributed through the LoadBalancer. Compared with the distributed traffic distribution method, it has a longer network communication path and will bring longer network latency. In addition, the LoadBalancer needs to process all packets accessing the service in the cluster, resulting in low request throughput.

[0030] In view of this, the present disclosure provides a load balancing method, device, and medium based on a containerized microservice architecture to solve the above-mentioned technical problems. It should be noted that the load balancing method provided in the embodiments of the present disclosure can be applied to a containerized microservice architecture, such as a Kubernetes system, or a container cloud orchestration engine other than a Kubernetes system, and the present disclosure does not limit this.

[0031] The following further explains the embodiments of the present disclosure with reference to the accompanying drawings.

[0032] Figure 4 This is a flow chart of a load balancing method based on a containerized microservice architecture according to an exemplary embodiment of the present disclosure, with reference to Figure 4 , the method comprising: S401: The proxy component deployed on the client side intercepts the first message initiated by the client's source container to access the destination service in the microservice cluster, and encapsulates it in a tunnel and sends it to the centralized load balancing component.

[0033] Among them, the centralized load balancing component is configured to be responsible only for distributing the first message from each container of the client to each service in the microservice cluster, and forwarding the message to the target container of the target service through the tunnel.

[0034] S402: Distribute the first message to the destination container of the destination service through the centralized load balancing component, so that the destination container generates a first response message for the first message.

[0035] S403: Receive the first response message through the proxy component on the client side, and generate a first connection tracking record for communication between the source container and the destination container based on the first response message. The first connection tracking record is used to record the network address translation relationship between the source container and the destination container, so that the source container and the destination container can directly pass traffic after the first message is established based on the network address translation relationship.

[0036] It should be noted that the addresses involved in this disclosure include IP addresses and port numbers, where IP addresses include but are not limited to IPv4 addresses defined in RFC 791 and IPv6 protocols defined in RFC 2460, and port numbers include but are not limited to TCP Port defined in RFC9293 and UDP Port defined in RFC 786.

[0037] Through the above technical solution, the first message initiated by the source container to access the destination service is distributed to the destination container of the destination service through the centralized load balancing component, thereby realizing the dynamic distribution of the first message. Then, the proxy component deployed on the client side receives the destination container to generate the first response message for the first message, and generates the first connection tracking record of the communication between the source container and the destination container based on the first response message, so that the source container and the destination container can directly pass the traffic after the first message is established based on the network address translation relationship. In this way, the service configuration information in the API Server is obtained through the centralized load balancing component, which can reduce the distribution pressure of the service configuration information. In addition, through the method of one-time dynamic distribution and subsequent direct communication, the forwarding pressure of the centralized load balancing component can also be reduced. Compared with the centralized traffic distribution method, the communication link is shortened, and it has the advantages of high throughput and low latency.

[0038] It should be noted that a node typically deploys a proxy component and can include multiple pods. Pods on the same node can belong to multiple services or none at all, and this disclosure does not restrict this. When a pod accesses other services, it can act as a client-side pod. When the pod is the accessed pod, it acts as a service-side pod.

[0039] In a possible manner, a proxy component deployed on the client side intercepts the first message initiated by the client's source container to access the destination service in the microservice cluster, and sends it to the centralized load balancing component after tunnel encapsulation, including: intercepting the request message initiated by the client's source container to access the destination service in the microservice cluster through the proxy component deployed on the client side, matching the address of the source container and the address of the destination service with the existing first connection tracking record; if the first connection tracking record corresponding to the address of the source container and the address of the destination service is not matched, determining that the request message is the first message, and sending it to the centralized load balancing component after tunnel encapsulation.

[0040] Alternatively, if a target first connection tracking record corresponding to the source container address and the destination service address is matched, the destination address of the request message is converted to the address of the destination container in the target first connection tracking record, and the request message is sent to the destination container.

[0041] For example, a proxy component deployed on the client side intercepts the request message initiated by the client's source container to access the destination service in the microservice cluster. If the first connection tracking record corresponding to the address of the source container and the address of the destination service is not matched, it means that the Client Pod is sending a request message to the Service for the first time. The first message can be encapsulated using the tunnel protocol and forwarded to the LoadBalancer through the tunnel, thereby realizing dynamic distribution of the first message. Alternatively, if the target first connection tracking record corresponding to the address of the source container and the address of the destination service is matched, the destination address of the request message can be converted to the address of the destination container in the target first connection tracking record. The request message can then be sent to the destination container based on the address of the destination container, thereby realizing direct traffic between the source container and the destination container.

[0042] In a possible manner, the first message is distributed to the destination container of the destination service through a centralized load balancing component, including: determining the destination container of the destination service corresponding to the first message according to the service configuration information through the centralized load balancing component, and distributing the first message to the destination container, where the service configuration information is a configuration rule issued by the microservice cluster for instructing the centralized load balancing component to distribute messages.

[0043] For example, the LoadBalancer is responsible for detecting changes in Services and their associated Endpoints. Specifically, the centralized load balancing component interacts with the microservice cluster to obtain service configuration information issued by the microservice cluster. The LoadBalancer can then determine the multiple containers corresponding to the destination service in the service configuration information based on the address of the destination service corresponding to the first message, assign one of these containers as the destination container, and then distribute the first message to the destination container, thereby achieving dynamic initial message distribution. Furthermore, obtaining service configuration information through the LoadBalancer can reduce the burden of distributing service configuration information.

[0044] In a possible manner, the first response message carries the address of the source container, the address of the destination service, and the address of the destination container; generating a first connection tracking record for communication between the source container and the destination container based on the first response message may include: generating the first connection tracking record for communication between the source container and the destination container based on the address of the source container, the address of the destination service, and the address of the destination container; wherein the first connection tracking record is used to indicate that the destination address of the request message for the source container to access the destination service is replaced from the address of the destination service to the address of the destination container, and that the source address of the response message returned by the destination container to the source container is replaced from the address of the destination container to the address of the destination service.

[0045] For example, after the proxy component on the client side receives the first response message, it can generate a first connection tracking record based on the address of the source container, the address of the destination service, and the address of the destination container carried in the first response message. In this way, when the proxy component on the client side subsequently intercepts the request message sent by the source container to the destination service, it will replace the destination address of the request message from the address of the destination service to the address of the destination container, and then directly send the request message to the destination container, thereby realizing direct traffic between the source container and the destination container.

[0046] Alternatively, when the client-side proxy component subsequently intercepts a response message from the destination container to the source container, it replaces the source address of the response message from the destination container to the address of the destination service. This allows direct traffic between the source and destination containers without the source container being aware of the specific destination container.

[0047] For the sake of convenience, the following description will be given using TCP (TCP Transmission Control Protocol) traffic as an example. Figure 5 In this example, the address of the Client Pod (referring to the source container) is 10.0.0.1, the IP:Port (IP address:port number) of the Service (referring to the destination service) accessed using TCP is 192.168.1.1:80, the address of the EndpointPod (referring to the destination container) is 10.0.10.2, and the address of the LoadBalancer is 10.0.20.3.

[0048] In a possible manner, the first message carries the address of the source container and the address of the destination service, and is sent to the centralized load balancing component after tunnel encapsulation, including: encapsulating the first message with a tunnel through the proxy component on the client side to obtain a first encapsulated message, sending the first encapsulated message to the centralized load balancing component, and the destination address of the first encapsulated message is the address of the centralized load balancing component. The first message is distributed to the destination container of the destination service through the centralized load balancing component, including: decapsulating the first encapsulated message through the centralized load balancing component to obtain a first message, encapsulating the address of the destination container and the first message with a tunnel to obtain a second encapsulated message, and distributing the second encapsulated message to the proxy component on the destination container side, and the destination address of the second encapsulated message is the address of the proxy component on the destination container side; decapsulating the second encapsulated message through the proxy component on the destination container side to obtain the first message and the address of the destination container, replacing the address of the destination service in the first message with the address of the destination container, and sending the replaced first message to the destination container.

[0049] For example, Figure 5In step 1 shown, the Client Pod accesses the Service and sends the first SYN (Synchronize Sequence Numbers) message. The source address (src) of the SYN message is 10.0.0.1:1234, and the destination address (dst) is 192.168.1.1:80. The request message is intercepted by the Client Proxy component (the proxy component on the client side).

[0050] It's worth noting that the Client Proxy component can intercept all requests to the Service Cluster IP segment using the ebpf (Extended Berkeley Packet Filter) program mounted on the network interface. Alternatively, you can use Iptables filtering tools, etc., which are not limited in this disclosure.

[0051] For example, if the first connection tracking record corresponding to the address of the Client Pod and the address of the Service is not matched, it means that the Client Pod is sending a request message to the Service for the first time. The first message can be encapsulated using the tunnel protocol and forwarded to the LoadBalancer through the tunnel.

[0052] For example, Figure 5 In step 2 shown, the source address of the first encapsulated message is 10.0.0.1:4789 (the address of ClientProxy), and the destination address is 10.0.20.3:4789 (the address of LoadBalancer). Inner-Src and Inner-Dst indicate the source address and destination address of the first encapsulated message.

[0053] For example, after receiving the first encapsulated message, the LoadBalancer decapsulates it to obtain the first message. Based on the service configuration information sent by the API Server and stored locally, the LoadBalancer allocates a container in the destination service as the destination container according to the destination address in the first message, encapsulates the address of the destination container into the option (a parameter field) of the message through the tunnel protocol, and forwards it to the Proxy component on the destination container side through the tunnel.

[0054] For example, continue to refer to Figure 5In step 3, the LoadBalancer allocates the corresponding Endpoint Pod based on the request message and the locally stored service configuration information. It then encapsulates the Endpoint Pod's address, 10.0.10.2:8080, in the message's Option using the tunneling protocol (e.g., Svr-rs in step 3). This generates a second encapsulated message, SYN, and forwards it to the Proxy component on the Endpoint side (i.e., the Service). The source address of this second encapsulated message, SYN, is the LoadBalancer's address, 10.0.20.3:4789, and the destination address is the Endpoint-side Proxy component's address, 10.0.10.2:4789. This allows for dynamic message distribution through centralized load balancing components.

[0055] For example, continue to refer to Figure 5 After receiving the second encapsulated message forwarded by LoadBalancer, the Proxy component on the Endpoint side decapsulates it to obtain the first message, extracts 10.0.10:8080 recorded in the Option, and as shown in step 4, the Proxy component on the Endpoint side performs destination address conversion, replaces the destination address 192.168.1.1:80 of the first message with 10.0.10.2:8080, and submits it to the network protocol stack of the Endpoint Pod.

[0056] It should be understood that since the Pod corresponding to the Service may change, the Pod on the Service side does not need to be aware of the Service.

[0057] In a possible embodiment, the method further includes: after obtaining the first message and the address of the destination container, generating, by a proxy component on the destination container side, a second connection tracking record for communication between the source container and the destination container based on the address of the source container, the address of the destination service, and the address of the destination container; wherein the second connection tracking record is used to indicate the address of the destination service corresponding to the first response message, so that the proxy component on the destination container side encapsulates the first response message and the address of the destination service using a tunnel and sends them to the proxy component on the client side.

[0058] For example, continue to refer to Figure 5The proxy component on the endpoint side extracts 10.0.10:8080 from the packet option and generates a second connection tracking record, "(10.0.0.10.2:8080->10.0.0.1:1234):192.168.1.1:80," indicating that the address of the Service corresponding to 10.0.0.10.2:8080 and 10.0.0.1:1234 is 192.168.1.1:80. This record is written to the eBPF map. The record type of this connection tracking record is a response message to the EndpointPod (destination container).

[0059] In a possible embodiment, the method further includes: generating and sending, by the destination container, a first response message for the replaced first message, the first response message carrying the address of the source container and the address of the destination container; intercepting, by the proxy component on the destination container side, the first response message, matching the address of the source container and the address of the destination container with an existing second connection tracking record; if a target second connection tracking record corresponding to the address of the source container and the address of the destination container is found, tunnel-encapsulating the address of the destination service in the target second connection tracking record and the first response message to obtain a third encapsulated message, and sending the third encapsulated message to the proxy component on the client side, the destination address of the third encapsulated message being the address of the proxy component on the client side. Receiving, by the proxy component on the client side, the first response message includes: receiving, by the proxy component on the client side, the third encapsulated message, and decapsulating the third encapsulated message to obtain the address of the destination service and the first response message. The method further includes: replacing, by the proxy component on the client side, the address of the destination container in the first response message with the address of the destination service, and sending the replaced first response message to the source container.

[0060] For example, the Endpoint Pod sends the first response message. The Proxy component on the Endpoint side matches the target second connection tracking record in the existing second connection tracking record based on the first response message. The Proxy component on the Endpoint side encapsulates the recorded destination service address into the Option of the tunnel message according to the tunnel protocol to obtain the third encapsulated message.

[0061] For example, continue to refer to Figure 5As shown in step 5, the Endpoint Pod sends the first response packet, a SYN-ACK (Acknowledgment), with the source and destination addresses 10.0.10.2:8080 and 10.0.10.1:1234, respectively. As shown in step 6, the Endpoint's Proxy component intercepts the SYN-ACK packet using the eBPF program mounted on the network interface and matches it to "(10.0.0.10.2:8080->10.0.0.1:1234):192.168.1.1:80," obtaining the corresponding address of the responder, 192.168.1.1:80. The Endpoint's Proxy component encapsulates the recorded 192.168.1.1:80 into the tunnel packet's option according to the tunnel protocol, generating a third encapsulated packet and sending it through the tunnel to the Client Proxy component corresponding to 10.0.10.1:1234.

[0062] For example, Figure 5 In step 6 shown, the Client Proxy component receives the proxy traffic in the tunnel, that is, decapsulates the third encapsulated message, extracts the Service address Svc:192.168.1.1:80 recorded in the Option of the tunnel message, replaces the source address of the first response message with the Service address 192.168.1.1:80 recorded in the Option, obtains the replaced SYN-ACK in step 7, and submits it to the network protocol stack of the Client Pod.

[0063] It should be understood that since the Pod corresponding to the Service may change, the Pod on the Client side needs to know the communicating Service, but does not need to be aware of the specific Pod corresponding to the Service side.

[0064] For example, Figure 5 In step 6 shown, the service address Svc:192.168.1.1:80 recorded in the option of the tunnel message is extracted, and the first connection tracking record "(10.0.0.1:1234->192.168.1.1:80):10.0.0.10.2:8080" is generated, indicating that the address of the destination container corresponding to 10.0.10.1:1234 to 192.168.1.1:80 is 10.0.10.2:8080, and is written to the eBPF map.

[0065] In a possible embodiment, the method further includes: generating and sending a handshake message by the destination container based on the replaced first response message, where the handshake message carries the address of the source container and the address of the destination service; intercepting the handshake message by a proxy component on the client side, matching the address of the source container and the address of the destination service with an existing first connection tracking record, obtaining an address of the destination container that matches the address of the source container and the address of the destination service, converting the destination address of the handshake message into the address of the destination container, and sending the handshake message to the destination container.

[0066] For example, Figure 5 In step 8, the Client Pod responds with an ACK handshake message. The source address of the handshake message is 10.0.10.1:1234 (the source container's address) and the destination address is 192.168.1.1:80 (the destination service's address). The ClientProxy component intercepts the handshake message using the eBPF program mounted on the network interface. It matches the "(10.0.0.1:1234->192.168.1.1:80):10.0.0.10.2:8080" recorded in step 6, obtaining the corresponding destination container address 10.0.10.2:8080. The ClientProxy component then replaces the destination address 192.168.1.1:80 in the handshake message with 10.0.10.2:8080, creating the ACK message corresponding to step 9. The message is then sent directly to the Endpoint Pod based on 10.0.10.2:8080, completing the TCP three-way handshake.

[0067] Accordingly, the subsequent Client Pod can refer to the following for sending packets to access the Service IP: Figure 5 In steps 8 and 9 shown, the Client Proxy component intercepts the message and matches the corresponding connection tracking record. It then performs network address translation, replacing the original message's destination address with the address of the Endpoint Pod corresponding to the connection tracking record, and sends the message directly to the Endpoint Pod.

[0068] It is worth noting that the destination address conversion is achieved through the Proxy component on the client side, so that the traffic between the source Pod and the destination Pod can be directly passed without going through the LoadBalancer, which reduces the forwarding pressure of the LoadBalancer, shortens the communication link, and has the advantages of high throughput and low latency.

[0069] This approach, based on eBPF technology, uses a tunneling protocol to communicate service traffic between nodes and LoadBalancers, enabling dynamic distribution of service traffic. This significantly reduces the amount of data required to distribute service configuration information, while adding virtually no additional network latency, thereby alleviating the load on the API server. Furthermore, because the LoadBalancer only processes the first packet, subsequent traffic is direct communication between pods, minimizing forwarding pressure and delivering high throughput and low latency.

[0070] It should be understood that since the Endpoint Pod may be deleted, in this case, the Client Proxy component can send a message to the LoadBalancer to allocate a new Endpoint Pod and re-perform the TCP three-way handshake process.

[0071] The following describes the message processing flow of the LoadBalancer and the message processing flow of the Proxy component with reference to the accompanying drawings.

[0072] For example, Figure 6 As shown, the LoadBalancer needs to decapsulate the tunnel message and determine whether the destination address of the message is the Service address. If so, it searches for the corresponding Endpoint Pod address based on the Service address; otherwise, it discards the message. Furthermore, if it finds an Endpoint Pod, it selects one of the Endpoint Pods, encapsulates the Service address in the message, and forwards it to the Endpoint Pod through the tunnel. Otherwise, the message is discarded.

[0073] For example, the Proxy component of a node can be used as either a Client-side Proxy component or a Service-side Proxy component, depending on the actual application scenario. Figure 7 When processing outgoing messages, the Proxy component first checks whether it can match a connection tracking record. If it can match and the record type is a response message to access the Endpoint Pod, the Service address in the connection tracking record is written into the message Option through the tunnel protocol and then sent to the peer Pod, that is, the Client Pod. Otherwise, the Proxy component performs destination address conversion, replacing the destination address with the Endpoint Pod address in the connection tracking record, and then it can be sent directly to the corresponding Endpoint Pod. If no match is found, it is necessary to determine whether it is a message to access the Service. If so, it needs to be encapsulated through the tunnel protocol and sent to the LoadBalancer. Otherwise, it is sent directly.

[0074] For example, refer to Figure 8 The Proxy component processes inbound messages sent to the node through the tunnel. After receiving the tunnel message, it decapsulates it, determines whether the option contains an Endpoint Pod address or a Service address, and records the corresponding connection tracking record. If it is the former, it needs to perform destination address translation; if it is the latter, it needs to perform source address translation. The translated message is then submitted to the Pod network protocol stack so that the corresponding Pod can receive it.

[0075] Using this approach, the LoadBalancer detects the mapping between services and endpoints in the API server and records it in the local data plane configuration, i.e., the service configuration information. It then load balances the first packet accessing the service while encapsulating the content within a tunnel. The proxy component performs operations such as address translation based on the information encapsulated within the packet. Because the LoadBalancer only processes the first packet, subsequent traffic is direct communication between pods, minimizing forwarding pressure and providing the advantages of high throughput and low latency.

[0076] Based on the same inventive concept, the present disclosure provides a load balancing system based on a containerized microservice architecture, referring to Figure 9 The load balancing system 900 based on the containerized microservice architecture includes a client 901, a server 902 and a centralized load balancing component 903. The client 901 includes a source container 9011 of the client and a first proxy component 9012 on the client side. The server 902 includes a destination container 9021 of the server and a second proxy component 9022 on the server side.

[0077] Among them, the interaction process of each component of the load balancing system based on the containerized microservice architecture can refer to the embodiment of the above method. The proxy component on the server side is the proxy component on the above-mentioned destination container side, and this disclosure will not go into details here.

[0078] Based on the same concept, the present disclosure also provides a load balancing device based on a containerized microservice architecture. Figure 10 The load balancing device 100 based on the containerized microservice architecture includes: The sending module 101 is configured to intercept the first message initiated by the source container of the client to access the destination service in the microservice cluster through a proxy component deployed on the client side, and send it to the centralized load balancing component after tunnel encapsulation; wherein the centralized load balancing component is configured to be responsible only for distributing the first message of each container of the client accessing each service in the microservice cluster, and forwarding the message to the target container of the target service through the tunnel; A distribution module 102, configured to distribute the first message to a destination container of the destination service through the centralized load balancing component, so that the destination container generates a first response message for the first message; The receiving module 103 is used to receive the first response message through the proxy component on the client side, and generate a first connection tracking record for communication between the source container and the destination container based on the first response message, wherein the first connection tracking record is used to record the network address translation relationship between the source container and the destination container, so that the source container and the destination container can directly pass traffic through the tunnel after the first message is established based on the network address translation relationship.

[0079] Optionally, the sending module 101 is configured to: Intercepting, by a proxy component deployed on the client side, a request message initiated by a source container of the client to access a destination service in a microservice cluster, and matching the address of the source container and the address of the destination service with an existing first connection tracking record; If no first connection tracking record corresponding to the address of the source container and the address of the destination service is matched, the request message is determined to be the first message, and is sent to the centralized load balancing component after being tunnel encapsulated.

[0080] The load balancing device 100 based on the containerized microservice architecture further includes: a conversion module configured to, if a target first connection tracking record corresponding to the address of the source container and the address of the destination service is matched, convert the destination address of the request message into the address of the destination container in the target first connection tracking record, and send the request message to the destination container.

[0081] Optionally, the distribution module 102 is configured to: The centralized load balancing component determines the destination container of the destination service corresponding to the first message according to the service configuration information, and distributes the first message to the destination container. The service configuration information is a configuration rule issued by the microservice cluster for instructing the centralized load balancing component to distribute messages.

[0082] Optionally, the first response message carries the address of the source container, the address of the destination service, and the address of the destination container; the receiving module 103 is configured to: generating a first connection tracking record for communication between the source container and the destination container based on the address of the source container, the address of the destination service, and the address of the destination container; The first connection tracking record is used to indicate that the destination address of a request message from the source container to access the destination service is replaced from the address of the destination service to the address of the destination container, and that the source address of a response message from the destination container to the source container is replaced from the address of the destination container to the address of the destination service.

[0083] Optionally, the first message carries the address of the source container and the address of the destination service, and the sending module 101 is configured to: After tunnel encapsulating the first message through the proxy component on the client side, a first encapsulated message is obtained, and the first encapsulated message is sent to the centralized load balancing component, where the destination address of the first encapsulated message is the address of the centralized load balancing component; The distribution module 102 is used to: Decapsulating the first encapsulated message through the centralized load balancing component to obtain the first message, tunnel-encapsulating the address of the destination container and the first message to obtain a second encapsulated message, and distributing the second encapsulated message to the proxy component on the destination container side, where the destination address of the second encapsulated message is the address of the proxy component on the destination container side; The second encapsulated message is decapsulated by the proxy component on the destination container side to obtain the first message and the address of the destination container, the address of the destination service in the first message is replaced with the address of the destination container, and the replaced first message is sent to the destination container.

[0084] The load balancing device 100 based on the containerized microservice architecture further includes a generation module, which is configured to: After obtaining the first message and the address of the destination container, generating, by a proxy component on the destination container side, a second connection tracking record for communication between the source container and the destination container based on the address of the source container, the address of the destination service, and the address of the destination container; The second connection tracking record is used to indicate the address of the destination service corresponding to the first response message, so that the proxy component on the destination container side encapsulates the first response message and the address of the destination service using a tunnel and sends them to the proxy component on the client side.

[0085] The load balancing device 100 based on the containerized microservice architecture further includes a response module, which is configured to: generating and sending, by the destination container, a first response message for the replaced first message, wherein the first response message carries the address of the source container and the address of the destination container; The proxy component on the destination container side intercepts the first response message, matches the address of the source container and the address of the destination container with an existing second connection tracking record, and if a target second connection tracking record corresponding to the address of the source container and the address of the destination container is found, tunnel encapsulates the address of the destination service in the target second connection tracking record and the first response message to obtain a third encapsulated message, and sends the third encapsulated message to the proxy component on the client side, where the destination address of the third encapsulated message is the address of the proxy component on the client side; The receiving module 103 is used for: Receiving the third encapsulated message through the proxy component on the client side, and decapsulating the third encapsulated message to obtain the address of the destination service and the first response message; The load balancing device 100 based on the containerized microservice architecture further includes a replacement module, which is configured to: The proxy component on the client side replaces the address of the destination container in the first response message with the address of the destination service, and sends the replaced first response message to the source container.

[0086] Based on the same concept, an embodiment of the present disclosure further provides a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of the above-mentioned load balancing method based on a containerized microservice architecture.

[0087] Based on the same concept, an embodiment of the present disclosure further provides an electronic device, which may include: a storage device having a computer program stored thereon; A processing device is used to execute the computer program in the storage device to implement the steps of the above-mentioned load balancing method based on containerized microservice architecture.

[0088] Based on the same concept, an embodiment of the present disclosure further provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the above-mentioned load balancing method based on a containerized microservice architecture.

[0089] Reference below Figure 11 , which shows a schematic structural diagram of an electronic device 110 suitable for implementing the embodiments of the present disclosure. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 11The electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.

[0090] like Figure 11 As shown, electronic device 110 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 111, which can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 112 or programs loaded from a storage device 118 into a random access memory (RAM) 113. Various programs and data required for the operation of electronic device 110 are also stored in RAM 113. Processing device 111, ROM 112, and RAM 113 are connected to each other via a bus 114. An input / output (I / O) interface 115 is also connected to bus 114.

[0091] Typically, the following devices may be connected to the I / O interface 115: an input device 116 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 117 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 118 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 119. The communication device 119 may allow the electronic device 110 to communicate with other devices wirelessly or by wire to exchange data. Figure 11 The electronic device 110 is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead.

[0092] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 119, or installed from the storage device 118, or installed from the ROM 112. When the computer program is executed by the processing device 111, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.

[0093] It should be noted that the computer-readable medium described above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. Computer-readable storage media may include, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or components, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such a propagated data signal may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wire, optical cable, RF (radio frequency), or any suitable combination thereof.

[0094] In some embodiments, communications may be conducted using any currently known or later developed network protocol, such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or later developed network.

[0095] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0096] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: intercepts the first message initiated by the source container of the client to access the destination service in the microservice cluster through a proxy component deployed on the client side, and sends it to the centralized load balancing component after tunnel encapsulation; wherein the centralized load balancing component is configured to be responsible only for the distribution of the first message for each container of the client to access each service in the microservice cluster, and forwards the message to the target container of the target service through the tunnel; distributes the first message to the destination container of the destination service through the centralized load balancing component, so that the destination container generates a first response message for the first message; receives the first response message through the proxy component on the client side, and generates a first connection tracking record for communication between the source container and the destination container based on the first response message, the first connection tracking record being used to record the network address translation relationship between the source container and the destination container, so that the source container and the destination container can directly pass traffic after the first message is established based on the network address translation relationship.

[0097] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including, but not limited to, object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0098] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0099] The modules described in the embodiments of the present disclosure may be implemented in software or hardware, wherein the name of a module does not necessarily limit the module itself.

[0100] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0101] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), optical fibers, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0102] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of the present disclosure is not limited to technical solutions formed by specific combinations of the aforementioned technical features. It also encompasses other technical solutions formed by any combination of the aforementioned technical features or their equivalents, without departing from the scope of the above disclosure. For example, a technical solution formed by replacing the aforementioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.

[0103] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0104] Although the subject matter has been described using language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims. Regarding the apparatus in the above-described embodiments, the specific manner in which each module performs operations has been described in detail in the embodiments related to the method and will not be elaborated upon here.

Claims

1. A load balancing method based on containerized microservice architecture, characterized in that: The method comprises: The first message initiated by the source container of the client to access the destination service in the microservice cluster is intercepted by a proxy component deployed on the client side, and is encapsulated by a tunnel and sent to a centralized load balancing component; wherein the centralized load balancing component is configured to be responsible only for the first message distribution of each container of the client to access each service in the microservice cluster, and forward the message to the target container of the target service through the tunnel; Distributing the first message to the destination container of the destination service through the centralized load balancing component, so that the destination container generates a first response message for the first message; The first response message is received by the proxy component on the client side, and a first connection tracking record for communication between the source container and the destination container is generated based on the first response message, wherein the first connection tracking record is used to record a network address translation relationship between the source container and the destination container, so that the source container and the destination container can directly pass traffic after the first message is established based on the network address translation relationship.

2. The load balancing method based on containerized microservice architecture according to claim 1 is characterized in that: The first message initiated by the source container of the client to access the destination service in the microservice cluster is intercepted by the proxy component deployed on the client side, and is encapsulated by a tunnel and sent to the centralized load balancing component, including: Intercepting, by means of a proxy component deployed on the client side, a request message initiated by a source container of the client to access a destination service in a microservice cluster, and matching an address of the source container and an address of the destination service with an existing first connection tracking record; If the first connection tracking record corresponding to the address of the source container and the address of the destination service is not matched, the request message is determined to be the first message, and is sent to the centralized load balancing component after being encapsulated using a tunnel.

3. The load balancing method based on containerized microservice architecture according to claim 2 is characterized in that: The method further comprises: If a target first connection tracking record corresponding to the address of the source container and the address of the destination service is matched, the destination address of the request message is converted to the address of the destination container in the target first connection tracking record, and the request message is sent to the destination container.

4. The load balancing method based on containerized microservice architecture according to claim 1, characterized in that: The distributing the first message to the destination container of the destination service through the centralized load balancing component includes: The centralized load balancing component determines the destination container of the destination service corresponding to the first message according to the service configuration information, and distributes the first message to the destination container. The service configuration information is a configuration rule issued by the microservice cluster and used to instruct the centralized load balancing component to distribute messages.

5. According to the load balancing method based on containerized microservice architecture in claim 1, the first response message carries the address of the source container, the address of the destination service and the address of the destination container; the first connection tracking record of the communication between the source container and the destination container is generated based on the first response message, comprising: generating a first connection tracking record for communication between the source container and the destination container based on the address of the source container, the address of the destination service, and the address of the destination container; The first connection tracking record is used to indicate that the destination address of the request message of the source container to access the destination service is replaced from the address of the destination service to the address of the destination container, and the source address of the response message returned by the destination container to the source container is replaced from the address of the destination container to the address of the destination service.

6. The load balancing method based on containerized microservice architecture according to any one of claims 1 to 5, characterized in that: The first message carries the address of the source container and the address of the destination service, and is sent to the centralized load balancing component after being encapsulated using a tunnel, including: After the first message is encapsulated by the proxy component on the client side using a tunnel, a first encapsulated message is obtained, and the first encapsulated message is sent to the centralized load balancing component, where the destination address of the first encapsulated message is the address of the centralized load balancing component; The distributing the first message to the destination container of the destination service through the centralized load balancing component includes: Decapsulating the first encapsulated message through the centralized load balancing component to obtain the first message, encapsulating the address of the destination container and the first message using a tunnel to obtain a second encapsulated message, and distributing the second encapsulated message to the proxy component on the destination container side, where the destination address of the second encapsulated message is the address of the proxy component on the destination container side; The second encapsulated message is decapsulated by the proxy component on the destination container side to obtain the first message and the address of the destination container, and after replacing the address of the destination service in the first message with the address of the destination container, the replaced first message is sent to the destination container.

7. The load balancing method based on containerized microservice architecture according to claim 6 is characterized in that: The method further comprises: After obtaining the first message and the address of the destination container, generating, by a proxy component on the destination container side, a second connection tracking record for communication between the source container and the destination container based on the address of the source container, the address of the destination service, and the address of the destination container; The second connection tracking record is used to indicate the address of the destination service corresponding to the first response message, so that the proxy component on the destination container side encapsulates the first response message and the address of the destination service using a tunnel and sends them to the proxy component on the client side.

8. The load balancing method based on containerized microservice architecture according to claim 7, characterized in that: The method further comprises: Generate and send, through the destination container, a first response message for the replaced first message, wherein the first response message carries an address of the source container and an address of the destination container; The first response message is intercepted by the proxy component on the destination container side, and the address of the source container and the address of the destination container are matched with the existing second connection tracking record. If a target second connection tracking record corresponding to the address of the source container and the address of the destination container is matched, the address of the destination service in the target second connection tracking record and the first response message are encapsulated by using a tunnel to obtain a third encapsulated message, and the third encapsulated message is sent to the proxy component on the client side, where the destination address of the third encapsulated message is the address of the proxy component on the client side; The receiving the first response message through the proxy component on the client side includes: Receiving the third encapsulated message through the proxy component on the client side, and decapsulating the third encapsulated message to obtain the address of the destination service and the first response message; The method further comprises: The address of the destination container in the first response message is replaced with the address of the destination service through the proxy component on the client side, and the replaced first response message is sent to the source container.

9. A load balancing device based on a containerized microservice architecture, characterized in that: The device comprises: A sending module is used to intercept the first message initiated by the source container of the client to access the destination service in the microservice cluster through a proxy component deployed on the client side, and send it to the centralized load balancing component after tunnel encapsulation; wherein the centralized load balancing component is configured to be responsible only for the first message distribution of each container of the client to access each service in the microservice cluster, and forward the message to the target container of the target service through the tunnel; A distribution module, configured to distribute the first message to a destination container of the destination service through the centralized load balancing component, so that the destination container generates a first response message for the first message; A receiving module is used to receive the first response message through the proxy component on the client side, and generate a first connection tracking record for communication between the source container and the destination container based on the first response message, wherein the first connection tracking record is used to record the network address translation relationship between the source container and the destination container, so that the source container and the destination container can directly pass traffic through a tunnel after the first message is established based on the network address translation relationship.

10. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processing device, the steps of the method according to any one of claims 1 to 8 are implemented.

11. An electronic device, characterized in that: include: a storage device having a computer program stored thereon; A processing device, configured to execute the computer program in the storage device to implement the steps of the method according to any one of claims 1 to 8.

12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.