A network management method, device, medium, and electronic equipment for a cluster system
By creating and associating virtual network interfaces in the container deployment unit, the problem of unreliable and high communication caused by the single network interface in traditional application migration is solved, and reliable inter-container communication and cost reduction is achieved.
Patent Information
- Application Number
- CN202210876726.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-25
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2042-07-25
AI Technical Summary
When traditional applications migrate to container deployment units, there is only one network interface, which causes changes in the network operation environment and is too expensive. How to establish multiple network interfaces in container deployment units to ensure communication reliability and reduce migration costs.
By creating a first virtual network interface and a second virtual network interface in the target container deployment unit and associating these interfaces through a vector packet processing engine, multiple network interfaces are established to achieve communication between the container deployment units.
Reliable communication between container deployment units is achieved and the cost of traditional application migration is reduced.
Smart Images

Figure CN115277701B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of network management technology, and in particular relates to a network management method, device, medium, and electronic equipment for a cluster system. Background Art
[0002] When migrating traditional applications to a cluster system, the traditional applications are deployed in a container deployment unit in the cluster system in the form of containers.
[0003] When traditional applications are migrated to container deployment units, the container deployment unit normally has only one network interface. As traditional applications are migrated, their network operating environment changes, and the cost of migrating traditional applications is too high.
[0004] Therefore, how to establish multiple network interfaces in the container deployment unit to achieve communication between the container deployment units to ensure the reliability of network communication and reduce the cost of traditional application migration has become an urgent problem to be solved. Summary of the Invention
[0005] The embodiments of the present application provide a network management method, device, medium, and electronic device for a cluster system, which can establish multiple network interfaces in the container deployment unit to achieve communication between the container deployment units, thereby ensuring the reliability of communication and reducing the migration costs caused by the transformation of traditional applications.
[0006] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by practice of the present application.
[0007] According to a first aspect of an embodiment of the present application, a network management method for a cluster system is provided, characterized in that the cluster system includes multiple nodes, and the nodes include multiple container deployment units. The method includes: in the cluster system, selecting a node as a target node, and creating a target container deployment unit in the target node; selecting a network object in a network object list corresponding to the target container deployment unit in turn as a target network object; for each target network object, creating a first virtual network interface through a vector packet processing engine, and creating a second virtual network interface in the network namespace corresponding to the target container deployment unit; associating the first virtual network interface with the second virtual network interface to establish multiple network interfaces in the container deployment unit and realize communication between container deployment units.
[0008] In some embodiments of the present application, based on the aforementioned scheme, before selecting a network object as the target network object from the network object list corresponding to the target container deployment unit in sequence, the method also includes: creating a network object custom resource through the cluster system; creating a network object for each historical container deployment unit in the cluster system through the network object custom resource to obtain multiple network objects; and selecting one or more network objects from the multiple network objects to construct a network object list for the target container deployment unit.
[0009] In some embodiments of the present application, based on the aforementioned solution, the creating of the first virtual network interface through the vector packet processing engine includes: creating a network interface custom resource through the cluster system; and creating the first virtual network interface through the network interface custom resource and the vector packet processing engine.
[0010] In some embodiments of the present application, based on the aforementioned scheme, after creating the first virtual network interface through the network interface custom resources and the vector packet processing engine, the method also includes: creating a network sub-interface corresponding to the target network object through the network interface custom resources and the vector packet processing engine, and creating a bridging domain corresponding to the network sub-interface; associating the first virtual network interface with the network sub-interface through the bridging domain to associate the first virtual network interface with the target network object corresponding to the network sub-interface.
[0011] In some embodiments of the present application, based on the aforementioned scheme, creating a second virtual network interface in the network namespace corresponding to the target container deployment unit includes: obtaining a list of allocatable network addresses; selecting a network address from the list of allocatable network addresses as the target network address; creating a second virtual network interface in the network namespace corresponding to the target container deployment unit, wherein the target network address is used as the network address of the second virtual network interface.
[0012] In some embodiments of the present application, based on the above solution, after selecting a network address from the assignable network address list as the target network address, the method further includes: removing the target network address from the assignable network address list.
[0013] In some embodiments of the present application, based on the aforementioned scheme, the method also includes: disconnecting the association between the first virtual network interface and the second virtual network interface by deleting the first virtual network interface and the second virtual network interface and releasing the network address of the second virtual network interface.
[0014] According to a second aspect of an embodiment of the present application, a network management device for a cluster system is provided, characterized in that the device includes: a creation unit, for selecting a node as a target node in the cluster system, and creating a target container deployment unit in the target node; a selection unit, for sequentially selecting a network object from a network object list corresponding to the target container deployment unit as a target network object; an interface unit, for creating a first virtual network interface for each target network object through a vector packet processing engine, and creating a second virtual network interface in the network namespace corresponding to the target container deployment unit; an association unit, for associating the first virtual network interface with the second virtual network interface, so as to establish multiple network interfaces in the container deployment unit and realize communication between container deployment units.
[0015] According to a third aspect of an embodiment of the present application, a computer-readable storage medium is provided, characterized in that at least one program code is stored in the computer-readable storage medium, and the at least one program code is loaded and executed by a processor to implement the operations performed by the network management method of the cluster system.
[0016] According to the fourth aspect of an embodiment of the present application, an electronic device is provided, characterized in that the electronic device includes one or more processors and one or more memories, at least one program code is stored in the one or more memories, and the at least one program code is loaded and executed by the one or more processors to implement the operations performed by the network management method of the cluster system.
[0017] The beneficial effects of each embodiment of the second to fourth aspects mentioned above can refer to the beneficial effects of the first aspect and each embodiment of the first aspect mentioned above, and will not be repeated here.
[0018] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The accompanying drawings are incorporated into and constitute a part of the specification, illustrating embodiments consistent with the present application and, together with the specification, serving to explain the principles of the present application. It is obvious that the drawings described below are merely some embodiments of the present application, and a person of ordinary skill in the art can derive other drawings based on these drawings without inventive effort. In the drawings:
[0020] Figure 1 A schematic diagram showing the structure of a cluster system in an embodiment of the present application is shown;
[0021] Figure 2A flowchart of a network management method for a cluster system in an embodiment of the present application is shown;
[0022] Figure 3 A flowchart is shown before selecting a network object as a target network object from the network object list corresponding to the target container deployment unit in an embodiment of the present application;
[0023] Figure 4 A flowchart of creating a first virtual network interface by a vector packet processing engine in an embodiment of the present application is shown;
[0024] Figure 5 A flowchart is shown after the first virtual network interface is created by the network interface custom resource and the vector packet processing engine in an embodiment of the present application;
[0025] Figure 6 A schematic diagram showing the structure of a network management device for a cluster system in an embodiment of the present application is shown;
[0026] Figure 7 A schematic structural diagram of an electronic device in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0027] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0028] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner.In the following description, many specific details are provided so as to provide a full understanding of the embodiments of the present application. However, it will be appreciated by those skilled in the art that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps etc. can be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring the various aspects of the application.
[0029] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically separate entities. That is, these functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0030] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, while others may be combined or partially combined. Therefore, the actual execution order may vary depending on the actual situation.
[0031] Figure 1 The figure shows a schematic diagram of the structure of the cluster system in the embodiment of the present application.
[0032] The cluster system of the present application may be a Kubernetes cluster, wherein the Kubernetes cluster includes at least one master node 101 (i.e., a management node) and at least one worker node 102 (i.e., a working node), wherein the worker node includes at least one Pod unit 103 (i.e., a container deployment unit). In addition, the Kubernetes cluster also includes a kubectl component and an Etcd database, wherein the kubectl component is used to execute commands in the Kubernetes cluster.
[0033] A Kubernetes cluster is a highly available cluster of computers connected to work as a single unit. The abstractions within a Kubernetes cluster allow containerized applications to be deployed to the cluster without specifically tying them to individual computers. To take advantage of this new deployment model, applications need to be containerized and packaged in a way that decouples them from a single host. Containerized applications are more flexible and available than previous deployment models, where applications were installed directly onto specific computers and packages were deeply integrated into the host. Kubernetes clusters automate the distribution and scheduling of application containers across the cluster in a more efficient manner.
[0034] The following is a detailed description of the implementation details of the technical solution of the embodiment of the present application:
[0035] Figure 2 The flowchart of the network management method of the cluster system in the embodiment of the present application is shown. The network management method of the cluster system can be executed by a device with computing and processing functions, such as a network management device of the cluster system. Figure 2 As shown, the network management method of the cluster system includes at least steps 210 to 270, which are described in detail as follows:
[0036] Step 210: In the cluster system, a node is selected as a target node, and a target container deployment unit is created in the target node.
[0037] Step 230 : Select one network object from the network object list corresponding to the target container deployment unit in turn as the target network object.
[0038] Step 250: For each target network object, create a first virtual network interface through the vector packet processing engine, and create a second virtual network interface in the network namespace corresponding to the target container deployment unit.
[0039] Step 270: Associate the first virtual network interface with the second virtual network interface to enable communication between the target container deployment unit and other container deployment units.
[0040] In order to enable those skilled in the art to better understand, the following description will be given in conjunction with specific embodiments.
[0041] Specifically, among the working nodes of the Kubernetes cluster, one is selected as the target node, and a target container deployment unit (i.e., Pod) is created in the target node.
[0042] Then, the declaration field (which can be metadata.annotations) is searched in the configuration file of the target container deployment unit. The multi-network key (which can be multi-network) is found in the declaration field, and the key value of the multi-network key (which can be bond-network-01, bond-network-02, bond-network-03) is used as a list of network objects. At the same time, one of the network objects in the list is selected as the target network object (which can be bond-network-01).
[0043] For each target network object, a first virtual network interface (which can be vport01) is created on the vector packet processing engine, and a second virtual network interface (which can be ens1) is created in the network namespace corresponding to the target container deployment unit. The network namespace is the common space for all containers in a container deployment unit, that is, the space where the container deployment unit itself is located (which can be ns01).
[0044] It should be noted that the vector packet processing engine may be VPP (Vector Packet Processing), through which a virtual network interface may be created and associated with a network object supporting DPDK (ie, DataPlane Development Kit).
[0045] By using the first virtual network interface as the key value (which may be vport01) of the applicable vector packet processing engine interface key (which may be used-vpp-interface) in the declaration field of the target container deployment unit configuration file, and simultaneously using the data information of the second virtual network interface, namely the name and network address of the second virtual network interface, as the key value of the multi-network interface key (which may be multi-interface) in the declaration field of the target container deployment unit configuration file, the first virtual network interface and the second virtual network interface are associated, thereby establishing multiple network interfaces in the container deployment unit and enabling communication between the target container deployment unit and other container deployment units.
[0046] It should be noted that the key values of the applicable vector packet processing engine interface key are separated by special symbols, including commas (i.e., ,), semicolons (i.e., ;), and question marks (i.e., ?). The name and network address of the second virtual network interface need to be connected by special symbols, including @, &, and #, to serve as the key value of the multi-network interface key.
[0047] It can be seen that by creating a target container deployment unit, creating a first virtual network interface through the vector packet processing engine, and creating a second virtual network interface in the network namespace corresponding to the target container deployment unit, the first virtual network interface and the second virtual network interface can be associated, thereby establishing multiple network interfaces in the container deployment unit and realizing communication between container deployment units, so as to ensure the reliability of network communication and reduce the cost of traditional application migration.
[0048] It should be noted that, in an embodiment of the present application, if the multi-network key does not exist or the key value of the multi-network key is empty, multiple network interfaces cannot be established in the container deployment unit, and communication between the target container deployment unit and other container deployment units cannot be achieved.
[0049] It should be emphasized that in the embodiments of the present application, the target network object must exist in the Kubernetes cluster. If the target network object does not exist, the association between the first virtual network interface and the second virtual network interface cannot be achieved. As a result, multiple network interfaces cannot be established in the container deployment unit, and communication between the target container deployment unit and other container deployment units cannot be achieved.
[0050] It is emphasized again that before creating the target container deployment unit, a management module needs to be added to the Kubernetes cluster. The management module is used to create the corresponding target container deployment unit according to the configuration file of the target container deployment unit.
[0051] Furthermore, the step of creating a second virtual network interface in the network namespace corresponding to the target container deployment unit includes steps 251 to 253, which are described in detail as follows:
[0052] Step 251: Obtain a list of allocatable network addresses.
[0053] Step 252: Select a network address from the list of allocatable network addresses as the target network address.
[0054] Step 253: Create a second virtual network interface in the network namespace corresponding to the target container deployment unit, wherein the target network address is used as the network address of the second virtual network interface.
[0055] Specifically, obtain the list of allocatable network addresses of the target container deployment unit (which may be 192.168.20.100-192.168.20.200), which are allocated using the configuration file of the target container deployment unit. Select a network address from the list of allocatable network addresses as the target network address (which may be 192.168.20.150), set the target network address as the network address of the second virtual network interface, and mark the target network address as unallocatable.
[0056] In this embodiment, by assigning the target network address to the second virtual network interface, the second virtual network interface can achieve the function of connecting to other network interfaces. By marking the target network address as unassignable, it is possible to avoid the second virtual network interface from failing to be created due to a network address conflict.
[0057] Furthermore, after selecting a network address from the list of allocatable network addresses as the target network address, the target network address is removed from the list of allocatable network addresses. It should be noted that removal refers to marking the target network address as unassignable, rather than deleting the target network address from the list of allocatable network addresses. Furthermore, if the target network address is not marked as unassignable, there is a chance that the target network address will be reused, resulting in a network address conflict for the second virtual network interface.
[0058] Furthermore, the network management method of the cluster system also includes disconnecting the association between the first virtual network interface and the second virtual network interface by deleting the first virtual network interface and the second virtual network interface and releasing the network address of the second virtual network interface.
[0059] Specifically, by deleting the key value of the applicable vector packet processing engine interface key and the key value of the multiple network interface key, and releasing the network address of the second virtual network interface, that is, changing the network address of the second virtual network interface from an unallocatable state to an allocable state, so as to disconnect the association between the first virtual network interface and the second virtual network interface, thereby deleting multiple network interfaces in the container deployment unit and disconnecting the communication between the target container deployment unit and other container deployment units.
[0060] Figure 3 The flowchart before selecting a network object as the target network object from the network object list corresponding to the target container deployment unit in the embodiment of the present application is shown, with reference to Figure 3 As shown, the flowchart includes at least steps 310 to 350, which are described in detail as follows:
[0061] Step 310: Create a network object custom resource through the cluster system.
[0062] Step 330 : Create a network object for each historical container deployment unit in the cluster system using the network object custom resource to obtain multiple network objects.
[0063] Step 350: Select one or more network objects from the plurality of network objects to construct a network object list for the target container deployment unit.
[0064] In order to enable those skilled in the art to better understand, the following description will be given in conjunction with specific embodiments.
[0065] Specifically, a new custom resource, namely a network object custom resource (which may be BondNetwork), is added through the cluster system's custom resource (CRD, Custom Resource Definition). Based on the network object custom resource, a network object (which may be bond-network-01) may be created. The network object includes an interface ID (i.e., Bond ID), a virtual local area network ID (i.e., VLAN ID), a network prefix (which may be 192.168.20.0 / 24), a network address list, namely, the network object's starting and ending network addresses (which may be 192.168.20.100-192.168.20.200), and a gateway (which may be 192.168.20.254).
[0066] In an embodiment of the present application, a network object list is constructed for the target container deployment unit by using the network object as a key value of a multi-network key in a declaration field of the target container deployment unit configuration file.
[0067] It should be noted that the key values of the multiple network keys need to be separated by special symbols (which may be commas, ie, ).
[0068] It should be noted that network objects can be created, updated, and deleted using the kubectl component in the cluster. When a network object is created or updated, it is stored in the cluster's Etcd database. When a network object is deleted, it is deleted from the cluster's Etcd database.
[0069] In the embodiment of the present application, by adding a new network object custom resource, a network object that complies with the present application can be created to implement the construction of a network object list.
[0070] Figure 4 A flowchart of creating a first virtual network interface by a vector packet processing engine in an embodiment of the present application is shown. Figure 4 As shown, the flowchart includes at least steps 410 to 430, which are described in detail as follows:
[0071] Step 410: Create a network interface custom resource through the cluster system.
[0072] Step 430: Create the first virtual network interface using the network interface custom resource and the vector packet processing engine.
[0073] In order to enable those skilled in the art to better understand, the following description will be given in conjunction with specific embodiments.
[0074] Specifically, a new custom resource, namely a network interface custom resource (which can be BondInterface), is added through the cluster system's Custom Resource Definition (CRD). Based on the network interface custom resource, a network interface object (which can be bondethernet0) can be created. The network interface object is used to define a network interface, including a network interface object ID, a defined network interface node (which can be master01, master02, or master03), and member interfaces of the defined network interface node (which can be XGE1 / 0 / 1 or XGE1 / 0 / 2).
[0075] It should be noted that the network interface object can be created, updated, and deleted through the kubectl component in the cluster. If the network interface object is created or updated, it will be stored in the cluster's Etcd database. If the network interface object is deleted, it will be deleted from the cluster's Etcd database.
[0076] At the same time, a new controller, a network interface controller (which can be a BondInterfaceController), is added to the cluster. If the network interface object is created or updated, the network interface controller creates a network interface corresponding to the network interface object. If the network interface object is deleted, the network interface controller deletes the network interface corresponding to the network interface object.
[0077] In an embodiment of the present application, by adding a new network interface custom resource, a network interface object that complies with the present application can be created to define the network interface.
[0078] Figure 5 FIG1 shows a flowchart of an embodiment of the present application after the first virtual network interface is created by the network interface custom resource and the vector packet processing engine, referring to FIG1 Figure 5 As shown, the flowchart includes at least steps 510 to 530, which are described in detail as follows:
[0079] Step 510: Create a network sub-interface corresponding to the target network object through the network interface custom resource and the vector packet processing engine, and create a bridge domain corresponding to the network sub-interface.
[0080] Step 530: Associating the first virtual network interface with the network sub-interface through the bridge domain to associate the first virtual network interface with the target network object corresponding to the network sub-interface.
[0081] Specifically, a network sub-interface (which may be VLAN 200) corresponding to the target network object is created using the network interface custom resource and the vector packet processing engine. Simultaneously, a bridge domain (which may be Bridge Domain 200) corresponding to the network sub-interface is created. The correspondence is to the virtual local area network ID (i.e., VLAN ID) of the target network object. The first virtual network interface and the network sub-interface are placed in the bridge domain to associate the first virtual network interface with the network sub-interface, thereby associating the first virtual network interface with the target network object corresponding to the network sub-interface.
[0082] It should be noted that if the network sub-interface or the bridge domain already exists, there is no need to create them again.
[0083] In an embodiment of the present application, the network sub-interface and the bridge domain are created to achieve association between the first virtual network interface and the target network object corresponding to the network sub-interface.
[0084] It should be emphasized that before implementing steps 510 to 530, it is necessary to ensure that the ID of the target network object is consistent with the ID of the network interface object, and the network interface object includes the target node. Otherwise, the association between the first virtual network interface and the network sub-interface cannot be achieved, and the association between the first virtual network interface and the target network object corresponding to the network sub-interface cannot be achieved.
[0085] Based on the same inventive concept, the present application also provides a network management device for a cluster system, referring to Figure 6 , shows a schematic structural diagram of a network management device for a cluster system in an embodiment of the present application, wherein the network management device 600 includes: a creation unit 601, a selection unit 602, an interface unit 603, and an association unit 604. The creation unit 601 is used to select a node as a target node in the cluster system and create a target container deployment unit in the target node; the selection unit 602 is used to sequentially select a network object from a network object list corresponding to the target container deployment unit as a target network object; the interface unit 603 is used to create a first virtual network interface for each target network object through a vector packet processing engine, and create a second virtual network interface in the network namespace corresponding to the target container deployment unit; the association unit 604 is used to associate the first virtual network interface with the second virtual network interface to establish multiple network interfaces in the container deployment unit and realize communication between container deployment units, thereby ensuring the reliability of network communication and reducing the cost of traditional application migration.
[0086] Based on the same inventive concept, the present application also provides a computer-readable storage medium, in which at least one program code is stored. The at least one program code is loaded and executed by a processor to implement the operations performed by the network management method of the cluster system.
[0087] Based on the same inventive concept, the present application also provides an electronic device, referring to Figure 7 , Figure 7 A schematic structural diagram of an electronic device in an embodiment of the present application is shown.
[0088] The electronic device includes one or more memories 704, one or more processors 702 and at least one computer program (program code) stored in the memory 704 and executable on the processor 702. When the processor 702 executes the computer program, the network management method of the cluster system as described above is implemented.
[0089] Among them, Figure 7In the embodiment of the present invention, a bus architecture (represented by bus 700) is shown. Bus 700 may include any number of interconnected buses and bridges, and bus 700 links together various circuits including one or more processors represented by processor 702 and memory represented by memory 704. Bus 700 may also link together various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. Bus interface 705 provides an interface between bus 700 and receiver 701 and transmitter 703. Receiver 701 and transmitter 703 may be the same component, namely a transceiver, which provides a unit for communicating with various other devices over a transmission medium. Processor 702 is responsible for managing bus 700 and general processing, while memory 704 may be used to store data used by processor 702 when performing operations.
[0090] The functions described herein may be implemented in hardware, software executed by a processor, firmware, or any combination thereof. If implemented in software executed by a processor, the functions may be stored as one or more instructions or codes on or transmitted via a computer-readable medium. Other examples and implementations are within the scope and spirit of this application and the appended claims. For example, due to the nature of software, the functions described above may be implemented using software executed by a processor, hardware, firmware, hardwiring, or a combination of any of these. Furthermore, the functional units may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit.
[0091] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only exemplary. For example, the division of the units can be a logical function division. In actual implementation, there may be other division methods, such as multiple units 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 units or modules, which can be electrical or other forms.
[0092] The units described as separate components may or may not be physically separate, and the components of the control device may or may not be physical units, that is, they may be located in one place or distributed across multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0093] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0094] The foregoing is merely an embodiment of the present application and is not intended to limit the present application. Various modifications and variations are possible for those skilled in the art. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present application shall be included within the scope of the claims of the present application.
Claims
1. A network management method for a cluster system, characterized in that: The cluster system includes a plurality of nodes, each of which includes a plurality of container deployment units. The method includes: In the cluster system, selecting a node as a target node, and creating a target container deployment unit in the target node; Creating a network object custom resource through the cluster system; Creating a network object for each historical container deployment unit in the cluster system using the network object custom resource to obtain multiple network objects; Selecting one or more network objects from the plurality of network objects to construct a network object list for the target container deployment unit; Select one network object from the network object list corresponding to the target container deployment unit in turn as the target network object; For each target network object, create a first virtual network interface through a vector packet processing engine, and create a second virtual network interface in a network namespace corresponding to the target container deployment unit; The first virtual network interface and the second virtual network interface are associated to establish multiple network interfaces in the container deployment unit and enable communication between the container deployment units.
2. The method according to claim 1, characterized in that The step of creating a first virtual network interface by using a vector packet processing engine includes: Creating a network interface custom resource through the cluster system; The first virtual network interface is created by using the network interface custom resource and the vector packet processing engine.
3. The method according to claim 2, characterized in that After creating the first virtual network interface by using the network interface custom resource and the vector packet processing engine, the method further includes: Creating a network sub-interface corresponding to the target network object through a network interface custom resource and the vector packet processing engine, and creating a bridge domain corresponding to the network sub-interface; The first virtual network interface and the network sub-interface are associated through the bridge domain, so as to associate the target network objects corresponding to the first virtual network interface and the network sub-interface.
4. The method according to claim 1, wherein The creating a second virtual network interface in the network namespace corresponding to the target container deployment unit includes: Get a list of allocatable network addresses; Select a network address from the list of assignable network addresses as the target network address; A second virtual network interface is created in the network namespace corresponding to the target container deployment unit, wherein the target network address is used as the network address of the second virtual network interface.
5. The method according to claim 4, characterized in that After selecting a network address from the list of allocatable network addresses as the target network address, the method further includes: The target network address is removed from the list of allocatable network addresses.
6. The method according to claim 1, wherein The method further comprises: The association between the first virtual network interface and the second virtual network interface is disconnected by deleting the first virtual network interface and the second virtual network interface and releasing the network address of the second virtual network interface.
7. A network management device for a cluster system, characterized in that: The device comprises: A creation unit, configured to select a node as a target node in the cluster system and create a target container deployment unit in the target node; A selection unit, configured to sequentially select a network object from the network object list corresponding to the target container deployment unit as a target network object; an interface unit, configured to create, for each target network object, a first virtual network interface through a vector packet processing engine, and create a second virtual network interface in a network namespace corresponding to the target container deployment unit; an associating unit, configured to associate the first virtual network interface with the second virtual network interface to establish multiple network interfaces in the container deployment unit and enable communication between the container deployment units; The device is also used for: Creating a network object custom resource through the cluster system; Creating a network object for each historical container deployment unit in the cluster system using the network object custom resource to obtain multiple network objects; One or more network objects are selected from the plurality of network objects to construct a network object list for the target container deployment unit.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores at least one program code, and the at least one program code is loaded and executed by a processor to implement the operations performed by the network management method for a cluster system according to any one of claims 1 to 6.
9. An electronic device, characterized in that: The electronic device includes one or more processors and one or more memories, and at least one program code is stored in the one or more memories. The at least one program code is loaded and executed by the one or more processors to implement the operations performed by the network management method of the cluster system as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Network configuration method and device of Kubernetes cluster and electronic equipment
CN114650223A