DPU-based k8s cluster deployment method, apparatus and device, and storage medium
By using the master-slave mode to bind the virtual function port on the DPU network card, the network interruption problem caused by virtual interface failure is solved, the network communication reliability of cloud-native clusters is improved, and high availability and disaster recovery capabilities are ensured.
Patent Information
- Application Number
- CN202411269250.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-11
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2044-09-11
AI Technical Summary
The existing DPU network card is in the network traffic offload of containers or virtual machine instances. When the virtual function interface fails, it cannot switch to the backup interface in time, resulting in network interruption and packet loss, affecting business stability.
The master-slave mode is used to bind two virtual function ports to ensure that the master device automatically switches to the slave device when the master device fails, thereby improving the network communication reliability of container instances.
It effectively avoids network interruptions caused by the failure of a single virtual interface, improves the network communication reliability of Pod instances in cloud-native clusters, reduces packet loss and retransmission, and improves the stability of the network and disaster recovery and fault tolerance capabilities.
Smart Images

Figure CN119211022A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of data processing, and in particular to a DPU-based k8s cluster deployment method, device, equipment and storage medium. Background Art
[0002] The current DPU network card usually uses a cloud-native network traffic offloading method based on Open Virtual Network (OVN). In this method, when the user creates a container Pod or a virtual machine VM instance, Kubernetes first calls the single root virtualization device plugin (SRIOV device plugin, SRIOV-DP CNI), selects a virtual function VF interface that meets the requirements from the user-defined SRIOV resource pool, and then passes the selected VF device ID to the controller plugin (ovn-kubernetes CNI) of the OVN K8s software-defined network. The ovn-kubernetes CNI adds the VF device to the newly created Pod or virtual machine instance. At the same time, the two components deployed on the DPU SoC side of OVN, the on-chip system component (OVN Soc module) deployed on the DPU and the OVN control component (OVN Controller) respond to the event of instance scheduling. The OVN Soc module adds the representative port vfr corresponding to the VF to the ovs bridge. OVNController obtains the relevant flow table from the Open Virtual Network Database (OVN DB) and sends it to the OVS instance. OVS forwards the network traffic related to the Pod or VM instance.
[0003] However, in the current solution, SRIOV-DP and ovn-kubernetes CNI only allocate one VF for each Pod or VM. When the VF interface or its PF interface fails due to software or hardware problems, the Pod or VM instance cannot make Kubernetes aware of the failure of the interface instance; or after the interface fails, it alerts Kubernetes to trigger an error handling event. Kubernetes can transfer the traffic to the new Pod instance by scheduling a new Pod instance. However, in this process, before Kubernetes detects that the instance traffic has failed and the new Pod instance is successfully created, the old failed instance will still be responsible for forwarding the upstream and downstream traffic. If CNI cannot provide high reliability support for the Pod instance in this process, it will cause obvious interruption of the service, especially on the DPU network card with hardware offload features turned on. In a high-bandwidth, high-throughput, and extremely low-latency sensitive network, even a very short interruption will cause massive packet loss and retransmission, which will not only affect the service itself, but also aggravate the network congestion due to packet loss and retransmission, resulting in great losses. Summary of the invention
[0004] An embodiment of the present application provides a DPU-based k8s cluster deployment method to improve the reliability of network communication of container instances in a cloud native cluster.
[0005] In a first aspect, an embodiment of the present application provides a DPU-based k8s cluster deployment method, including:
[0006] Receive the container instance deployed by the user and determine two virtual function ports;
[0007] Obtain a first identifier of a device corresponding to the two virtual function ports, the two virtual function ports belong to different physical function ports, and call a container network interface plug-in, the container network interface plug-in is used to create a logical binding virtual function port, and the working mode of creating the logical binding virtual function port is a master-slave mode;
[0008] adding the two virtual function ports to the logical binding virtual function port according to the first identifier; adding the logical binding virtual function port to the kernel namespace of the container, the logical binding virtual function port being the network interface of the container;
[0009] Allocate an IP address and a MAC address to the network interface of the container through a controller plug-in of a software-defined network;
[0010] Sending the first identifier, where the first identifier is used to create a logically bound virtual function representative interface;
[0011] According to the first identifier and the second identifier corresponding to the physical function port, the corresponding two virtual function representative ports are added as sub-interfaces to the logical binding virtual function representative port, and the working mode of the logical binding virtual function representative port is set to master-slave mode;
[0012] Create a logical binding uplink interface, and add the two uplink interfaces corresponding to the two physical functional interfaces as sub-interfaces to the logical binding uplink interface according to the first identifier and the second identifier, and set the working mode of the logical binding uplink interface to master-slave mode;
[0013] Add the logical binding virtual function representative port and the logical binding uplink interface to the OVS bridge;
[0014] Obtaining OVS configuration information of the flow table related to the container, the logically bound virtual function representative port, and the logically bound uplink interface;
[0015] The flow table related to the container and the OVS configuration information are sent to the OVS instance.
[0016] In a possible implementation manner, the two virtual function ports include a first virtual function port and a second virtual function port, and the first virtual function port and the second virtual function port correspond to different resource pools.
[0017] In a possible implementation manner, the first identifier includes a third identifier and the fourth identifier, the third identifier corresponds to the first virtual function port, and the fourth identifier corresponds to the second virtual function port.
[0018] In a possible implementation, the container network interface plug-in is used to create the logical binding virtual function port for the container instance according to the CRD resource definition when the container instance is scheduled by the working node.
[0019] In a second aspect, an embodiment of the present application provides a k8s cluster deployment device based on DPU, including:
[0020] A receiving module is used to receive a container instance deployed by a user and determine two virtual function ports;
[0021] A first acquisition module is used to acquire a first identifier of a device corresponding to the two virtual function ports, the two virtual function ports belong to different physical function ports, and call a container network interface plug-in, the container network interface plug-in is used to create a logical binding virtual function port, and the working mode of creating the logical binding virtual function port is a master-slave mode;
[0022] a first adding module, adding the two virtual function ports to the logical binding virtual function port according to the first identifier; adding the logical binding virtual function port to the kernel namespace of the container, the logical binding virtual function port being the network interface of the container;
[0023] An allocation module, configured to allocate an IP address and a MAC address to a network interface of the container through a controller plug-in of a software-defined network;
[0024] A first sending module, configured to send the first identifier, where the first identifier is used to create a logically bound virtual function representative port;
[0025] A second adding module is used to add the corresponding two virtual function representative ports as sub-interfaces to the logical binding virtual function representative port according to the first identifier and the second identifier corresponding to the physical function port, and the working mode of the logical binding virtual function representative port is set to master-slave mode;
[0026] A creation module, used to create a logical binding uplink interface, and add the two uplink interfaces corresponding to the two physical functional interfaces as sub-interfaces to the logical binding uplink interface according to the first identifier and the second identifier, and the working mode of the logical binding uplink interface is set to a master-slave mode;
[0027] A third adding module is used to add the logical binding virtual function representative port and the logical binding uplink interface to the OVS bridge;
[0028] A second acquisition module is used to obtain the OVS configuration information of the flow table related to the container, the logically bound virtual function representative port and the logically bound uplink interface;
[0029] The second sending module is used to send the flow table related to the container and the OVS configuration information to the OVS instance.
[0030] In a possible implementation manner, the two virtual function ports include a first virtual function port and a second virtual function port, and the first virtual function port and the second virtual function port correspond to different resource pools.
[0031] In a possible implementation manner, the first identifier includes a third identifier and the fourth identifier, the third identifier corresponds to the first virtual function port, and the fourth identifier corresponds to the second virtual function port.
[0032] In a possible implementation, the container network interface plug-in is used to create the logical binding virtual function port for the container instance according to the CRD resource definition when the container instance is scheduled by the working node.
[0033] In a third aspect, an embodiment of the present application further provides an electronic device, the electronic device comprising:
[0034] at least one processor;
[0035] and a memory communicatively coupled to the at least one processor;
[0036] Among them, the memory stores instructions that can be executed by at least one processor, and the instructions are executed by at least one processor to enable the electronic device to execute the k8s cluster deployment method corresponding to any embodiment in the first aspect of the embodiments of the present application.
[0037] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, in which computer execution instructions are stored. When the computer execution instructions are executed by a processor, they are used to implement a k8s cluster deployment method as described in any of the first aspects of the embodiments of the present application.
[0038] In a fifth aspect, the present disclosure further provides a computer program product, which includes computer execution instructions, which, when executed by a processor, are used to implement a k8s cluster deployment method as described in any embodiment corresponding to the first aspect of the present disclosure.
[0039] In summary, the method shown in the embodiment of the present application, when a single virtualized SRIOV virtual interface fails, the network traffic forwarding of the container instance in the cloud native network will be interrupted, and two virtual interfaces belonging to different physical interfaces are bound into a master-slave mode interface, which can be switched to the slave device when the virtual function of the master device fails to improve the disaster tolerance and fault tolerance capabilities. It can solve the problem of interruption when the existing solution only allocates a single VF interface to the Pod and fails due to software and hardware problems, thereby improving the reliability of the network communication of the Pod instance in the cloud native cluster. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] 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.
[0041] 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.
[0042] Figure 1 A schematic diagram of the k8s cluster deployment structure of the DPU provided in the embodiment of the present application;
[0043] Figure 2A schematic diagram of a k8s cluster deployment method based on DPU provided in an embodiment of the present application;
[0044] Figure 3 A schematic diagram of a k8s cluster deployment device based on a DPU provided in an embodiment of the present application;
[0045] Figure 4 A DPU-based k8s cluster deployment device is provided in an embodiment of the present application. DETAILED DESCRIPTION
[0046] When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments are only examples of devices and methods consistent with some aspects of the embodiments of the present application as detailed in the appended claims.
[0047] The following specific embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments. The following will describe the embodiments of the present application in conjunction with the accompanying drawings.
[0048] 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.
[0049] The terms involved in the present invention are exemplified below.
[0050] Cloud Native, cloud native technology is conducive to organizations to build and run elastically scalable applications in new dynamic environments such as public cloud, private cloud and hybrid cloud. Representative technologies of cloud native include containers, service mesh, microservices, immutable infrastructure and declarative API. These technologies can build loosely coupled systems with good fault tolerance, easy management and easy observation. Combined with reliable automation means, cloud native technology enables engineers to easily make frequent and predictable major changes to the system.
[0051] DPU: Data Processing Unit, as a dedicated hardware accelerator, is a new generation of data-centric computing processors that integrates complete data center functions into a single chip. Together with CPU and GPU, it constitutes the three pillars of new computing. By using specially designed hardware accelerators to quickly process data packets entering the DPU, processing delays can be reduced and processing throughput can be improved.
[0052] K8S: Its full name is kubernetes, and K8S is its abbreviation, with the word "8" replacing the eight characters of "ubernete". It is a container-based cluster management platform, which can also be called an open source container orchestration platform, used to automate the deployment, expansion and management of containerized applications. It provides a flexible and scalable way to manage containerized applications, and provides a range of features to simplify application deployment, scheduling, self-healing and expansion.
[0053] SOC: System On Chip, system on chip, means it is a product, an integrated circuit with a dedicated purpose, which contains all the contents of a complete system and embedded software. DPU SoC does not belong to the node resources of the kubernetes cluster, but is only used as an independent operating system on the DPU network card to run software programs.
[0054] CNI / cni: Container Network Interface, is the full name of the container network interface, which is used to implement a network model for multi-container communication. It is responsible for creating and managing network interfaces for containers, including assigning IP addresses, configuring routes, setting network policies, etc. CNI plug-ins can implement these functions based on different network implementations, such as using Linux bridging, VLAN, Overlay networks, etc.
[0055] Pod: An abbreviation for Point of Delivery, Kubernetes encapsulates one or more containers into a high-level structure called a pod. Any container in the same pod will share the same namespace and local network. Containers can easily communicate with other containers in the same container, just as if they were on the same machine while maintaining a certain degree of isolation.
[0056] crd: the abbreviation of CustomResourceDefinition, which is used to manage the configuration of a pod resource. For example, one pod corresponds to one crd configuration.
[0057] PF / pf: It is the abbreviation of Physical Function, which refers to the actual function of the physical network card, which can directly interact with the physical network. PF is responsible for managing and controlling resources related to VF, and handling communication between VFs.
[0058] OVN: Open Virtual Network is an open source virtualized network project that uses OVS as the underlying technology and provides a flexible and programmable data path between kernel state and user state to achieve network interconnection between virtual machines and containers. It provides rich network functions and easy-to-use management interfaces, enabling users to build and manage complex virtual network environments.
[0059] OVS: OpenvSwitch, virtual forwarding software, OVS is a high-quality, multi-layer virtual switching software. Its purpose is to support large-scale network automation through programming extensions, while also supporting standard management interfaces and protocols.
[0060] ovn-kubernetes: is a Kubernetes CNI based on OVN (Open Virtual Network). It provides an efficient, reliable and flexible network solution that can meet the communication requirements between containers in the Kubernetes cluster and between containers and external networks. In the DPU scenario, Ovn-kubernetes CNI unloads the forwarding plane ovs to DPUSoc. Ovn-kubernetes guides the ovs forwarding plane on the DPU Soc to forward traffic by passing the network information and service information of the entire K8s cluster through the openflow flow table.
[0061] SRIOV: Single root virtualization, which divides the network card into virtual functions VF and physical functions PF. SRIOV CNI, that is, the interface on the working node with SRIOV function.
[0062] Bond: Bond port is a network technology that is mainly used to bind multiple physical network cards to one logical network card. This method can achieve link redundancy, bandwidth expansion, load balancing, etc. Bond port technology is mainly used in production scenarios with high network throughput and high requirements for network stability. It is a common technology to improve performance and reliability.
[0063] Figure 1 A schematic diagram of a k8s cluster deployment structure of a DPU provided in an embodiment of the present application. Figure 1In the deployment of hardware, the software and hardware are deployed separately. In terms of hardware deployment, the DPU network card is a network card installed on the cloud server node in the data center, providing a high-bandwidth, low-latency heterogeneous network computing acceleration engine for the cloud server node.
[0064] In terms of software deployment, SRIOV CNI is deployed on the control node and worker nodes of the k8s cluster to define and create PF and VF resource pools that can be used for container pod instances for each worker node of the cluster. The network container interface Bond CNI is deployed on each worker node of the k8s cluster. Bond CNI is used to create a logical binding virtual function bond VF interface for this instance according to the user-defined resource definition (Custom Resource Definition, CRD) when a container Pod instance is scheduled on a worker node. The PF resource pool that can be used and the VF resource pool that can be allocated to each PF are configured through the CRD related to Bond CNI. The relevant components of ovn-kubernetes CNI are deployed on the control node, worker node, and DPU SoC of the kubernetes cluster to provide basic network capabilities for the kubernetes cluster.
[0065] Among them, the control node deploys the OVN Control Center OVN Control Center components: including ovn-kubernetes control plane related components and OVN database OVN DB related components.
[0066] The worker node deploys the ovn-kubernetes CNI component.
[0067] The OVN control component OVN Controller and OVN SoC module components are deployed on the DPU SoC.
[0068] Deploy the collaborative component MultusCNI on the control node and worker node of the Kubernetes cluster to provide Kubernetes with the collaborative working capabilities of SRIOV CNI, Bond CNI, and ovn-Kubernetes CNI.
[0069] exist Figure 1 In the output, number 1 indicates: select 2SRIOV VFs from two different PFs, that is, select one SRIOV VF device from each of the VF resource pools created by two different PFs, for a total of two SRIOV VF devices.
[0070] Number 2 stands for: Device IDs, i.e. device identifiers.
[0071] Number 3 means: Create bond port, which means creating a bond port.
[0072] Number 4 means: set port to pod NS, which means adding the created Bond port to the Pod's namespace kernel namespace.
[0073] Number 5 means: get PF IDs and VF IDs, that is, get PF IDs and VF IDs
[0074] Number 6 means: Create bond vfr port and bond uplink port with Active-standby mode, and add the two bond ports on OVS bridge, that is, set the bond vfr port and bond uplink port to master-slave working mode and add them to the OVS bridge.
[0075] Number 7 means: Synchronize the openflow tables relates to the bond VF portfrom OVN DB, that is, synchronize the openflow flow table information related to the bond VF interface from OVN DB.
[0076] Number 8 means: Download the openflow tables related to the bond port, which means downloading the synchronized bond port flow table information to the OVS instance.
[0077] Number 9 indicates a miss up call, which is an event in which a table entry is missing and sent up.
[0078] Number 10 indicates: Download hw_offloaded tables, that is, downloading hardware uninstallation table items.
[0079] Figure 2 A flow chart of a DPU-based k8s cluster deployment method provided in an embodiment of the present application. Figure 2 The process includes steps S201 to S210. Each step is described in detail as follows.
[0080] Step S201: receiving a container instance deployed by a user and determining two virtual function ports.
[0081] In a possible implementation manner, the two virtual function ports include a first virtual function port and a second virtual function port, and the first virtual function port and the second virtual function port correspond to different resource pools.
[0082] It can be understood that when kubernetes receives the container Pod instance deployed by the user, kubelet calls SRIOV CNI to select two physical function ports PF from the available physical function port PF resource pool on the working node, and then selects one virtual function port VF from the SRIOVVF resource pool corresponding to each PF. The two virtual function ports VF include a first virtual function port and a second virtual function port, and the resource pools corresponding to the first virtual function port and the second virtual function port are different.
[0083] In a possible implementation manner, the first identifier includes a third identifier and the fourth identifier, the third identifier corresponds to the first virtual function port, and the fourth identifier corresponds to the second virtual function port.
[0084] It can be understood that the first identifier here refers to the identifiers of two devices, that is, the first identifier includes the third identifier and the fourth identifier, and the identifier of each device corresponds to a different virtual function port. That is, the third identifier corresponds to the first virtual function port, and the fourth identifier corresponds to the second virtual function port. Each VF and PF has a unique identifier. This identifier can be the unique PCI bus address corresponding to the virtual function port VF in the operating system, or it can be other addresses, but the PCI bus address is generally used in implementation.
[0085] Step S202, obtain a first identifier of a device corresponding to the two virtual function ports, the two virtual function ports belong to different physical function ports, and call a container network interface plug-in, the container network interface plug-in is used to create a logically bound virtual function port, and the working mode of creating the logically bound virtual function port is a master-slave mode.
[0086] In a possible implementation, the container network interface plug-in is used to create the logical binding virtual function port for the container instance according to the CRD resource definition when the container instance is scheduled by the working node.
[0087] Step S203: adding the two virtual function ports to the logical binding virtual function port according to the first identifier; adding the logical binding virtual function port to the kernel namespace of the container, the logical binding virtual function port being the network interface of the container.
[0088] Step S204: Allocate an IP address and a MAC address to the network interface of the container through a controller plug-in of the software defined network.
[0089] As can be understood, kubernetes obtains the identifiers (VFdevice ID) of the devices corresponding to the two virtual function ports assigned, and calls the container network interface plug-in (Bond CNI). Bond CNI creates a logical bonded virtual function port (bond VF port), and adds the selected two virtual function ports VF as sub-interfaces to the bond VF port according to the VF device ID (the device identifier corresponding to the VF, i.e. the first identifier), and sets the bond mode to Active-Standby master-slave mode.
[0090] It can be understood that kubelet calls ovn-kubernetes CNI (controller plug-in for OVN K8s software-defined network) to add the created bond VF port to the kernel namespace of the Pod, and logically binds the virtual function port as the network interface NIC of the Pod. The controller plug-in for OVN K8s software-defined network allocates IP and MAC addresses to the network interface of the container.
[0091] Step S205: sending the first identifier, where the first identifier is used to create a logically bound virtual function representative interface.
[0092] It can be understood that this step is to send the first identifier to the system-on-chip component deployed on the DPU, and the first identifier is used to create a logically bound virtual function representative port.
[0093] Step S206: According to the first identifier and the second identifier corresponding to the physical function port, the corresponding two virtual function representative ports are added as sub-interfaces to the logical binding virtual function representative port, and the working mode of the logical binding virtual function representative port is set to master-slave mode.
[0094] Step S207, create a logical binding uplink interface, and add the two uplink interfaces corresponding to the two physical functional interfaces as sub-interfaces to the logical binding uplink interface according to the first identifier and the second identifier, and set the working mode of the logical binding uplink interface to master-slave mode.
[0095] It can be understood that after receiving the identifiers PF ID and VF ID, the OVN DPU chip deployed on the DPU system-on-chip component (OVN SoC module) creates two bond interfaces, where the bond interface includes a vfr port and an uplink interface.
[0096] In a possible implementation, a logically bound virtual function representative port (bondvfr port) is created on the DPU SoC, and according to the obtained PF ID and VF ID, the corresponding two VF representative ports VFr (VF representative) are added as sub-interfaces to the bond vfr port, and the bond port mode is set to Active-standby master-slave mode.
[0097] In another possible implementation, a logical bonded uplink interface (bonduplink) is created on the DPU SoC, and two uplink uplink interfaces corresponding to the two PF interfaces are added as sub-interfaces to the bond uplink interface according to the obtained PF ID, and the bond port mode is set to Active-standby master-slave mode.
[0098] Step S208: Add the logically bound virtual function representative port and the logically bound uplink interface to the OVS bridge.
[0099] It can be understood that two bond interfaces are added to the OVS bridge, that is, a logical bond uplink interface (bonduplink) and a logical bond virtual function representative port (bondvfr port) are added to the OVS bridge.
[0100] Step S209, obtaining the OVS configuration information of the flow table related to the container, the logically bound virtual function representative port, and the logically bound uplink interface.
[0101] Step S210: Send the flow table related to the container and the OVS configuration information to the OVS instance.
[0102] It can be understood that the OVN Controller component deployed on the DPU Soc synchronously obtains the latest flow table related to the newly created container Pod and the bond VF interface related configuration in the Kubernetes cluster network from the OVN Control Center component. The OVN Controller component sends the openflow flow table information related to the newly created Pod and bond VF interface to the OVS instance.
[0103] When a data flow related to the created Pod instance arrives at the DPU network card, the ASIC hardware forwarding engine will fail to forward the data because it has no flow-related information, triggering a table entry missing up call event, and sending the first packet to the OVS instance on the DPU SoC. The OVS instance forwards the message based on the openflow flow table information and related flow tables described above.
[0104] After the first packet is forwarded, the OVS instance on the DPU SoC sends the hardware offload table entry related to the flow to the hardware forwarding engine of the ASIC. When subsequent packets arrive, they can be directly forwarded after the hardware table is hit.
[0105] In an embodiment of the present application, the identifier of the device corresponds to the identifier of the VF, and thus, the identifier of the device can be referred to by the first identifier, and can also refer to the identifier of the VF. In addition, the identifier of the device can be identified by the first identifier, and the identifier of the VF can be described by the fifth identifier, and the fifth identifier includes the sixth identifier and the seventh identifier. They can be used interchangeably in related steps, such as "sending the first identifier", which can also be expressed as "sending the fifth identifier", "according to the first identifier and the second identifier corresponding to the physical function port", which can also be described as "according to the fifth identifier and the second identifier corresponding to the physical function port".
[0106] It is understandable that the above described solution embodiment takes the ASIC DPU network card as an example, but the present invention can also be applied to any network card that supports SRIOV features and network traffic hardware offload capabilities, such as SmartNIC intelligent network card, etc. The present application embodiment does not limit this.
[0107] This embodiment takes kubernetes as an example as a cloud native orchestration tool, and the present invention is also applicable to other cloud native cluster orchestration tools, such as openshift, etc. This embodiment of the application does not limit this.
[0108] This embodiment takes Pod as an example of Kubernetes scheduling, and the present invention is also applicable to VMs and bare metal instances managed by Kubernetes. This embodiment of the application does not limit this.
[0109] This embodiment takes ovn-kubernetes CNI as an example of CNI that provides a network interface for a kubernetes cluster. The present invention is also applicable to any open source or self-developed CNI based on an SDN controller / forwarding plane, such as kube-ovn, Antrea, etc. This application embodiment does not limit this.
[0110] In summary, the method shown in the embodiment of the present application, when a single virtualized SRIOV virtual interface fails, the network traffic forwarding of the container instance in the cloud native network will be interrupted, and two virtual interfaces belonging to different physical interfaces are bound into a master-slave mode interface, which can be switched to the slave device when the virtual function of the master device fails to improve the disaster tolerance and fault tolerance capabilities. It can solve the problem of interruption when the existing solution only allocates a single VF interface to the Pod and fails due to software and hardware problems, thereby improving the reliability of the network communication of the Pod instance in the cloud native cluster.
[0111] Figure 3 A schematic diagram of a k8s cluster deployment device based on DPU provided in an embodiment of the present application includes the following modules:
[0112] The receiving module 301 is used to receive a container instance deployed by a user and determine two virtual function ports;
[0113] A first acquisition module 302 is used to obtain a first identifier of a device corresponding to the two virtual function ports, the two virtual function ports belong to different physical function ports, and call a container network interface plug-in, the container network interface plug-in is used to create a logical binding virtual function port, and the working mode of creating the logical binding virtual function port is a master-slave mode;
[0114] A first adding module 303 is used to add the two virtual function ports to the logical binding virtual function port according to the first identifier; add the logical binding virtual function port to the kernel namespace of the container, and the logical binding virtual function port is a network interface of the container;
[0115] An allocation module 304, configured to allocate an IP address and a MAC address to a network interface of the container through a controller plug-in of a software defined network;
[0116] A first sending module 305, configured to send the first identifier, where the first identifier is used to create a logically bound virtual function representative port;
[0117] A second adding module 306 is used to add the corresponding two virtual function representative ports as sub-interfaces to the logical binding virtual function representative port according to the first identifier and the second identifier corresponding to the physical function port, and the working mode of the logical binding virtual function representative port is set to master-slave mode;
[0118] A creation module 307 is used to create a logical binding uplink interface, and add the two uplink interfaces corresponding to the two physical functional interfaces as sub-interfaces to the logical binding uplink interface according to the first identifier and the second identifier, and the working mode of the logical binding uplink interface is set to a master-slave mode;
[0119] A third adding module 308 is used to add the logical binding virtual function representative port and the logical binding uplink interface to the OVS bridge;
[0120] The second acquisition module 309 is used to obtain the OVS configuration information of the flow table related to the container, the logically bound virtual function representative port and the logically bound uplink interface;
[0121] The second sending module 310 is used to send the flow table related to the container and the OVS configuration information to the OVS instance.
[0122] In a possible implementation manner, the two virtual function ports include a first virtual function port and a second virtual function port, and the first virtual function port and the second virtual function port correspond to different resource pools.
[0123] In a possible implementation manner, the first identifier includes a third identifier and the fourth identifier, the third identifier corresponds to the first virtual function port, and the fourth identifier corresponds to the second virtual function port.
[0124] In a possible implementation, the container network interface plug-in is used to create the logical binding virtual function port for the container instance according to the CRD resource definition when the container instance is scheduled by the working node.
[0125] It can be understood that the device provided in the embodiment of the present application is used to implement Figure 2 All methods described in the examples.
[0126] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown in FIG. Figure 4 As shown, the electronic device 400 includes: a memory 410 and a processor 420 .
[0127] The memory 410 stores a computer program that can be executed by at least one processor 420. The computer program is executed by at least one processor 420 to enable the electronic device to implement the method provided in any of the above embodiments.
[0128] The memory 410 and the processor 420 may be connected via a bus 430 .
[0129] The relevant instructions can be understood by referring to the relevant descriptions and effects corresponding to the method embodiments, which will not be repeated here.
[0130] An embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, and the computer program is executed by a processor to implement the following Figure 2 The method of any corresponding embodiment.
[0131] Among them, the computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
[0132] An embodiment of the present application provides a computer program product, which includes computer-executable instructions, which are used to implement the following when the computer-executable instructions are executed by a processor: Figure 2 The method of any corresponding embodiment.
[0133] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0134] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the disclosure disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope of the present application is indicated by the claims.
[0135] It should be understood that the present application is not limited to the exact construction that has been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof.
Claims
1. A k8s cluster deployment method based on DPU, characterized in that: include: Receive the container instance deployed by the user and determine two virtual function ports; Obtain a first identifier of a device corresponding to the two virtual function ports, the two virtual function ports belong to different physical function ports, and call a container network interface plug-in, the container network interface plug-in is used to create a logical binding virtual function port, and the working mode of creating the logical binding virtual function port is a master-slave mode; adding the two virtual function ports to the logical binding virtual function port according to the first identifier; adding the logical binding virtual function port to the kernel namespace of the container, the logical binding virtual function port being the network interface of the container; Allocate an IP address and a MAC address to the network interface of the container through a controller plug-in of a software-defined network; Sending the first identifier, where the first identifier is used to create a logically bound virtual function representative interface; According to the first identifier and the second identifier corresponding to the physical function port, the corresponding two virtual function representative ports are added as sub-interfaces to the logical binding virtual function representative port, and the working mode of the logical binding virtual function representative port is set to master-slave mode; Create a logical binding uplink interface, and add the two uplink interfaces corresponding to the two physical functional interfaces as sub-interfaces to the logical binding uplink interface according to the first identifier and the second identifier, and set the working mode of the logical binding uplink interface to master-slave mode; Add the logical binding virtual function representative port and the logical binding uplink interface to the OVS bridge; Obtaining OVS configuration information of the flow table related to the container, the logically bound virtual function representative port, and the logically bound uplink interface; The flow table related to the container and the OVS configuration information are sent to the OVS instance.
2. The method according to claim 1, characterized in that The two virtual function ports include a first virtual function port and a second virtual function port, and the first virtual function port and the second virtual function port correspond to different resource pools.
3. The method according to claim 1 or 2, characterized in that: The first identifier includes a third identifier and the fourth identifier, the third identifier corresponds to the first virtual function port, and the fourth identifier corresponds to the second virtual function port.
4. The method according to any one of claims 1 to 3, characterized in that: The container network interface plug-in is used to create the logical binding virtual function port for the container instance according to the CRD resource definition when the container instance is scheduled by the working node.
5. A k8s cluster deployment device based on DPU, characterized in that: include: A receiving module is used to receive a container instance deployed by a user and determine two virtual function ports; A first acquisition module is used to acquire a first identifier of a device corresponding to the two virtual function ports, the two virtual function ports belong to different physical function ports, and call a container network interface plug-in, the container network interface plug-in is used to create a logical binding virtual function port, and the working mode of creating the logical binding virtual function port is a master-slave mode; A first adding module, adding the two virtual function ports to the logically bound virtual function port according to the first identifier; Adding the logical binding virtual function port to the kernel namespace of the container, the logical binding virtual function port being the network interface of the container; An allocation module, configured to allocate an IP address and a MAC address to a network interface of the container through a controller plug-in of a software-defined network; A first sending module, configured to send the first identifier, where the first identifier is used to create a logically bound virtual function representative port; A second adding module is used to add the corresponding two virtual function representative ports as sub-interfaces to the logical binding virtual function representative port according to the first identifier and the second identifier corresponding to the physical function port, and the working mode of the logical binding virtual function representative port is set to master-slave mode; A creation module, used to create a logical binding uplink interface, and add the two uplink interfaces corresponding to the two physical functional interfaces as sub-interfaces to the logical binding uplink interface according to the first identifier and the second identifier, and the working mode of the logical binding uplink interface is set to a master-slave mode; A third adding module is used to add the logical binding virtual function representative port and the logical binding uplink interface to the OVS bridge; A second acquisition module is used to obtain the OVS configuration information of the flow table related to the container, the logically bound virtual function representative port and the logically bound uplink interface; The second sending module is used to send the flow table related to the container and the OVS configuration information to the OVS instance.
6. The device according to claim 5, characterized in that The two virtual function ports include a first virtual function port and a second virtual function port, and the first virtual function port and the second virtual function port correspond to different resource pools.
7. The device according to claim 5 or 6, characterized in that The first identifier includes a third identifier and the fourth identifier, the third identifier corresponds to the first virtual function port, and the fourth identifier corresponds to the second virtual function port.
8. The device according to any one of claims 5 to 7, characterized in that: The container network interface plug-in is used to create the logical binding virtual function port for the container instance according to the CRD resource definition when the container instance is scheduled by the working node.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 4 when executed by a processor.
10. A computer program product comprising computer executable instructions, characterized in that: The computer-executable instructions are used to implement the method according to any one of claims 1 to 4 when executed by a processor.
Citation Information
Patent Citations
Virtualized network equipment management method and related device
CN116800616A
Data processing method, device and equipment based on DPU and readable storage medium
CN116886496A
Container creation method and device and storage medium
CN117215712A
Automatically extended service grid for virtual machines
CN117648154A
Load balancing and networking policy performance by a packet processing pipeline
EP4187868A1
Cited By
Method for fixing kube-ovn network virtual bridge address in Linux operating system
CN120050263A
Method for docking and adapting working node host of cloud computing cluster and DPU (Data Processing Unit), DPU chip, DPU intelligent network card and cloud computing equipment
CN120825403A
Method for docking and adapting working node host and DPU of cloud computing cluster, DPU chip, DPU intelligent network card and cloud computing equipment
CN120825403B
