Dpu-based server endpoint detection method, apparatus, and storage medium
By periodically detecting service endpoints in the DPU environment and deleting unavailable endpoint information based on Pod messages, traffic forwarding errors caused by service endpoint problems are resolved, improving user experience.
Patent Information
- Application Number
- CN202411265322.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-10
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2044-09-10
AI Technical Summary
In an OVN-based Kubernetes DPU environment, when a problem occurs with the service endpoint, traffic accessing the service may be forwarded to the problematic Pod, affecting the user experience.
By obtaining the health check table, periodically sending detection requests to the Pod corresponding to the endpoint information and monitoring the Pod messages, when it is determined that the target endpoint is unavailable based on the Pod message, the endpoint information of the target endpoint is deleted from the load balancing flow table.
This prevents traffic from being forwarded to problematic Pods, improves user experience, and ensures that traffic is forwarded to normal Pods.
Smart Images

Figure CN119094389B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of communication, and particularly relates to a service endpoint detection method and device based on DPU and a storage medium. BACKGROUND
[0002] In Kubernetes, a service is an important resource object, which can provide network access for a group of pods through an endpoint. The endpoint is a bridge between the service and the pod. When the service selects a group of pods through a selector, the endpoints controller of Kubernetes creates corresponding endpoints for these pods, which contain the IP addresses and port numbers of all the pods selected by the service.
[0003] In the existing Kubernetes data processing unit (DPU) environment based on an open virtual network (OVN), Kubernetes automatically listens to the start and stop states of the pod and removes the dead pod. An OVN controller runs on a DPU system on chip (Soc), and the OVN controller is responsible for traffic forwarding and load balancing configuration on the DPU. When a pod is removed, the OVN controller receives an update notification from the OVN control plane, so as to update the traffic forwarding and load balancing rules inside the DPU, and ensure that the traffic is not forwarded to the dead pod.
[0004] However, when the service endpoint has a problem, the traffic accessing the service on the DPU may still be forwarded to the problematic pod, thereby affecting the business of the customer pod and leading to poor user experience. SUMMARY
[0005] In order to solve the above technical problems, the present application provides a service endpoint detection method and device based on DPU and a storage medium, which solves the problem that the traffic is forwarded to the problematic pod due to the problem of the service endpoint, and improves the user experience.
[0006] In a first aspect, the present application provides a DPU-based service endpoint detection method, comprising: obtaining a health check table; the health check table comprising endpoint information of a service endpoint to be checked and pod information of a pod corresponding to the service endpoint to be checked; periodically sending a probe request to the pod corresponding to the endpoint information according to the health check table, and listening to pod messages; when it is determined that a target endpoint is unavailable according to the pod messages of the pod corresponding to the target endpoint, deleting the endpoint information of the target endpoint from a load balancing flow table; the target endpoint is any service endpoint in the health check table, and the load balancing flow table comprises endpoint information of multiple service endpoints and is used to indicate a pod for traffic distribution.
[0007] In some embodiments, the health check table further comprises a timeout duration corresponding to each service endpoint to be checked; and the determination that the target endpoint is unavailable according to the pod messages of the pod corresponding to the target endpoint comprises: when a packet unreachable message sent by the pod corresponding to the target endpoint is listened to, it is determined that the target endpoint is unavailable; or when the pod messages of the pod corresponding to the target endpoint are not listened to within the timeout duration corresponding to the target endpoint, it is determined that the target endpoint is unavailable.
[0008] In some embodiments, the health check table further comprises a failure number corresponding to each service endpoint to be checked; and the determination that the target endpoint is unavailable according to the pod messages of the pod corresponding to the target endpoint comprises: when a packet unreachable message sent by the pod corresponding to the target endpoint is listened to, or when the pod messages of the pod corresponding to the target endpoint are not listened to within the timeout duration corresponding to the target endpoint, the failure number corresponding to the target endpoint is incremented by one to obtain a new failure number; and when the new failure number is greater than a preset threshold, it is determined that the target endpoint is unavailable.
[0009] In some embodiments, the health check table further comprises a normal number corresponding to each service endpoint to be checked; and after the listening to the pod messages, the method further comprises: when a packet reachable message sent by the pod corresponding to the target endpoint is listened to, the normal number corresponding to the target endpoint is incremented by one.
[0010] In some embodiments, the health check table further comprises a periodic duration corresponding to each service endpoint to be checked; and the periodically sending a probe request to the pod corresponding to the endpoint information according to the health check table comprises: periodically sending a probe request to the pod corresponding to the endpoint information of the service endpoint according to the periodic duration corresponding to the service endpoint in the health check table.
[0011] In some embodiments, the listening to the pod messages comprises: creating a service monitor for each pod in the DPU, and monitoring the pod messages of the corresponding pod based on the service monitor.
[0012] In a second aspect, the present application provides a DPU-based service endpoint detection device, comprising: an acquisition module configured to acquire a health check table; the health check table comprising endpoint information of a service endpoint to be checked and pod information of a pod corresponding to the service endpoint to be checked; a sending module configured to periodically send a probe request to the pod corresponding to the endpoint information according to the health check table, and listen to pod messages; and a processing module configured to delete the endpoint information of a target endpoint from a load balancing flow table when it is determined that the target endpoint is unavailable according to the pod messages of the pod corresponding to the target endpoint; the target endpoint being any service endpoint in the health check table, and the load balancing flow table comprising endpoint information of a plurality of service endpoints and being used to indicate a pod for traffic distribution.
[0013] In some embodiments, the health check table further comprises a timeout duration corresponding to each service endpoint to be checked; and the processing module is specifically configured to: determine that the target endpoint is unavailable when a message unreachable message sent by the pod corresponding to the target endpoint is listened to; or determine that the target endpoint is unavailable when no pod message of the pod corresponding to the target endpoint is listened to within the timeout duration corresponding to the target endpoint.
[0014] In some embodiments, the health check table further comprises a failure number corresponding to each service endpoint to be checked; and the processing module comprises a processing submodule and a determination submodule; the processing submodule is configured to add one to the failure number corresponding to the target endpoint to obtain a new failure number when a message unreachable message sent by the pod corresponding to the target endpoint is listened to or when no pod message of the pod corresponding to the target endpoint is listened to within the timeout duration corresponding to the target endpoint; and the determination submodule is configured to determine that the target endpoint is unavailable when the new failure number is greater than a preset threshold.
[0015] In some embodiments, the health check table further comprises a normal number corresponding to each service endpoint to be checked; and the processing module is further configured to add one to the normal number corresponding to the target endpoint when a message reachable message sent by the pod corresponding to the target endpoint is listened to.
[0016] In some embodiments, the health check table further comprises a periodic duration corresponding to each service endpoint to be checked; and the sending module is specifically configured to periodically send a probe request to the pod corresponding to the endpoint information of the service endpoint according to the periodic duration corresponding to the service endpoint in the health check table.
[0017] In some embodiments, the sending module comprises a listening submodule; and the listening submodule is configured to create a service monitor for each pod in the DPU, and monitor the pod messages of the corresponding pod based on the service monitor.
[0018] In a third aspect, the present application provides a computer readable storage medium, comprising: a computer program stored on the computer readable storage medium, the computer program being executed by a processor to implement the DPU-based service endpoint detection method according to the first aspect.
[0019] In a fourth aspect, the present application provides a computer program product, comprising: when the computer program product is run on a computer, causing the computer to implement the DPU-based service endpoint detection method according to the first aspect.
[0020] The technical scheme provided by the present application has the following advantages compared with the prior art: first, a health check table is obtained. The health check table includes endpoint information of a service endpoint to be checked and pod information of a pod corresponding to the service endpoint to be checked. Then, according to the health check table, a probe request is periodically sent to the pod corresponding to the endpoint information, and a pod message is listened to. Finally, when it is determined that a 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 a 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 and indicates a pod for traffic distribution. In this way, a probe request can be sent to a pod corresponding to a service endpoint, and a response message (i.e., a pod message) of the probe request can be used to determine whether the service endpoint is available. When the service endpoint is unavailable, the endpoint information corresponding to the service endpoint is deleted from the load balancing flow table in a timely manner, avoiding the problem that when a service endpoint has a problem, traffic accessing the service may still be forwarded to the problematic pod, affecting the business of the customer pod, and improving the user experience. BRIEF DESCRIPTION OF DRAWINGS
[0021] The accompanying drawings, which are incorporated into and form part of the specification, illustrate embodiments consistent with the present application and, together with the specification, serve to explain the principles of the application.
[0022] In order to more clearly illustrate the technical schemes in the embodiments of the present application or the prior art, the accompanying drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, for those skilled in the art, other drawings can also be obtained without creative labor based on these drawings.
[0023] Figure 1 One of the flowcharts of the DPU-based service endpoint detection method provided by the embodiments of the present application;
[0024] Figure 2 The application scenario diagram of the DPU-based service endpoint detection method provided by the embodiments of the present application;
[0025] Figure 3 Figure 2 is a flowchart of a method for detecting a service endpoint based on a DPU according to an embodiment of the present application;
[0026] Figure 4 Figure 3 is a flowchart of a method for detecting a service endpoint based on a DPU according to an embodiment of the present application;
[0027] Figure 5 Figure 4 is a flowchart of a method for detecting a service endpoint based on a DPU according to an embodiment of the present application;
[0028] Figure 6 Figure 5 is a flowchart of a method for detecting a service endpoint based on a DPU according to an embodiment of the present application;
[0029] Figure 7 Figure 6 is a structural diagram of a device for detecting a service endpoint based on a DPU according to an embodiment of the present application;
[0030] Figure 8 Figure 7 is a structural diagram of an electronic device according to 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 schemes 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 in order to provide a thorough understanding of the present application, but the present application can also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only some of the embodiments of the present application, not all the embodiments.
[0033] First, some terms or terms involved in the specification and claims of the present application will be explained below.
[0034] DPU: Data Processing Unit is a processor specially designed for processing data-intensive tasks, designed to accelerate data center network and storage workloads. DPU combines network interface cards, high-performance processors and flexible programmable data paths to optimize data processing and network performance. Unlike CPU and GPU, it is mainly responsible for data movement, data processing and data security, etc.
[0035] Kubernetes: abbreviated as k8s, is an open source container orchestration platform that automates the deployment, management, scaling and network configuration of container applications, and is widely used in the management and deployment of modern cloud-native applications.
[0036] Pod: is the smallest deployment unit in Kubernetes, usually contains one or more tightly coupled containers, containers within a pod share network and storage, and can communicate with each other.
[0037] Service: is an important resource object, which can provide network access for a group of pods through endpoints.
[0038] Endpoint: is a bridge between service and pod, when service selects a group of pods through selector, Kubernetes' endpoints controller will create corresponding endpoints for this group of pods, which contains the IP address and port number of all pods selected by service.
[0039] VPC: Virtual Private Cloud (VPC) is a network service provided on cloud platform, used to create and manage virtualized private network environment, with isolation, customization, scalability and security characteristics. VPC allows users to create custom virtual networks in cloud environment, including IP address range, subnet, routing table and access control rules and other network resources. Each VPC is an isolated network environment, independent of other VPCs, and can create its own network topology and resources in it.
[0040] OVN: Open Virtual Network (OVN) is an open source, distributed virtual network solution, designed to provide powerful and flexible network services for cloud computing environment, which is built on OpenvSwitch (OVS) and aims 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.), providing powerful network functions for these platforms.
[0041] The DPU-based service endpoint detection method, device and storage medium provided by the embodiments of the present application will be described in detail in combination with the accompanying drawings and specific embodiments.
[0042] In the OVN Kubernetes solution using DPU, the large-scale cluster management is simple through the automatic scheduling and management functions of Kubernetes, and the distributed network architecture of OVN supports the network connection of large-scale DPU nodes and Pods, and the hardware acceleration provided by DPU significantly improves the network throughput and the reduction of latency. At the same time in the OVN-based Kubernetes DPU environment, Kubernetes automatically monitors the start and stop state of the Pod, removes the dead Pod, and runs the OVN controller on the DPU Soc, which is responsible for traffic forwarding and load balancing configuration on the DPU. When a Pod is removed, the OVN controller receives the update notification from the OVN control plane, thereby updating the traffic forwarding and load balancing rules inside the DPU, ensuring that the traffic will not be forwarded to the dead Pod.
[0043] However, when the service endpoint has a problem, the traffic accessing the service on the DPU may still be forwarded to the problematic Pod, thereby affecting the business of the customer Pod and causing poor user experience. Therefore, there is an urgent need for a method capable of detecting abnormal service endpoints to avoid the traffic accessing the service being forwarded to the problematic Pod.
[0044] To solve the above problems, the embodiments of the present application provide a service endpoint detection method based on DPU, which can obtain a health check table; the health check table includes endpoint information of a service endpoint to be checked and pod information of a pod corresponding to the service endpoint to be checked; according to the health check table, a probe request is periodically sent to the pod corresponding to the endpoint information, and the pod message is listened to; 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 and indicates the pod for traffic distribution. The method can detect the problematic service endpoint and delete it in time, thereby avoiding the traffic accessing the service being forwarded to the problematic Pod and 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, which can be hardware or software. When the DPU-based service endpoint detection device is hardware, it can be various electronic devices that have a DPU-based service endpoint detection function, including but not limited to mobile phones, 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 the 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. OVN components are deployed, including the OVN Northbound Database (NBDB), OVN Southbound Database (SBDB), and Ovn-Northd components on the master node 201. Components such as the Ovn-controller are deployed on the DPU node 202. OVS parameters on the DPU are configured, 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; and the host name (hostname) corresponding to the DPU node 202, so as to connect the DPU node 202 to 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 is created on the DPU node 202 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 backend pods and forwards traffic to the service to the backend pods on DPU node 202 based on the pre-obtained load balancing flow table. This completes the construction of an OVN-based Kubernetes DPU environment.
[0053] Then, obtain the health check table (Load_Balancer_Healthy_Check). 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.
[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 probe 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 endpoint information of the service endpoints to be checked. Since the service selects a group of pods through the selector, the Kubernetes endpoint controller creates corresponding service endpoints for the pods, and usually one pod corresponds to one service endpoint. The endpoint information of each service endpoint includes the IP address and port number of the pod selected by the service. Therefore, the endpoint information of the service endpoints 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 service can forward traffic to the corresponding pod according to the endpoint information of the service endpoint.
[0058] Therefore, according to the health check table, the way of periodically sending a probe request to the pod corresponding to the endpoint information can be sending a probe request to the pod corresponding to each service endpoint to be checked in the health check table according to the endpoint information of the service endpoint. 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] Secondly, listen to the pod message.
[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 in the life cycle of the pod entity, the pod information refers to the logical port of the pod. The way of listening to the pod message can be listening to the pod message of the pod corresponding to the logical port.
[0061] In some embodiments, the way of listening to the pod message can create a collective service monitor for listening to the pod message of all pods corresponding to the logical ports in the health check table.
[0062] S13、In a case that the target endpoint is determined to be 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.
[0063] The target endpoint is any service endpoint in the health check table. The load balancing flow table is obtained in advance 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 accessing the service is received, the load balancer (Load_Balancer) will forward the traffic accessing the service to the backend pod corresponding to the endpoint information in the load balancing flow table on the DPU node according to the load balancing flow table after deleting the endpoint information of the unavailable service endpoint, so as to ensure that the traffic of the service is forwarded to the normal pod.
[0065] In the above solution, a health check table is first obtained. The health check table includes endpoint information for the service endpoint to be checked and pod information for the pod corresponding to the service endpoint. Then, based on the health check table, probe requests are periodically sent to the pod corresponding to the endpoint information and pod messages are monitored. Finally, if the target endpoint is determined to be unavailable based on the pod message from the pod corresponding to the target endpoint, the endpoint information for the target endpoint is deleted from the load balancing flow table. The target endpoint is any service endpoint in the health check table. The load balancing flow table includes endpoint information for multiple service endpoints, indicating the pods to which traffic is distributed. This allows probe requests to be sent to the pod corresponding to the service endpoint, and the availability of the service endpoint is determined based on the pod's response message to the probe request (i.e., pod message). If the service endpoint is unavailable, the endpoint information corresponding to the service endpoint is promptly deleted from the load balancing flow table. This avoids the problem where traffic to the service accessing the service may still be forwarded to the problematic pod due to service endpoint problems, affecting customer pod services, thereby improving the user experience.
[0066] In some embodiments, the health check table also includes the interval of each service endpoint to be checked. 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, periodically send a detection request to the pod corresponding to the endpoint information of the service endpoint.
[0068] In the above solution, the health check table also includes the check cycle duration for each service endpoint to be checked. Based on the cycle duration of the service endpoint in the health check table, probe requests are periodically sent to the pod corresponding to the endpoint information of the service endpoint. This allows users to flexibly set the check cycle duration for each service endpoint to be checked through the health check table, improving the flexibility of the DPU-based service endpoint detection method.
[0069] In some embodiments, as 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 messages 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 the pod message of the corresponding pod is monitored based on the service monitor.
[0072] In the above scheme, a service monitor is created for each pod, and the pod message of the corresponding pod is monitored based on the service monitor, which can manage each pod individually and ensure the isolation and security of the pod message corresponding to each pod.
[0073] In some embodiments, the health check table further includes a timeout corresponding to each service endpoint to be checked, such as Figure 5 As shown, the way to determine that the target endpoint is unavailable according to the pod message of the pod corresponding to the target endpoint can include any of the following steps:
[0074] S131, when a message unreachable message sent by the pod corresponding to the target endpoint is listened to, it is determined that the target endpoint is unavailable.
[0075] For example, after sending a probe request, it is determined that a service endpoint is unavailable when an Internet Control Message Protocol (ICMP) message unreachable message is sent by the pod corresponding to the service endpoint.
[0076] S132, when the pod message of the pod corresponding to the target endpoint is not listened to within the timeout corresponding to the target endpoint, it is determined that the target endpoint is unavailable.
[0077] For example, after sending a probe request of a target endpoint, it is determined that the target endpoint is unavailable when an ICMP message reachable message of the pod corresponding to the target endpoint is not received within the timeout corresponding to the target endpoint in the health check table.
[0078] In the above scheme, when a message unreachable message sent by the pod corresponding to the target endpoint is listened to, or when the pod message is not received within the timeout, it is determined that the target endpoint is unavailable, so as to timely delete the endpoint information corresponding to the service endpoint from the load balancing flow table, thereby avoiding the problem that the traffic accessing the service may still be forwarded to the problematic pod due to the problem of the service endpoint, affecting the customer pod business, and improving the user experience.
[0079] In some embodiments, the health check table further includes a failure count corresponding to each service endpoint to be checked, such as Figure 6As shown, the manner of determining that the target endpoint is unavailable according to the pod message of the pod corresponding to the target endpoint can include the following steps:
[0080] S134, when the unreachable message sent by the pod corresponding to the target endpoint is listened to, or when the pod message of the pod corresponding to the target endpoint is not listened to within the timeout duration, the failure number corresponding to the target endpoint is incremented by one to obtain a new failure number.
[0081] S135, when the new failure number is greater than a preset threshold, it is determined that the target endpoint is unavailable.
[0082] The preset threshold can be a default value or a value set by relevant personnel according to actual conditions.
[0083] In some embodiments, when the new failure number is less than or equal to the preset threshold, it is determined that the target endpoint is available.
[0084] In the above scheme, when the failure number is greater than the preset threshold, it is determined that the target endpoint is unavailable, which avoids the problem of occasional unavailability of the target endpoint due to other environmental factors (such as network problems), and improves the overall fault tolerance of the system.
[0085] In some embodiments, the health check table further includes a success count (success_count) corresponding to each service endpoint to be checked. After listening to the pod message, the DPU-based service endpoint detection method further includes: when the reachable message sent by the pod corresponding to the target endpoint is listened to, the success count corresponding to the target endpoint is incremented by one.
[0086] In the above scheme, the number of successful service endpoint detection can be recorded, so that relevant personnel can intuitively understand the detection situation of each service endpoint, and the user experience is improved.
[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 waste of resources.
[0088] In some embodiments, the DPU-based service endpoint detection method further includes: periodically checking the load balancing flow table, and determining the availability of the service endpoint on the DPU environment according to the remaining endpoint information in the load balancing flow table, to ensure that the service endpoint of the key service in the network is not deleted, thereby guaranteeing the stability and reliability of the service.
[0089] The embodiments of the present application can divide the function modules of the DPU-based service endpoint detection apparatus according to the above method examples. For example, each function module can be divided according to each function, or two or more functions can be integrated in one processing unit. The integrated module can be realized in the form of hardware or in the form of a software function module. It should be noted that the division of the modules in the embodiments of the present application is illustrative, and is only a logical function division. In actual implementation, another division mode can be used.
[0090] As shown in FIG. 7, a structure schematic diagram of the DPU-based service endpoint detection apparatus provided by the embodiments of the present application is shown, which includes an acquisition module 71, a sending module 72, and a processing module 73. Figure 7 The acquisition module 71 is configured to acquire a health check table. The health check table includes endpoint information of a service endpoint to be checked and pod information of a pod corresponding to the service endpoint to be checked. The sending module 72 is configured to periodically send a probe request to the pod corresponding to the endpoint information according to the health check table and listen to a pod message. The processing module 73 is configured to delete the endpoint information of a target endpoint from a 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. The load balancing flow table includes endpoint information of multiple service endpoints and is used to indicate a pod for traffic distribution.
[0091] In some embodiments, the health check table further includes a timeout duration corresponding to each service endpoint to be checked. The processing module 73 is specifically configured to determine that the target endpoint is unavailable when a message unreachable message sent by the pod corresponding to the target endpoint is listened to, or determine that the target endpoint is unavailable when the pod message of the pod corresponding to the target endpoint is not listened to within the timeout duration corresponding to the target endpoint.
[0092] In some embodiments, the health check table further includes a failure number corresponding to each service endpoint to be checked. The processing module 73 includes a processing submodule and a determination submodule. The processing submodule is configured to add one to the failure number corresponding to the target endpoint to obtain a new failure number when the message unreachable message sent by the pod corresponding to the target endpoint is listened to, or when the pod message of the pod corresponding to the target endpoint is not listened to within the timeout duration corresponding to the target endpoint. The determination submodule is configured to determine that the target endpoint is unavailable when the new failure number is greater than a preset threshold.
[0093] In some embodiments, the health check table further includes a failure number corresponding to each service endpoint to be checked. The processing module 73 includes a processing submodule and a determination submodule. The processing submodule is configured to add one to the failure number corresponding to the target endpoint to obtain a new failure number when the message unreachable message sent by the pod corresponding to the target endpoint is listened to, or when the pod message of the pod corresponding to the target endpoint is not listened to within the timeout duration corresponding to the target endpoint. The determination submodule is configured to determine that the target endpoint is unavailable when the new failure number is greater than a preset threshold.
[0094] In some embodiments, the health check table further includes a normal number of times corresponding to each service endpoint to be checked; the processing module 73 is further configured to, in response to listening to a message reachable message sent by a pod corresponding to a target endpoint, increase the normal number of times corresponding to the target endpoint by one.
[0095] In some embodiments, the health check table further includes a cycle duration corresponding to each service endpoint to be checked; the sending module 72 is specifically configured to periodically send a probe request to a pod corresponding to endpoint information of a service endpoint according to a cycle duration corresponding to the service endpoint in the health check table.
[0096] In some embodiments, the sending module 72 includes a listening sub-module; the listening sub-module is configured to create a service monitor for each pod in the DPU, and monitor a pod message of the corresponding pod based on the service monitor.
[0097] The DPU-based service endpoint detection apparatus provided in the embodiment can execute the DPU-based service endpoint detection method provided in the method embodiment, and has similar implementation principles and technical effects, which will not be described here.
[0098] Figure 8 An electronic device according to an exemplary embodiment is shown. The electronic device can include a processor 802 configured to execute application code to implement the DPU-based service endpoint detection method in the present application.
[0099] The processor 802 can 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] As shown in Figure 8 The electronic device can further include a memory 803. The memory 803 is configured to store the application code for executing the program of the present application, and is controlled by the processor 802 to execute.
[0101] The memory 803 may be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM) or other type of dynamic storage device 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, an optical disc storage (including a compact 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 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. Furthermore, the electronic device provided in this embodiment can execute the DPU-based service endpoint detection method provided in the above method embodiment. Its implementation principles and technical effects are similar to those of the above method and are not further described here.
[0104] An embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the various processes of the DPU-based service endpoint detection method in the above-mentioned method embodiment and can achieve the same technical effect. 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.
[0106] The computer program product stores a computer program, and the computer program is executed by a processor to implement each process of the DPU-based service endpoint detection method in the method embodiments, and the same technical effects can be achieved. To avoid repetition, details are not described herein.
[0107] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media having computer-usable program code embodied in the medium.
[0108] In the present application, the memory can include a 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 memory (flash RAM). The memory is an example of a computer readable medium.
[0109] In the present application, the computer readable medium includes permanent and non-permanent, removable and non-removable storage media. The storage medium can be implemented by any method or technology to store information, and the information can be computer readable instructions, data structures, program modules 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 technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible by a computing device. According to the definition herein, the computer readable medium does not include transitory media, such as modulated data signals and carriers.
[0110] It has to be noted that, in the present document, relational terms are intended only to convey a possible relationship between elements or
[0111] The above description is merely that of a specific implementation to enable a person skilled in the art to understand or implement the application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein can be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments described herein but is to be accorded 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 probe request to the pod corresponding to the endpoint information and monitor pod messages; 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; 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: If a message indicating that the pod corresponding to the target endpoint is unreachable is detected, or if no pod message from the pod corresponding to the target endpoint is detected within the timeout period corresponding to the target endpoint, the failure count corresponding to the target endpoint is increased by one to obtain a new failure count. When the new number of failures is greater than a preset threshold, it is determined that the target endpoint is unavailable.
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 indicating that the target endpoint is unreachable is detected, the target endpoint is determined to be 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, wherein: 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 reachable message is detected from the pod corresponding to the target endpoint, the normal number of times corresponding to the target endpoint is increased by one.
4. The service endpoint detection method according to any one of claims 1 to 3, characterized in that: The health check table also includes the check cycle duration corresponding to each service endpoint to be checked; The step of periodically sending a probe request to the 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.
5. The service endpoint detection method according to any one of claims 1 to 3, 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.
6. A service endpoint detection device based on DPU, characterized in that: include: Acquisition module, used to obtain 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 is used to periodically send a probe 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 determining that the target endpoint is unavailable based on 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 for indicating the pod to which traffic is distributed; The health check table also includes the number of failures corresponding to each service endpoint to be checked; The processing module includes a processing submodule and a determination submodule; The processing submodule is used to increase the failure count corresponding to the target endpoint by one to obtain a new failure count when a message unreachable is received from the pod corresponding to the target endpoint, or when a pod message from the pod corresponding to the target endpoint is not received within the timeout period corresponding to the target endpoint. The determination submodule is used to determine that the target endpoint is unavailable when the number of new failures is greater than a preset threshold.
7. 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 5 is implemented.
8. 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 5 is implemented.
9. 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 5.
Citation Information
Patent Citations
State controller running in a kubernetes system and method for operating same
CN113366802A
Scalable and reliable monitoring of protected endpoints
US20240286624A1