Method, device and equipment for detecting DPU virtual interface in cloud native and medium
By implementing the DPU virtual interface detection method in the K8s environment, the problem that the load balancer cannot detect virtual interface exceptions in time is solved, and timely detection and processing of virtual interface exceptions is realized, which improves user experience and system reliability.
Patent Information
- Application Number
- CN202411568117.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-05
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2044-11-05
AI Technical Summary
In the K8s environment, when the data processor and the pod container communicate through a virtual interface, if an exception occurs in the virtual interface corresponding to the data processor and/or the pod container, the load balancer cannot discover it in time, resulting in the traffic accessing the service being still forwarded to the abnormal pod container, affecting customer business.
In a cloud native environment, by implementing the DPU virtual interface detection method on the control node, the target container corresponding to the target service is determined, and the virtual interface detection is performed based on the service monitor. If no reply message is received within the preset time, it is determined that an exception occurred in the virtual interface.
By promptly discovering virtual interface exceptions of the target container, avoiding forwarding of traffic to the abnormal target container to the abnormal, improving user experience and system reliability.
Smart Images

Figure CN119782054A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of cloud native technology, and in particular to a method, device, equipment and medium for detecting a DPU virtual interface in cloud native. Background Art
[0002] Kubernetes, abbreviated as K8s, is an open source container orchestration and management platform for automating the deployment, expansion and management of containerized applications.
[0003] In the existing K8s environment, when the old pod container of the working node is deleted or a new pod container is created, the load balancing rule is updated by the load balancer to implement the open virtual network load balancing function to ensure that the traffic will no longer be forwarded to the deleted pod container. However, when a data processor is deployed in the working node, the data processor communicates with the pod container through a virtual interface. If the virtual interface corresponding to the data processor and / or pod container is abnormal, the load balancer cannot detect the abnormality of VF or VFR, and the traffic accessing the service will still be forwarded to the pod container corresponding to the abnormal VF or VFR, thereby affecting the customer's business. Summary of the invention
[0004] In order to solve the above technical problems, the present disclosure provides a DPU virtual interface detection method, device, equipment and medium in cloud native.
[0005] A first aspect of an embodiment of the present disclosure provides a DPU virtual interface detection method in a cloud native, which is applied to a control node in a cluster, including:
[0006] Determine at least one target container corresponding to the target service;
[0007] For each target container, an echo request message is sent to the target container based on the service monitor corresponding to the target container, where the echo request message is used to detect the virtual interface corresponding to the target container;
[0008] If a reply message returned by the target container in response to the echo request message is not received within a first preset time, it is determined that an abnormality has occurred in the virtual interface corresponding to the target container, and the virtual interface corresponding to the target container includes a first virtual interface corresponding to the target container in the working node of the cluster, and / or a second virtual interface corresponding to the first virtual interface in the data processor deployed in the working node.
[0009] A second aspect of an embodiment of the present disclosure provides a DPU virtual interface detection device in a cloud native, including:
[0010] A container determination module, used to determine at least one target container corresponding to a target service;
[0011] A message sending module, used for sending an echo request message to each target container based on a service monitor corresponding to the target container, where the echo request message is used to detect a virtual interface corresponding to the target container;
[0012] An interface detection module is used to determine that an abnormality occurs in a virtual interface corresponding to the target container if no reply message is received from the target container in response to an echo request message within a first preset time. The virtual interface corresponding to the target container includes a first virtual interface corresponding to the target container in a working node of the cluster, and / or a second virtual interface corresponding to the first virtual interface in a data processor deployed in the working node.
[0013] A third aspect of the embodiments of the present disclosure provides an electronic device, including:
[0014] processor;
[0015] A memory for storing executable instructions;
[0016] Among them, the processor is used to read executable instructions from the memory and execute the executable instructions to implement the DPU virtual interface detection method in cloud native provided by the first aspect above.
[0017] The fourth aspect of an embodiment of the present disclosure provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the processor implements the DPU virtual interface detection method in cloud native provided by the first aspect above.
[0018] Compared with the prior art, the technical solution provided by the embodiments of the present disclosure has the following advantages:
[0019] The DPU virtual interface detection method, device, equipment and medium in cloud native provided by the embodiments of the present disclosure can determine at least one target container corresponding to the target service; for each target container, an echo request message for detecting the virtual interface corresponding to the target container is sent to the target container based on the service monitor corresponding to the target container; if a reply message returned by the target container for the echo request message is not received within the first preset time, it is determined that an abnormality has occurred in the virtual interface corresponding to the target container, and the virtual interface corresponding to the target container includes a first virtual interface corresponding to the target container in the working node of the cluster, and / or a second virtual interface corresponding to the first virtual interface in the data processor deployed in the working node. Therefore, the virtual interface corresponding to the target container can be detected by deploying a service monitor corresponding to each target container, and when an abnormality occurs in the virtual interface corresponding to the target container, it can be discovered in time, thereby avoiding forwarding traffic accessing the service to the target container where the virtual interface has an abnormality, thereby improving user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0021] In order to more clearly illustrate the embodiments of the present invention 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.
[0022] Figure 1 It is a flow chart of a DPU virtual interface detection method in cloud native provided by an embodiment of the present disclosure;
[0023] Figure 2 is a schematic diagram of an application scenario provided by an embodiment of the present disclosure;
[0024] Figure 3 is a flow chart of another DPU virtual interface detection method in cloud native provided by an embodiment of the present disclosure;
[0025] Figure 4 It is a structural diagram of a DPU virtual interface detection device in cloud native provided by an embodiment of the present disclosure;
[0026] Figure 5 It is a structural schematic diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0027] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0028] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0029] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0030] 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.
[0031] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0032] Normally, in the existing K8s environment, the load balancer in the data processor node of the working node will bind the backend pod container selected by the service. After discovering that the old pod container in the data processor node is deleted or the new pod container is created, the load balancing rule on the data processor node is updated to implement the open virtual network load balancing function, ensuring that the traffic will no longer be forwarded to the deleted pod container. However, after an abnormality occurs in the first virtual interface corresponding to the pod container in the working node or the second virtual interface (VFR) corresponding to the first virtual interface (VF) on the data processor node, the load balancer cannot detect that the VF or VFR has an abnormality, and the traffic accessing the service will still be forwarded to the pod container corresponding to the abnormal VF or VFR, thereby affecting the customer's business. To address this problem, the embodiments of the present disclosure provide a DPU virtual interface detection method in cloud native, which is described below in conjunction with specific embodiments.
[0033] Figure 1 The present invention provides a flowchart of a method for detecting a DPU virtual interface in a cloud native system. The method can be performed by a DPU virtual interface detection device in a cloud native system. The DPU virtual interface detection device in a cloud native system can be implemented in software and / or hardware. The DPU virtual interface detection device in a cloud native system can be configured in an electronic device, such as a server, a server cluster, or a terminal. The terminal specifically includes a computer or a tablet computer. In addition, the method can be applied to Figure 2In the application scenario shown, the cluster 200 in the application scenario includes a control node 20 and a working node 30. It should be noted that the number of working nodes in the cluster 200 can be multiple. It can be understood that the DPU virtual interface detection method in cloud native provided by the embodiment of the present disclosure can also be applied in other scenarios.
[0034] The DPU virtual interface detection method in cloud native can be applied in cloud native scenarios, where the cluster can be a container orchestration system, such as a K8s cluster. Among them, a container orchestration system such as a K8s cluster consists of a control node and a working node. A data processor (Data Processing Unit, DPU) can be deployed in the working node to offload computing-intensive network and storage tasks to the data processor for processing, thereby reducing the load on the host central processing unit of the working node and improving the overall system performance. Among them, the data processor completes the traffic forwarding plane work by deploying an open virtual network controller and an open virtual switch. And the load balancer of the data processor in the working node will bind the backend pod container selected by the service, and interact with the backend pod container through a virtual interface. Among them, the load balancer is responsible for the management of load balancing rules, such as updating load balancing rules, to ensure smooth communication with the backend pod container.
[0035] like Figure 2 As shown, the cluster 200 includes a control node 20 and a working node 30 .
[0036] The control node 20 is the control center of the entire cluster and is responsible for managing and coordinating the containers on the working nodes. Specifically, it is responsible for managing the status of the entire cluster, adding, deleting, and managing working nodes, etc.
[0037] The working node 30 is a working unit in the cluster, responsible for running containers and providing services.
[0038] Specifically, the control node 20 includes an OVN northbound database 21, a first virtual network controller 22 and an OVN southbound database 23.
[0039] The OVN northbound database 21 is used to store high-level logical network configurations, including configurations of logical switches, logical routers, security groups, etc. The OVN northbound database 21 is configured with a load balancing health check component 211, wherein the load balancing health check component 211 specifies the virtual IP address (i.e., VIP) and port number corresponding to the service to be detected.
[0040] The OVN southbound database 23 is used to store low-level logical states and data. Among them, a service monitor is configured in the OVN southbound database 23. The service monitor is created based on the virtual IP address (i.e., VIP) and port number corresponding to the service (sevice) to be detected specified in the load balancing health check component 211. The service monitor is used to send an echo request message to at least one container (such as a pod) corresponding to the target service to detect the virtual interface corresponding to at least one container.
[0041] The working node 30 includes a virtual private cloud environment 31 and a data processor 32 .
[0042] The virtual private cloud environment 31 includes multiple containers, such as container M and container N, each container corresponds to a first virtual interface, such as container M corresponds to virtual interface M, and container N corresponds to virtual interface N. The multiple containers correspond to different services respectively.
[0043] The data processor 32 includes a second virtual network controller 321 and a virtual network switch 322 . The virtual network switch 322 includes a virtual interface X and a virtual interface Y . The virtual interface X corresponds to the virtual interface M in a one-to-one manner, and the virtual interface Y corresponds to the virtual interface N in a one-to-one manner.
[0044] The control node 20 and the data processor 32 are connected via a tunnel established by the interface 1 and the interface 2 .
[0045] Combine the following Figure 2 The application scenario shown is Figure 1 The DPU virtual interface detection method in the cloud native shown in the figure is introduced. For example, Figure 2 The control node 20 in the embodiment can execute the method. Figure 1 As shown, the DPU virtual interface detection method in cloud native provided by this embodiment includes the following steps.
[0046] S110: Determine at least one target container corresponding to the target service.
[0047] In the embodiment of the present disclosure, at least one target container is a container set in a working node of the cluster for processing a target service.
[0048] The target service may be a UDP type service, ie, a service based on the User Datagram Protocol.
[0049] Specifically, when it is necessary to detect the virtual interface of the container, the control node may determine a target service to be detected, and determine at least one target container corresponding to the target service according to an association relationship between the target service and the backend container.
[0050] S120: For each target container, send an echo request message to the target container based on the service monitor corresponding to the target container, where the echo request message is used to detect the virtual interface corresponding to the target container.
[0051] In the embodiment of the present disclosure, the service monitor is set in the control node, and the service monitor is used to detect the virtual interface of the target container to determine whether an abnormality occurs in the virtual interface of the target container.
[0052] The echo request message may be an ICMP echo request message, wherein ICMP is the abbreviation of Internet Control Message Protocol, that is, Internet Control Message Protocol.
[0053] The virtual interface corresponding to the target container can be understood as a virtual interface used for communication between the target container and the data processor when a data processor is plugged into the working node, so as to facilitate the transmission of messages (including receiving messages and sending messages) corresponding to the target container through the data processor.
[0054] Specifically, after determining at least one target container corresponding to the target service, the control node determines, for each target container, a service monitor corresponding to the target container, and sends a message to the second virtual network controller in the data processor based on the service monitor, so that the second virtual network controller in the data processor sends an echo request message to the virtual network switch in the data processor based on the message.
[0055] The message includes the virtual IP address and port number corresponding to the target service, and the virtual interface check configuration parameters corresponding to the target container. The virtual interface check configuration parameters may specifically include the number of checks that the virtual interface corresponding to the target container is considered abnormal, the number of checks that the virtual interface corresponding to the target container is considered normal, and the timeout period for the health check.
[0056] In the embodiment of the present disclosure, the service monitor may send a message to the second virtual network controller in the data processor based on the tunnel between the control node and the data processor.
[0057] In some embodiments of the present disclosure, the target service includes endpoints for exposing the network address of the target service. The control node sends an echo request message to the target container based on the service monitor corresponding to the target container, and also periodically sends a message detection request to the endpoint corresponding to the target service based on the service monitor to detect the endpoint and ensure whether the endpoint is normal. The message detection request can be a UDP message detection request. UDP is the abbreviation of User Datagram Protocol, which is an important transport layer protocol in network communication.
[0058] S130. If a reply message returned by the target container for the echo request message is not received within the first preset time, it is determined that an abnormality occurs in the virtual interface corresponding to the target container, and the virtual interface corresponding to the target container includes a first virtual interface corresponding to the target container in the working node of the cluster, and / or a second virtual interface corresponding to the first virtual interface in the data processor deployed in the working node.
[0059] In the embodiment of the present disclosure, after the control node sends an echo request message to the target container based on the service monitor corresponding to the target container, the control node receives a reply message returned by the target container for the echo request message in real time. If a reply message returned by the target container for the echo request message is not received within a first preset time, it is determined that an abnormality occurs in the virtual interface corresponding to the target container.
[0060] Specifically, the reply message returned by the target container in response to the echo request message can be sent to the second virtual network controller based on the virtual network switch in the data processor, and the second virtual network controller sends the reply message to the control node based on the tunnel between the control node and the data processor.
[0061] The first virtual interface can be Figure 2 The virtual interface M and the virtual interface N shown in FIG. Figure 2 Virtual interface X and virtual interface Y are shown.
[0062] In an embodiment of the present disclosure, at least one target container corresponding to a target service can be determined; for each target container, an echo request message for detecting a virtual interface corresponding to the target container is sent to the target container based on a service monitor corresponding to the target container; if a reply message returned by the target container for the echo request message is not received within a first preset time, it is determined that an abnormality has occurred in the virtual interface corresponding to the target container, and the virtual interface corresponding to the target container includes a first virtual interface corresponding to the target container in a working node of the cluster, and / or a second virtual interface corresponding to the first virtual interface in a data processor deployed in the working node. Thus, the virtual interface corresponding to the target container can be detected by deploying a service monitor corresponding to each target container, and when an abnormality occurs in the virtual interface corresponding to the target container, it can be discovered in time, thereby avoiding forwarding traffic accessing the service to the target container where the virtual interface has an abnormality, thereby improving user experience.
[0063] In the above embodiment of the present disclosure, after sending an echo request message to the target container based on the service monitor corresponding to the target container, the DPU virtual interface detection method in the cloud native may also include: if a reply message returned by the target container for the echo request message is received within a first preset time, detecting the reply message, and continuing to send the echo request message to the target container based on the service monitor at an interval of a second preset time, and looping the above echo request message sending operation until the first preset threshold is reached; when the reply messages corresponding to the echo request messages are all detected to be normal, determining that the virtual interface corresponding to the target container is normal; when there are target reply messages with detected abnormalities in the reply messages corresponding to the echo request messages, and the number of target reply messages with detected abnormalities is greater than or equal to the second preset threshold, determining that the virtual interface corresponding to the target container has an abnormality.
[0064] In the embodiment of the present disclosure, the first preset time, that is, the timeout time of the health check in the virtual interface check configuration parameter, is used to indicate whether the reply message has timed out.
[0065] Specifically, if the control node receives a reply message returned by the target container for the echo request message within the first preset time, the control node detects the reply message based on a preset diagnostic tool to determine whether the reply message is normal, and at the same time continues to send the echo request message to the target container based on the service monitor at intervals of the first preset time, and the target container returns a reply message for the echo request message until the first preset threshold is reached.
[0066] Exemplarily, the first preset time is 3 seconds, and the first preset threshold is 5 times. At this time, the control node sends an echo request message to the target container based on the service monitor at the 1st second, and receives the reply message returned by the target container in real time, detects the reply message, and continues to send a second echo request message to the target container based on the service monitor at the 4th second, until it is sent 5 times, and the virtual interface detection for the target container ends this time; if all 5 reply messages are detected normally, it is determined that the virtual interface corresponding to the target container is normal, and if 4 of the 5 reply messages are detected abnormally, it is determined that the virtual interface corresponding to the target container is abnormal. Among them, the abnormal reply message detection may include displaying packet loss, etc.
[0067] Furthermore, after executing the detection of the virtual interface of the target container this time, the control node will periodically detect the virtual interface of the target container.
[0068] In the disclosed embodiment, after receiving the reply message, the reply message can be detected. When the reply message is detected to be normal, it is determined that the virtual interface corresponding to the target container is normal, thereby improving the accuracy of the virtual interface detection.
[0069] In an embodiment of the present disclosure, after determining that an abnormality occurs in the virtual interface corresponding to the target container, the DPU virtual interface detection method in the cloud native may also include: updating the load balancing rules in the data processor, and deleting the IP address corresponding to the target container in the load balancing rules.
[0070] In the disclosed embodiment, after detecting that an abnormality occurs in the virtual interface corresponding to the target container, the load balancing rules in the data processor can be updated and the IP address corresponding to the target container in the load balancing rules can be deleted to avoid forwarding the traffic corresponding to the target service to the target container, thereby avoiding the unavailability of the target service and improving the user experience.
[0071] In an embodiment of the present disclosure, before determining at least one target container corresponding to the target service, the DPU virtual interface detection method in the cloud native may also include: obtaining a first configuration parameter, the first configuration parameter including a virtual IP address and port number corresponding to the target service, and a virtual interface check configuration parameter corresponding to the target container; deploying a load balancing health check component based on the first configuration parameter; establishing a binding relationship between a logical port of at least one target container corresponding to the target service and the load balancing health check component.
[0072] Specifically, after obtaining the first configuration parameter, the control node deploys a load balancing health check component in the OVN northbound database based on the first configuration parameter, and establishes a binding relationship between the logical port of at least one target container corresponding to the target service and the load balancing health check component, so that the backend container corresponding to the target container can be identified based on the binding relationship.
[0073] Furthermore, determining at least one target container corresponding to the target service may specifically include: determining at least one target container corresponding to the target service based on the binding relationship.
[0074] In an embodiment of the present disclosure, before sending an echo request message to the target container based on the service monitor corresponding to the target container, the DPU virtual interface detection method in the cloud native may also include: creating a service monitor corresponding to each target container in at least one target container based on the first configuration parameter in the load balancing health check component.
[0075] Specifically, after the control node deploys the load balancing health check component in the OVN northbound database, based on the OVN mechanism, it automatically creates a service monitor corresponding to each target container in at least one target container in the OVN southbound database based on the first configuration parameter in the load balancing health check component. The service monitor specifies information such as the IP address and port corresponding to the target container, the logical port corresponding to the target container, and the protocol number.
[0076] In an embodiment of the present disclosure, before determining at least one target container corresponding to the target service, the DPU virtual interface detection method in the cloud native may also include: deploying a virtual network cluster environment based on a data processor, wherein a data processor is plugged into a working node in the cluster; obtaining a second configuration parameter, the second configuration parameter including a tunnel address corresponding to the data processor, a tunnel type connecting the data processor to the control node, a remote address of the control node, identification information corresponding to the data processor, and a name of the working node corresponding to the data processor; deploying a virtual network component based on the second configuration parameter, the virtual network component including a first virtual network component on the control node and a second virtual network component on the data processor.
[0077] Among them, tunnel types may include VXLAN tunnels, geneve tunnels, etc., which are not limited here.
[0078] Specifically, after obtaining the second configuration parameters, the control node deploys the first virtual network components such as the OVN northbound database, the OVN southbound database, and the first virtual network controller on the control node based on the second configuration parameters, and at the same time deploys the second virtual network components such as the second virtual network controller and the virtual network switch in the data processor.
[0079] In the embodiments of the present disclosure, deploying a virtual network cluster environment based on a data processor can be understood as deploying a virtual network environment adapted to the operation of the data processor in the cluster, which is similar to the existing implementation method of deploying a cluster environment based on a data processor, and will not be described in detail here. The specific deployment method of the virtual network components is similar to the specific method of performing virtual network components in the existing K8s cluster, and will not be described in detail here.
[0080] In the embodiment of the present disclosure, before detecting the virtual interface, the cluster environment can be deployed to adapt the cluster environment to the operation of the data processor, thereby providing support for subsequent virtual interface detection.
[0081] In an embodiment of the present disclosure, after deploying the virtual network component based on the second configuration parameters, the DPU virtual interface detection method in the cloud native may also include: creating at least one target container corresponding to the target service on the working node, determining a first virtual interface corresponding to the at least one target container, and adding the first virtual interface to the namespace where the target container is located; creating a second virtual interface corresponding to the first virtual interface on the data processor.
[0082] In the embodiment of the present disclosure, at least one target container corresponding to each target service can be created for processing access requests corresponding to the target service, and a first virtual interface and a second virtual interface can be added to each target container to implement interaction between the target container and the data processor based on the first virtual interface and the second virtual interface. Through the interaction between the target container and the data processor, tasks in the container can be offloaded to the data processor for execution, thereby improving system performance.
[0083] Figure 3 is a flowchart of another DPU virtual interface detection method in cloud native provided by an embodiment of the present disclosure, such as Figure 3 As shown, the DPU virtual interface detection method in the cloud native may specifically include the following steps:
[0084] S310: Deploy a virtual network cluster environment based on a data processor, where a data processor is plugged into a working node in the cluster.
[0085] S320. Obtain a second configuration parameter, and deploy a virtual network component based on the second configuration parameter, where the virtual network component includes a first virtual network component on the control node and a second virtual network component on the data processor.
[0086] S330. Create at least one target container corresponding to the target service on the working node, determine a first virtual interface corresponding to the at least one target container, add the first virtual interface to the namespace where the target container is located, and create a second virtual interface corresponding to the first virtual interface on the data processor.
[0087] In the embodiment of the present disclosure, before or after step S330, the control node may obtain preset configuration parameters, create a target service and an endpoint corresponding to the target service based on the preset configuration parameters, and establish a corresponding relationship between the target service and the target container. The target service specifies the virtual IP address, communication protocol, port number, etc. corresponding to the target service.
[0088] S340. Obtain a first configuration parameter, deploy a load balancing health check component and a service monitor corresponding to each target container based on the first configuration parameter, and establish a binding relationship between a logical port of at least one target container corresponding to the target service and the load balancing health check component.
[0089] S350: Determine at least one target container corresponding to the target service based on the binding relationship.
[0090] S360: For each target container, an echo request message is sent to the target container based on a service monitor corresponding to the target container, where the echo request message is used to detect a virtual interface corresponding to the target container.
[0091] S370: If a reply message returned by the target container in response to the echo request message is not received within the first preset time, it is determined that an abnormality occurs in the virtual interface corresponding to the target container.
[0092] S380: If a reply message returned by the target container in response to the echo request message is received within the first preset time, the reply message is detected, and the service monitor is continuously controlled to send the echo request message to the target container at intervals of a second preset time, and the above echo request message sending operation is repeated until the first preset threshold is reached.
[0093] S390: When the reply messages corresponding to the echo request messages are detected to be normal, determine that the virtual interface corresponding to the target container is normal.
[0094] S3010: When there is a target reply message with detection abnormality in the reply message corresponding to the echo request message, and the number of the target reply messages with detection abnormality is greater than or equal to a second preset threshold, determine that an abnormality occurs in the virtual interface corresponding to the target container.
[0095] In the disclosed embodiments, a virtual network cluster environment based on a data processor and virtual network components in the cluster can be deployed in the cluster, and a load balancing health check component can be deployed in the virtual network component of the control node. A service monitor corresponding to each target container is created based on the load balancing health check component, and the virtual interface of the target container corresponding to the target service is detected based on the service monitor. The various components are deployed before the virtual interface corresponding to the target container is detected. At least one target container corresponding to the target service and the virtual interface corresponding to the target container can be quickly identified, which facilitates the subsequent detection of the virtual interface corresponding to the target container. At the same time, by deploying a service monitor corresponding to each target container to detect the virtual interface corresponding to the target container, an abnormality in the virtual interface corresponding to the target container can be discovered in time, thereby avoiding forwarding traffic accessing the service to the target container where the virtual interface has an abnormality, thereby improving the user experience.
[0096] Figure 4 It is a structural diagram of a DPU virtual interface detection device in cloud native provided by an embodiment of the present disclosure.
[0097] In the disclosed embodiment, the cloud native DPU virtual interface detection device can be set in an electronic device, which is understood as a part of the functional modules in the above electronic device. Specifically, the electronic device can be a server, a server cluster or a terminal, wherein the terminal specifically includes a computer or a tablet computer, etc., which is not limited here.
[0098] like Figure 4As shown, the DPU virtual interface detection device 400 in the cloud native may include a container determination module 410, a message sending module 420 and an interface detection module 430.
[0099] The container determination module 410 may be used to determine at least one target container corresponding to a target service.
[0100] The message sending module 420 may be configured to send an echo request message to each target container based on a service monitor corresponding to the target container, where the echo request message is used to detect a virtual interface corresponding to the target container.
[0101] The interface detection module 430 can be used to determine that an abnormality has occurred in the virtual interface corresponding to the target container if no reply message is received from the target container in response to the echo request message within a first preset time. The virtual interface corresponding to the target container includes a first virtual interface corresponding to the target container in the working node of the cluster, and / or a second virtual interface corresponding to the first virtual interface in the data processor deployed in the working node.
[0102] In an embodiment of the present disclosure, at least one target container corresponding to a target service can be determined; for each target container, an echo request message for detecting a virtual interface corresponding to the target container is sent to the target container based on a service monitor corresponding to the target container; if a reply message returned by the target container for the echo request message is not received within a first preset time, it is determined that an abnormality has occurred in the virtual interface corresponding to the target container, and the virtual interface corresponding to the target container includes a first virtual interface corresponding to the target container in a working node of the cluster, and / or a second virtual interface corresponding to the first virtual interface in a data processor deployed in the working node. Thus, the virtual interface corresponding to the target container can be detected by deploying a service monitor corresponding to each target container, and when an abnormality occurs in the virtual interface corresponding to the target container, it can be discovered in time, thereby avoiding forwarding traffic accessing the service to the target container where the virtual interface has an abnormality, thereby improving user experience.
[0103] In some embodiments of the present disclosure, the cloud-native DPU virtual interface detection device 400 may further include a target detection module.
[0104] The target detection module may be configured to detect the reply message after sending an echo request message to the target container based on the service monitor corresponding to the target container, if a reply message returned by the target container for the echo request message is received within a first preset time, and continue to send the echo request message to the target container based on the service monitor at an interval of a second preset time, and loop the above echo request message sending operation until a first preset threshold is reached;
[0105] When the reply messages corresponding to the echo request messages are all detected to be normal, it is determined that the virtual interface corresponding to the target container is normal;
[0106] When there are target reply messages with detected abnormalities in the reply messages corresponding to the echo request messages, and the number of target reply messages with detected abnormalities is greater than or equal to a second preset threshold, it is determined that an abnormality occurs in the virtual interface corresponding to the target container.
[0107] In some embodiments of the present disclosure, the cloud-native DPU virtual interface detection device 400 may further include a rule updating module.
[0108] The rule updating module can be used to update the load balancing rules in the data processor and delete the IP address corresponding to the target container in the load balancing rules after determining that the virtual interface corresponding to the target container is abnormal.
[0109] In some embodiments of the present disclosure, the cloud-native DPU virtual interface detection device 400 may further include a first deployment module.
[0110] The first deployment module may be used to obtain first configuration parameters before determining at least one target container corresponding to the target service, the first configuration parameters including a virtual IP address and a port number corresponding to the target service, and a virtual interface check configuration parameter corresponding to the target container;
[0111] Deploy a load balancing health check component based on the first configuration parameter;
[0112] A binding relationship is established between the logical port of at least one target container corresponding to the target service and the load balancing health check component.
[0113] The container determination module 410 may be specifically configured to determine at least one target container corresponding to the target service based on the binding relationship.
[0114] In some embodiments of the present disclosure, the cloud-native DPU virtual interface detection device 400 may further include a monitor creation module.
[0115] The monitor creation module can be used to create a service monitor corresponding to each target container in at least one target container based on the first configuration parameter in the load balancing health check component before sending an echo request message to the target container based on the service monitor corresponding to the target container.
[0116] In some embodiments of the present disclosure, the cloud-native DPU virtual interface detection device 400 may further include a second deployment module.
[0117] The second deployment module may be used to deploy a virtual network cluster environment based on a data processor before determining at least one target container corresponding to the target service, wherein the data processor is plugged into a working node in the cluster;
[0118] Obtaining second configuration parameters, where the second configuration parameters include a tunnel address corresponding to the data processor, a tunnel type connecting the data processor and the control node, a remote address of the control node, identification information corresponding to the data processor, and a name of a working node corresponding to the data processor;
[0119] The virtual network components are deployed based on the second configuration parameters, the virtual network components including a first virtual network component on the control node and a second virtual network component on the data processor.
[0120] In some embodiments of the present disclosure, the cloud-native DPU virtual interface detection device 400 may further include a third deployment module.
[0121] The third deployment module may be used to, after deploying the virtual network component based on the second configuration parameter, create at least one target container corresponding to the target service on the working node, determine a first virtual interface corresponding to each of the at least one target container, and add the first virtual interface to the namespace where the target container is located;
[0122] A second virtual interface corresponding to the first virtual interface is created on the data processor.
[0123] It should be noted that Figure 4 The DPU virtual interface detection device 400 in cloud native shown can execute each step in the above method embodiment and realize each process and effect in the above method embodiment, which will not be elaborated here.
[0124] Figure 5 It is a structural schematic diagram of an electronic device provided by an embodiment of the present disclosure.
[0125] In the disclosed embodiment, Figure 5 The electronic device shown may be a server, a server cluster or a terminal, wherein the terminal specifically includes a computer or a tablet computer, etc., which is not limited here.
[0126] like Figure 5 As shown, the electronic device may include a processor 510 and a memory 520 storing computer program instructions.
[0127] Specifically, the processor 510 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present disclosure.
[0128] The memory 520 may include a large capacity memory for information or instructions. By way of example and not limitation, the memory 520 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a tape, or a universal serial bus (USB) drive, or a combination of two or more of these. Where appropriate, the memory 520 may include a removable or non-removable (or fixed) medium. Where appropriate, the memory 520 may be inside or outside the integrated gateway device. In a particular embodiment, the memory 520 is a non-volatile solid-state memory. In a particular embodiment, the memory 520 includes a read-only memory (ROM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (Electrically Erasable Programmable ROM, EEPROM), an electrically rewritable ROM (EAROM), or a flash memory, or a combination of two or more of these.
[0129] The processor 510 reads and executes the computer program instructions stored in the memory 520 to perform the steps of the DPU virtual interface detection method in cloud native provided by the embodiment of the present disclosure.
[0130] In one example, the electronic device may further include a transceiver 530 and a bus 540. Figure 5 As shown, the processor 510, the memory 520 and the transceiver 530 are connected via a bus 540 and communicate with each other.
[0131] The bus 540 includes hardware, software, or both. For example, but not limitation, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industrial Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a Memory bus, a MicroChannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable buses or a combination of two or more of these. Where appropriate, the bus 540 may include one or more buses.
[0132] The embodiments of the present disclosure also provide a computer-readable storage medium, which may store a computer program. When the computer program is executed by a processor, the processor implements the DPU virtual interface detection method in cloud native provided by the embodiments of the present disclosure.
[0133] The above-mentioned storage medium may, for example, include a memory 520 of computer program instructions, and the above-mentioned instructions may be executed by the processor 510 of the electronic device to complete the DPU virtual interface detection method in the cloud native provided by the embodiment of the present disclosure. Optionally, the storage medium may be a non-temporary computer-readable storage medium, for example, the non-temporary computer-readable storage medium may be a ROM, a random access memory (Random Access Memory, RAM), a compact disc read-only memory (CompactDiscROM, CD-ROM), a magnetic tape, a floppy disk, and an optical data storage device, etc.
[0134] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure 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 method for detecting a DPU virtual interface in cloud native, characterized in that: Applicable to the control nodes in the cluster, including: Determine at least one target container corresponding to the target service; For each target container, sending an echo request message to the target container based on a service monitor corresponding to the target container, where the echo request message is used to detect a virtual interface corresponding to the target container; If a reply message returned by the target container for the echo request message is not received within a first preset time, it is determined that an abnormality occurs in the virtual interface corresponding to the target container, and the virtual interface corresponding to the target container includes a first virtual interface corresponding to the target container in the working node of the cluster, and / or a second virtual interface corresponding to the first virtual interface in a data processor deployed at the working node.
2. The method according to claim 1, characterized in that After the service monitor corresponding to the target container sends an echo request message to the target container, the method further includes: If a reply message returned by the target container in response to the echo request message is received within the first preset time, the reply message is detected, and the echo request message is continuously sent to the target container based on the service monitor at an interval of a second preset time, and the echo request message sending operation is repeated until a first preset threshold is reached; When the reply messages corresponding to the echo request messages are all detected to be normal, determining that the virtual interface corresponding to the target container is normal; When there is a target reply message with detected abnormality in the reply message corresponding to the echo request message, and the number of the target reply messages with detected abnormality is greater than or equal to a second preset threshold, it is determined that an abnormality occurs in the virtual interface corresponding to the target container.
3. The method according to claim 1 or 2, characterized in that: After determining that an abnormality occurs in the virtual interface corresponding to the target container, the method further includes: The load balancing rule in the data processor is updated, and the IP address corresponding to the target container in the load balancing rule is deleted.
4. The method according to claim 1, characterized in that: Before determining at least one target container corresponding to the target service, the method further includes: Obtaining first configuration parameters, where the first configuration parameters include a virtual IP address and port number corresponding to the target service, and a virtual interface check configuration parameter corresponding to the target container; Deploy a load balancing health check component based on the first configuration parameters; Establishing a binding relationship between a logical port of at least one target container corresponding to the target service and the load balancing health check component; The determining at least one target container corresponding to the target service includes: At least one target container corresponding to the target service is determined based on the binding relationship.
5. The method according to claim 4, characterized in that Before the service monitor corresponding to the target container sends an echo request message to the target container, the method further includes: Based on the first configuration parameter in the load balancing health check component, a service monitor corresponding to each target container in the at least one target container is created.
6. The method according to claim 1, characterized in that: Before determining at least one target container corresponding to the target service, the method further includes: Deploy a virtual network cluster environment based on a data processor, wherein the data processor is plugged into a working node in the cluster; Acquire second configuration parameters, where the second configuration parameters include a tunnel address corresponding to the data processor, a tunnel type connecting the data processor and the control node, a remote address of the control node, identification information corresponding to the data processor, and a name of a working node corresponding to the data processor; Virtual network components are deployed based on the second configuration parameters, the virtual network components including a first virtual network component on the control node and a second virtual network component on the data processor.
7. The method according to claim 6, characterized in that After deploying the virtual network component based on the second configuration parameter, the method further includes: Creating at least one target container corresponding to the target service on the working node, determining first virtual interfaces corresponding to the at least one target container, and adding the first virtual interfaces to the namespace where the target container is located; A second virtual interface corresponding to the first virtual interface is created on the data processor.
8. A DPU virtual interface detection device in cloud native, characterized in that: Applicable to the control nodes in the cluster, including: A container determination module, used to determine at least one target container corresponding to a target service; a message sending module, configured to send an echo request message to each target container based on a service monitor corresponding to the target container, wherein the echo request message is used to detect a virtual interface corresponding to the target container; An interface detection module is used to determine that an abnormality occurs in the virtual interface corresponding to the target container if a reply message returned by the target container for the echo request message is not received within a first preset time, and the virtual interface corresponding to the target container includes a first virtual interface corresponding to the target container in the working node of the cluster, and / or a second virtual interface corresponding to the first virtual interface in a data processor deployed on the working node.
9. An electronic device, characterized in that: include: processor; A memory for storing executable instructions; The processor is used to read the executable instructions from the memory and execute the executable instructions to implement the DPU virtual interface detection method in cloud native described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The storage medium stores a computer program. When the computer program is executed by the processor, the processor implements the DPU virtual interface detection method in cloud native according to any one of claims 1 to 7.
Citation Information
Patent Citations
Test method, system and device for loading virtual network card on cloud platform and storage medium
CN115567420A
Network equipment testing method, system and device, storage medium and electronic equipment
CN116112413A
Link monitoring method, medium, device and computing equipment
CN116582465A
CNI network plug-in-based network flow detection and control method and system
CN117914559A
Distributed firewall definition method and system
WO2023056722A1