DPU-based service endpoint detection method and apparatus, and storage medium
By using the DPU-based service endpoint detection method in Kubernetes' OVN DPU environment, periodically detecting Pod status and deleting unavailable endpoint information, the traffic forwarding problem caused by service endpoint problems is solved and the user experience is improved.
Patent Information
- Application Number
- CN202411265322.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-10
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2044-09-10
AI Technical Summary
In Kubernetes' OVN DPU environment, when there is a problem with the service endpoint, traffic accessing the service may still be forwarded to the problematic pod, affecting the user experience.
Provide a DPU-based service endpoint detection method. By obtaining a health checklist, periodically sending detection requests to the pod corresponding to the endpoint information, and listening to the pod message. When determining that the target endpoint is unavailable, delete the target endpoint from the load balancing flow table. endpoint information.
It effectively avoids traffic forwarding to problematic pods caused by problems with service endpoints, improves user experience, and ensures that traffic is forwarded to normal pods.
Smart Images

Figure CN119094389A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a DPU-based service endpoint detection method, device and storage medium. Background Art
[0002] In Kubernetes, service is an important resource object that can provide network access to a group of pods through endpoints. Endpoint is the bridge between service and pod. When a service selects a group of pods through a selector, the Kubernetes endpoints controller will create corresponding endpoints for these pods, which contain the Internet Protocol (IP) addresses and port numbers of all pods selected by the service.
[0003] In the existing Kubernetes Data Processing Unit (DPU) environment based on Open Virtual Network (OVN), Kubernetes will automatically monitor the start and stop status of Pods and remove dead Pods. An OVN controller runs on the DPU System On Chip (Soc), which is responsible for traffic forwarding and load balancing configuration on the DPU. When a Pod is removed, the OVN controller will receive an update notification from the OVN control plane, thereby updating the traffic forwarding and load balancing rules inside the DPU to ensure that traffic will no longer be forwarded to the dead Pod.
[0004] However, when a problem occurs with the service endpoint in the above solution, the traffic accessing the service may still be forwarded to the problematic Pod on the DPU, thereby affecting the business of the customer Pod and causing a poor user experience. Summary of the invention
[0005] In order to solve the above technical problems, the present application provides a DPU-based service endpoint detection method, device and storage medium, which solves the problem that traffic is forwarded to the problematic Pod due to problems with the service endpoint, thereby improving the user experience.
[0006] In the first aspect, the present application provides a DPU-based service endpoint detection method, including: obtaining a health check table; the health check table includes endpoint information of the service endpoint to be checked and pod information of the pod corresponding to the service endpoint to be checked; according to the health check table, periodically sending a detection request to the pod corresponding to the endpoint information, and monitoring the pod message; when it is determined that the target endpoint is unavailable according to the pod message of the pod corresponding to the target endpoint, deleting the endpoint information of the target endpoint from the load balancing flow table; the target endpoint is any service endpoint in the health check table, and the load balancing flow table includes endpoint information of multiple service endpoints, which is used to indicate the pod for traffic distribution.
[0007] In some embodiments, the health check table also includes a timeout period corresponding to each service endpoint to be checked; determining that the target endpoint is unavailable based on a pod message of the pod corresponding to the target endpoint includes: determining that the target endpoint is unavailable when a message unreachable is heard from the pod corresponding to the target endpoint; or determining that the target endpoint is unavailable when no pod message of the pod corresponding to the target endpoint is heard within the timeout period corresponding to the target endpoint.
[0008] In some embodiments, the health check table also includes the number of failures corresponding to each service endpoint to be checked; determining that the target endpoint is unavailable based on the pod message of the pod corresponding to the target endpoint includes: when a message unreachable message sent by the pod corresponding to the target endpoint is monitored, or when the pod message of the pod corresponding to the target endpoint is not monitored within the timeout period corresponding to the target endpoint, the number of failures corresponding to the target endpoint is increased by one to obtain a new number of failures; when the new number of failures is greater than a preset threshold, determining that the target endpoint is unavailable.
[0009] In some embodiments, the health check table also includes the normal number of times corresponding to each service endpoint to be checked; after monitoring the pod message, the method also includes: upon monitoring a message that a message is reachable sent by the pod corresponding to the target endpoint, the normal number corresponding to the target endpoint is increased by one.
[0010] In some embodiments, the health check table also includes the cycle duration corresponding to each service endpoint to be checked; according to the health check table, periodically sending a probe request to the pod corresponding to the endpoint information, including: according to the cycle duration corresponding to the service endpoint in the health check table, periodically sending a probe request to the pod corresponding to the endpoint information of the service endpoint.
[0011] In some embodiments, monitoring the pod message includes: creating a service monitor for each pod in the DPU, and monitoring the pod message of the corresponding pod based on the service monitor.
[0012] In the second aspect, the present application provides a DPU-based service endpoint detection device, including: an acquisition module for acquiring a health check table; the health check table includes endpoint information of the service endpoint to be checked and pod information of the pod corresponding to the service endpoint to be checked; a sending module for periodically sending a detection request to the pod corresponding to the endpoint information according to the health check table, and monitoring the pod message; a processing module for deleting the endpoint information of the target endpoint from the load balancing flow table when it is determined that the target endpoint is unavailable according to the pod message of the pod corresponding to the target endpoint; the target endpoint is any service endpoint in the health check table, and the load balancing flow table includes endpoint information of multiple service endpoints, which is used to indicate the pod for traffic distribution.
[0013] In some embodiments, the health check table also includes a timeout period corresponding to each service endpoint to be checked; the processing module is specifically used to: determine that the target endpoint is unavailable when a message that a message sent by a pod corresponding to the target endpoint is unreachable is monitored; or determine that the target endpoint is unavailable when a pod message of the pod corresponding to the target endpoint is not monitored within the timeout period corresponding to the target endpoint.
[0014] In some embodiments, the health check table also includes the number of failures corresponding to each service endpoint to be checked; the processing module includes a processing sub-module and a determination sub-module; the processing sub-module is used to increase the number of failures corresponding to the target endpoint by one to obtain a new number of failures when a message unreachable is heard from the pod corresponding to the target endpoint, or when a pod message from the pod corresponding to the target endpoint is not heard within a timeout period corresponding to the target endpoint; the determination sub-module is used to determine that the target endpoint is unavailable when the new number of failures is greater than a preset threshold.
[0015] In some embodiments, the health check table also includes the normal number of times corresponding to each service endpoint to be checked; the processing module is also used to: upon monitoring a message that a message is reachable sent by the pod corresponding to the target endpoint, increase the normal number of times corresponding to the target endpoint by one.
[0016] In some embodiments, the health check table also includes the cycle duration corresponding to each service endpoint to be checked; the sending module is specifically used to periodically send a detection request to the pod corresponding to the endpoint information of the service endpoint according to the cycle duration corresponding to the service endpoint in the health check table.
[0017] In some embodiments, the sending module includes a monitoring submodule; the monitoring submodule is used to create a service monitor for each pod in the DPU, and monitor the pod message of the corresponding pod based on the service monitor.
[0018] In a third aspect, the present application provides a computer-readable storage medium, including: a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, it implements the DPU-based service endpoint detection method as in the first aspect.
[0019] In a fourth aspect, the present application provides a computer program product, comprising: when the computer program product runs on a computer, the computer implements the DPU-based service endpoint detection method as in the first aspect.
[0020] The technical solution provided by the present application has the following advantages over the prior art: First, a health check table is obtained. Among them, the health check table includes the endpoint information of the service endpoint to be checked and the pod information of the pod corresponding to the service endpoint to be checked. Afterwards, according to the health check table, a detection request is periodically sent to the pod corresponding to the endpoint information, and the pod message is monitored. Finally, when the target endpoint is determined to be unavailable according to the pod message of the pod corresponding to the target endpoint, the endpoint information of the target endpoint is deleted from the load balancing flow table. Among them, the target endpoint is any service endpoint in the health check table, and the load balancing flow table includes endpoint information of multiple service endpoints, which is used to indicate the pod of traffic distribution. In this way, a detection request can be sent to the pod corresponding to the service endpoint, and the service endpoint can be determined to be available through the response message (i.e., pod message) of the pod to the detection request, and the endpoint information corresponding to the service endpoint can be deleted from the load balancing flow table in time when the service endpoint is unavailable, avoiding the problem that the traffic accessing the service may still be forwarded to the problematic Pod due to problems with the service endpoint, affecting the customer's pod business, and improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0022] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0023] Figure 1 One of the flow charts of the DPU-based service endpoint detection method provided in the embodiment of the present application;
[0024] Figure 2 A schematic diagram of an application scenario of a DPU-based service endpoint detection method provided in an embodiment of the present application;
[0025] Figure 3 The second flowchart of the DPU-based service endpoint detection method provided in the embodiment of the present application;
[0026] Figure 4 The third flowchart of the DPU-based service endpoint detection method provided in the embodiment of the present application;
[0027] Figure 5 A fourth flowchart of a DPU-based service endpoint detection method provided in an embodiment of the present application;
[0028] Figure 6 A fifth flowchart of a DPU-based service endpoint detection method provided in an embodiment of the present application;
[0029] Figure 7 A schematic diagram of the structure of a DPU-based service endpoint detection device provided in an embodiment of the present application;
[0030] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0031] In order to more clearly understand the above-mentioned purposes, features and advantages of the present application, the scheme of the present application will be further described below. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
[0032] In the following description, many specific details are set forth to facilitate a full understanding of the present application, but the present application may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only part of the embodiments of the present application, rather than all of the embodiments.
[0033] First, some nouns or terms involved in the specification and claims of this application are explained below.
[0034] DPU: Data Processing Unit is a processor designed specifically to handle data-intensive tasks, designed specifically to accelerate data center network and storage workloads. DPU combines a network interface card, a high-performance processor, and a flexible programmable data path to optimize data processing and network performance. Unlike CPUs and GPUs, it is mainly responsible for tasks such as data movement, data processing, and data security.
[0035] Kubernetes: k8s for short, is an open source container orchestration platform that automates the deployment, management, expansion, and network configuration of container applications and is widely used in the management and deployment of modern cloud-native applications.
[0036] Pod: It is the smallest deployment unit in Kubernetes, usually containing one or more tightly coupled containers. The containers in the pod share the network and storage and can communicate with each other.
[0037] Service: is an important resource object that can provide network access to a group of pods through endpoints.
[0038] Endpoint: It is the bridge between service and pod. When the service selects a group of pods through the selector, the Kubernetes endpoints controller will create corresponding endpoints for this group of pods, which contain the IP addresses and port numbers of all pods selected by the service.
[0039] VPC: Virtual Private Cloud (VPC) is a network service provided on a cloud platform for creating and managing a virtualized private network environment with features such as isolation, customization, scalability, and security. VPC allows users to create customized virtual networks in a cloud environment, including network resources such as IP address ranges, subnets, routing tables, and access control rules. Each VPC is an isolated network environment that is independent of other VPCs, and can create its own network topology and resources.
[0040] OVN: Open Virtual Network is an open source, distributed virtual network solution designed to provide powerful and flexible network services for cloud computing environments. It is built on OpenvSwitch (OVS) and is designed to provide powerful virtual network functions for cloud computing and data centers. It can be integrated into existing cloud management platforms (such as OpenStack, Kubernetes, etc.) to provide powerful network functions for these platforms.
[0041] The following, in conjunction with the accompanying drawings, describes in detail the DPU-based service endpoint detection method, device and storage medium provided in the embodiments of the present application through specific embodiments.
[0042] In the OVN Kubernetes solution using DPU, the automated scheduling and management functions of Kubernetes make large-scale cluster management simple, and OVN's distributed network architecture supports large-scale network connections between DPU nodes and Pods. The hardware acceleration provided by DPU significantly improves network throughput and reduces latency. At the same time, in the OVN-based Kubernetes DPU environment, Kubernetes will automatically monitor the start and stop status of the Pod, remove dead Pods, and run the OVN controller on the DPU Soc. The OVN controller is responsible for traffic forwarding and load balancing configuration on the DPU. When a Pod is removed, the OVN controller will receive an update notification from the OVN control plane, thereby updating the traffic forwarding and load balancing rules inside the DPU to ensure that traffic will no longer be forwarded to the dead Pod.
[0043] However, when a problem occurs with the service endpoint in the above solution, the traffic accessing the service may still be forwarded to the problematic Pod on the DPU, thereby affecting the business of the customer Pod and causing a poor user experience. Therefore, there is an urgent need for a method that can detect service endpoint anomalies to prevent the traffic accessing the service from being forwarded to the problematic Pod.
[0044] In response to the above problems, an embodiment of the present application provides a DPU-based service endpoint detection method, which can obtain a health check table; the health check table includes endpoint information of the service endpoint to be checked and pod information of the pod corresponding to the service endpoint to be checked; according to the health check table, a detection request is periodically sent to the pod corresponding to the endpoint information, and the pod message is monitored; when the target endpoint is determined to be unavailable according to the pod message of the pod corresponding to the target endpoint, the endpoint information of the target endpoint is deleted from the load balancing flow table; the target endpoint is any service endpoint in the health check table, and the load balancing flow table includes endpoint information of multiple service endpoints, which is used to indicate the pod for traffic distribution, and can detect problematic service endpoints and delete them in time, thereby avoiding the traffic accessing the service from being forwarded to the problematic Pod, thereby improving the user experience.
[0045] The DPU-based service endpoint detection method provided in the embodiment of the present application can be executed by a DPU-based service endpoint detection device, and the DPU-based service endpoint detection device can be hardware or software. When the DPU-based service endpoint detection device is hardware, it can be various electronic devices with a DPU-based service endpoint detection function, including but not limited to mobile phones, computers, computers, tablet computers, televisions, smart TVs, vehicle-mounted equipment, smart vehicles, laser projection equipment, monitors, electronic bulletin boards, electronic desktops, etc. When the DPU-based service endpoint detection device is software, it can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules, or it can be implemented as a single software or software module. No specific limitation is made here.
[0046] Figure 1 A flow chart of a DPU-based service endpoint detection method provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the DPU-based service endpoint detection method may include the following steps:
[0047] S11. Obtain a health checkup form.
[0048] In some embodiments, if the OVN-based Kubernetes DPU environment has not been built in the DPU, the environment needs to be built.
[0049] First, if Figure 2 As shown, a DPU-based OVN Kubernetes environment is deployed, including a master node 201 and a DPU node 202. Deploy OVN components, deploy OVN northbound database (NBDB), OVN southbound database (SBDB), Ovn-Northd and other components on the master node 201, deploy Ovn-controller and other components on the DPU node 202, and configure OVS parameters on the DPU, including: the tunnel address (ovn-encap-ip) corresponding to the DPU node 202; the tunnel type (ovn-encap-type) connecting the DPU node 202 to the master node 201; the remote address (ovn-remote) of the master node 201 connected to the DPU node 202; the chassis id (system-id) corresponding to the DPU node 202; the host (host) name (hostname) corresponding to the DPU node 202, from realizing the connection between the DPU node 202 and the OVN components on the master node 201.
[0050] Secondly, if Figure 2 As shown, a VPC is created in the DPU node 202, and a Pod on the DPU node 202 is created in the VPC. Each Pod uses a virtual function (VF) on the DPU host and moves the VF to the namespace where the Pod is located. On the DPU node 202, a port is created on the OVS for each Pod. The port is connected to the VF on the DPU host, and the traffic sent by the Pod is sent from the DPU through the port on the DPU.
[0051] After that, create a service that specifies the virtual IP address (VIP), protocol, and port number, and create a service endpoint that specifies the backend Pod of the service.
[0052] Finally, in OVN NBDB, a load balancer (Load_Balancer) is created for the service. This Load_Balancer combines the service and the backend pod together, and forwards the traffic accessing the service to the backend pod on the DPU node 202 according to the pre-acquired load balancing flow table. This implements the construction of the OVN-based Kubernetes DPU environment.
[0053] After that, obtain the health check table (Load_Balancer_Healthy_Check), which includes the endpoint information of the service endpoint to be checked and the pod information of the pod corresponding to the service endpoint to be checked.
[0054] Specifically, the method for obtaining the health check table can be to directly obtain the health check table input by the user; or to obtain the default health check table; or to first determine the endpoint information of the corresponding service endpoint in the load balancing flow table as the endpoint information of the service endpoint to be checked, and bind the logical port corresponding to the pod in the service to the service endpoint to be checked, and obtain the pod information of the pod corresponding to the service endpoint to be checked in the health check table (that is, the logical port corresponding to the pod).
[0055] S12. According to the health check table, periodically send a detection request to the pod corresponding to the endpoint information and monitor the pod message.
[0056] First, according to the health check table, a probe request is periodically sent to the pod corresponding to the endpoint information.
[0057] Specifically, the health check table includes the endpoint information of the service endpoints to be checked. After the service selects a group of pods through the selector, the Kubernetes endpoints controller will create corresponding service endpoints for these pods, usually one pod corresponds to one service endpoint. The endpoint information of each service endpoint contains the IP address and port number of the pod selected by the service. Therefore, the endpoint information of the service endpoint to be checked in the health check table is usually the IP address and port number of the pod selected by the service, so that the subsequent service can forward the traffic to the corresponding pod according to the endpoint information of the service endpoint.
[0058] Therefore, according to the health check table, the method of periodically sending a probe request to the pod corresponding to the endpoint information can be to send a probe request to the corresponding pod according to the endpoint information of each service endpoint to be checked in the health check table. The period of sending the probe request can be preset, for example, a default value, or a value set by relevant personnel according to actual conditions.
[0059] Second, monitor pod messages.
[0060] Specifically, the health check table also includes pod information of the pod corresponding to the service endpoint to be checked. Since the logical port usually remains stable during the life cycle of the pod entity, the pod information refers to the logical port of the pod. The way to monitor the pod message can be to monitor the pod message of the pod corresponding to the logical port.
[0061] In some embodiments, the method of monitoring pod messages can create a collective service monitor for monitoring pod messages of pods corresponding to all logical ports in the health check table.
[0062] S13. When it is determined that the target endpoint is unavailable according to the pod message of the pod corresponding to the target endpoint, the endpoint information of the target endpoint is deleted from the load balancing flow table.
[0063] The target endpoint is any service endpoint in the health check table. The load balancing flow table is pre-acquired and includes endpoint information of multiple service endpoints, which is used to indicate the pod for traffic distribution. The endpoint information corresponding to one service endpoint corresponds to one pod.
[0064] In this way, if traffic to access the service is received, the load balancer (Load_Balancer) will forward the traffic to the service on the DPU node to the backend pod corresponding to the endpoint information in the load balancing flow table after deleting the endpoint information of the unavailable service endpoint, to ensure that the service traffic is forwarded to the normal pod.
[0065] In the above scheme, first, a health check table is obtained. The health check table includes the endpoint information of the service endpoint to be checked and the pod information of the pod corresponding to the service endpoint to be checked. After that, according to the health check table, a detection request is periodically sent to the pod corresponding to the endpoint information, and the pod message is monitored. Finally, when the target endpoint is determined to be unavailable according to the pod message of the pod corresponding to the target endpoint, the endpoint information of the target endpoint is deleted from the load balancing flow table. Among them, the target endpoint is any service endpoint in the health check table, and the load balancing flow table includes the endpoint information of multiple service endpoints, which is used to indicate the pod for traffic distribution. In this way, a detection request can be sent to the pod corresponding to the service endpoint, and the service endpoint can be determined to be available through the response message (i.e., pod message) of the pod to the detection request, and the endpoint information corresponding to the service endpoint can be deleted from the load balancing flow table in time when the service endpoint is unavailable, avoiding the problem that the traffic accessing the service may still be forwarded to the problematic Pod due to problems with the service endpoint, affecting the customer's pod business, and improving the user experience.
[0066] In some embodiments, the health check table also includes the interval of each check of the service endpoint to be checked, such as Figure 3 As shown, according to the health check table, the method of periodically sending a probe request to the pod corresponding to the endpoint information can be:
[0067] S121. According to the cycle duration corresponding to the service endpoint in the health check table, a detection request is periodically sent to the pod corresponding to the endpoint information of the service endpoint.
[0068] In the above scheme, the health check table also includes the cycle duration of each service endpoint to be checked. According to the cycle duration of the service endpoint in the health check table, a detection request is periodically sent to the pod corresponding to the endpoint information of the service endpoint. This allows users to flexibly set the cycle duration of each service endpoint to be checked through the health check table, which improves the flexibility of the DPU-based service endpoint detection method.
[0069] In some embodiments, Figure 4 As shown, the way to monitor pod messages can be:
[0070] S124. Create a service monitor for each pod in the DPU, and monitor the pod message of the corresponding pod based on the service monitor.
[0071] Specifically, in the OVN southbound database, a service monitor (Service_Monitor) is created for each pod in the DPU, and the IP address, port number, logical port corresponding to the Pod, protocol number, etc. of the corresponding pod are specified in the service monitor, and then the pod message of the corresponding pod is monitored based on the service monitor.
[0072] In the above solution, a service monitor is created for each pod, and the pod messages of the corresponding pod are monitored based on the service monitor. Each pod can be managed separately to ensure the isolation and security of the pod messages corresponding to each pod.
[0073] In some embodiments, the health check table also includes a timeout period corresponding to each service endpoint to be checked, such as Figure 5 As shown, the method of determining that the target endpoint is unavailable according to the pod message of the pod corresponding to the target endpoint may include any of the following steps:
[0074] S131. When a message that a message sent by a pod corresponding to a target endpoint is unreachable is monitored, it is determined that the target endpoint is unavailable.
[0075] For example, after sending a detection request, if it is monitored that a pod corresponding to a certain service endpoint sends an Internet Control Message Protocol (ICMP) message unreachable message, it is determined that the service endpoint is unavailable.
[0076] S132: When no pod message of the pod corresponding to the target endpoint is monitored within the timeout period corresponding to the target endpoint, it is determined that the target endpoint is unavailable.
[0077] For example, after sending a detection request for a target endpoint, if an ICMP packet reaching message of the pod corresponding to the target endpoint is not received within the timeout period corresponding to the target endpoint in the health check table, the target endpoint is determined to be unavailable.
[0078] In the above solution, when the message sent by the pod corresponding to the target endpoint is unreachable, or when no pod message is received within the timeout period, it can be determined that the target endpoint is unavailable, so that the endpoint information corresponding to the service endpoint can be deleted from the load balancing flow table in time, avoiding the problem that the traffic accessing the service may still be forwarded to the problematic Pod due to problems with the service endpoint, affecting the customer's pod business, thereby improving the user experience.
[0079] In some embodiments, the health check table also includes the failure count (failure_count) corresponding to each service endpoint to be checked, such as Figure 6As shown, the method of determining that the target endpoint is unavailable according to the pod message of the pod corresponding to the target endpoint may include the following steps:
[0080] S134. When a message unreachable is heard from the pod corresponding to the target endpoint, or when a pod message of the pod corresponding to the target endpoint is not heard within a timeout period corresponding to the target endpoint, the number of failures corresponding to the target endpoint is increased by one to obtain a new number of failures.
[0081] S135: When the new number of failures is greater than a preset threshold, determine that the target endpoint is unavailable.
[0082] The preset threshold value may be a default value or a value set by relevant personnel according to actual conditions.
[0083] In some embodiments, when the new number of failures is less than or equal to a preset threshold, it is determined that the target endpoint is available.
[0084] In the above scheme, when the number of failures is greater than a preset threshold, the target endpoint is determined to be unavailable, thereby avoiding the problem of occasional target endpoint unavailability due to other environmental factors (such as network problems) and improving the overall fault tolerance of the system.
[0085] In some embodiments, the health check table also includes the normal number of times (success_count) corresponding to each service endpoint to be checked. After monitoring the pod message, the DPU-based service endpoint detection method also includes: upon monitoring a message that a message is reachable sent by the pod corresponding to the target endpoint, the normal number corresponding to the target endpoint is increased by one.
[0086] In the above scheme, the number of times the service endpoint is detected normally can be recorded, so that relevant personnel can intuitively understand the detection status of each service endpoint, thereby improving the user experience.
[0087] In some embodiments, after deleting the endpoint information of the target endpoint from the load balancing flow table, the DPU-based service endpoint detection method further includes: updating the health check table and deleting all information corresponding to the target endpoint to avoid wasting resources.
[0088] In some embodiments, the DPU-based service endpoint detection method also includes: regularly checking the load balancing flow table, and determining the availability of service endpoints in the DPU environment based on the remaining endpoint information in the load balancing flow table to ensure that the service endpoints of key services in the network are not deleted, thereby ensuring the stability and reliability of the service.
[0089] The embodiment of the present application can divide the functional modules of the DPU-based service endpoint detection device according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing unit. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical functional division. There may be other division methods in actual implementation.
[0090] like Figure 7 As shown, it is a schematic diagram of the structure of a DPU-based service endpoint detection device provided in an embodiment of the present application. The DPU-based service endpoint detection device includes an acquisition module 71, a sending module 72 and a processing module 73.
[0091] An acquisition module 71 is used to obtain a health check table; the health check table includes endpoint information of the service endpoint to be checked and pod information of the pod corresponding to the service endpoint to be checked; a sending module 72 is used to periodically send a detection request to the pod corresponding to the endpoint information according to the health check table, and monitor the pod message; a processing module 73 is used to delete the endpoint information of the target endpoint from the load balancing flow table when it is determined that the target endpoint is unavailable according to the pod message of the pod corresponding to the target endpoint; the target endpoint is any service endpoint in the health check table, and the load balancing flow table includes endpoint information of multiple service endpoints, which is used to indicate the pod for traffic distribution.
[0092] In some embodiments, the health check table also includes a timeout period corresponding to each service endpoint to be checked; the processing module 73 is specifically used to: determine that the target endpoint is unavailable when a message that a message sent by the pod corresponding to the target endpoint is unreachable is monitored; or determine that the target endpoint is unavailable when a pod message of the pod corresponding to the target endpoint is not monitored within the timeout period corresponding to the target endpoint.
[0093] In some embodiments, the health check table also includes the number of failures corresponding to each service endpoint to be checked; the processing module 73 includes a processing submodule and a determination submodule; the processing submodule is used to increase the number of failures corresponding to the target endpoint by one to obtain a new number of failures when a message unreachable is heard from the pod corresponding to the target endpoint, or when a pod message from the pod corresponding to the target endpoint is not heard within a timeout period corresponding to the target endpoint; the determination submodule is used to determine that the target endpoint is unavailable when the new number of failures is greater than a preset threshold.
[0094] In some embodiments, the health check table also includes the normal number of times corresponding to each service endpoint to be checked; the processing module 73 is also used to: upon monitoring a message that a message is reachable sent by the pod corresponding to the target endpoint, increase the normal number of times corresponding to the target endpoint by one.
[0095] In some embodiments, the health check table also includes the cycle duration corresponding to each service endpoint to be checked; the sending module 72 is specifically used to periodically send a detection request to the pod corresponding to the endpoint information of the service endpoint according to the cycle duration corresponding to the service endpoint in the health check table.
[0096] In some embodiments, the sending module 72 includes a monitoring submodule; the monitoring submodule is used to create a service monitor for each pod in the DPU, and monitor the pod message of the corresponding pod based on the service monitor.
[0097] The DPU-based service endpoint detection device provided in this embodiment can execute the DPU-based service endpoint detection method provided in the above method embodiment. Its implementation principle and technical effects are similar to the above method and will not be repeated here.
[0098] Figure 8 An electronic device according to an exemplary embodiment may include a processor 802, and the processor 802 is used to execute application code to implement the DPU-based service endpoint detection method in the present application.
[0099] The processor 802 may be a central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the present application.
[0100] like Figure 8 As shown, the electronic device may further include a memory 803. The memory 803 is used to store application program codes for executing the solution of the present application, and the execution is controlled by the processor 802.
[0101] The memory 803 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 803 may exist independently and be connected to the processor 802 via the bus 804. The memory 803 may also be integrated with the processor 802.
[0102] like Figure 8 As shown, the electronic device may further include a communication interface 801, wherein the communication interface 801, the processor 802, and the memory 803 may be coupled to each other, for example, via a bus 804. The communication interface 801 is used to exchange information with other devices, for example, to support information exchange between the electronic device and other devices.
[0103] It should be pointed out that Figure 8 The device structure shown in the figure does not constitute a limitation on the electronic device, except Figure 8 In addition to the components shown, the electronic device may include more or fewer components than shown, or combine certain components, or arrange the components differently. The electronic device provided in this embodiment can execute the DPU-based service endpoint detection method provided in the above method embodiment, and its implementation principle and technical effects are similar to the above method, which will not be repeated here.
[0104] An embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, each process of the DPU-based service endpoint detection method in the above method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0105] The computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0106] An embodiment of the present application provides a computer program product, which stores a computer program. When the computer program is executed by a processor, each process of the DPU-based service endpoint detection method in the above method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0107] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media that include computer-usable program code.
[0108] In this application, memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0109] In this application, computer-readable media includes permanent and non-permanent, removable and non-removable storage media. Storage media can be implemented by any method or technology to store information, and the information can be computer-readable instructions, data structures, modules of programs or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. According to the definition in this article, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data and carrier waves.
[0110] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0111] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A service endpoint detection method based on DPU, characterized in that: include: Obtain a health check table; the health check table includes endpoint information of the service endpoint to be checked and pod information of the pod corresponding to the service endpoint to be checked; According to the health check table, periodically send a detection request to the pod corresponding to the endpoint information, and monitor the pod message; When it is determined that the target endpoint is unavailable according to the pod message of the pod corresponding to the target endpoint, the endpoint information of the target endpoint is deleted from the load balancing flow table; The target endpoint is any service endpoint in the health check table, and the load balancing flow table includes endpoint information of multiple service endpoints, which is used to indicate the pod for traffic distribution.
2. The service endpoint detection method according to claim 1, characterized in that: The health check table also includes the timeout duration corresponding to each service endpoint to be checked; Determining that the target endpoint is unavailable according to a pod message of a pod corresponding to the target endpoint includes: When a message that a message sent by the pod corresponding to the target endpoint is unreachable is monitored, determining that the target endpoint is unavailable; Alternatively, when no pod message of the pod corresponding to the target endpoint is monitored within the timeout period corresponding to the target endpoint, it is determined that the target endpoint is unavailable.
3. The service endpoint detection method according to claim 1, characterized in that: The health check table also includes the number of failures corresponding to each service endpoint to be checked; Determining that the target endpoint is unavailable according to a pod message of a pod corresponding to the target endpoint includes: When a message unreachable is heard from the pod corresponding to the target endpoint, or a pod message of the pod corresponding to the target endpoint is not heard within the timeout period corresponding to the target endpoint, the number of failures corresponding to the target endpoint is increased by one to obtain a new number of failures; When the new number of failures is greater than a preset threshold, it is determined that the target endpoint is unavailable.
4. The service endpoint detection method according to claim 1, characterized in that: The health check table also includes the normal times corresponding to each service endpoint to be checked; After monitoring the pod message, the method further includes: When a message that a message is reachable sent by the pod corresponding to the target endpoint is monitored once, the normal number of times corresponding to the target endpoint is increased by one.
5. The service endpoint detection method according to any one of claims 1 to 4, characterized in that: The health check table also includes the cycle duration of each check corresponding to the service endpoint to be checked; The step of periodically sending a detection request to a pod corresponding to the endpoint information according to the health check table includes: According to the cycle duration corresponding to the service endpoint in the health check table, a detection request is periodically sent to the pod corresponding to the endpoint information of the service endpoint.
6. The service endpoint detection method according to any one of claims 1 to 4, characterized in that: The monitoring pod message includes: A service monitor is created for each pod in the DPU, and pod messages of the corresponding pod are monitored based on the service monitor.
7. A service endpoint detection device based on DPU, characterized in that: include: The acquisition module is used to obtain the health check list; The health check table includes endpoint information of the service endpoint to be checked and pod information of the pod corresponding to the service endpoint to be checked; A sending module, used to periodically send a detection request to the pod corresponding to the endpoint information according to the health check table, and monitor pod messages; A processing module, configured to delete the endpoint information of the target endpoint from the load balancing flow table when it is determined that the target endpoint is unavailable according to a pod message of the pod corresponding to the target endpoint; The target endpoint is any service endpoint in the health check table, and the load balancing flow table includes endpoint information of multiple service endpoints, which is used to indicate the pod for traffic distribution.
8. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the DPU-based service endpoint detection method according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium, characterized in that: include: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the DPU-based service endpoint detection method according to any one of claims 1 to 6 is implemented.
10. A computer program product, characterized in that When the computer program product is executed on a computer, the computer is enabled to implement the DPU-based service endpoint detection method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Load balanced access to distributed endpoints using global network addresses
CN113196725A
State controller running in a kubernetes system and method for operating same
CN113366802A
Management of distributed endpoints
CN114503531A
Monitoring method of Kubernetes component and server
CN114884838A
Cross-cluster load balancing method and device, equipment and storage medium
CN115499444A
