Container network configuration method and device, equipment and storage medium

By obtaining the container IP address and port information and dynamically configuring the container network, the compatibility issues of the container network interface in complex cloud environments are solved, achieving higher flexibility and applicability.

CN120639618APending Publication Date: 2025-09-12INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510777693.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-11
Publication Date
2025-09-12

AI Technical Summary

Technical Problem

The container network interfaces based on existing general network standards are not compatible and adaptable to complex cloud environments, resulting in limitations in container network configuration and reducing flexibility and applicability.

Method used

By obtaining the container Internet Protocol IP address of the target container from the resource service platform and obtaining the port information based on the node address of the target bare metal node, adaptation to different types of bare metal gateways is achieved and the container network is dynamically configured.

Benefits of technology

It improves the flexibility and applicable scenarios of container network configuration, enhances the compatibility and scalability of different types of bare metal gateways, and meets the needs of complex cloud environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120639618A_ABST
    Figure CN120639618A_ABST
Patent Text Reader

Abstract

The invention discloses a container network configuration method and device, equipment and a storage medium. The method comprises the following steps: in response to a container network creation request, creating a target container, and selecting a target bare metal node from at least one bare metal node deployed in a current environment; when the target container is scheduled to the target bare metal node, acquiring a container IP address of the target container from the resource service platform; according to the node address of the target bare metal node, obtaining port information corresponding to the container IP address from a resource service platform; and performing container network configuration on the target container according to the port information. According to the technical scheme of the embodiment, the flexibility of container network configuration is improved, and the application scene or the application range of the container network configuration is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of network virtualization, and in particular to a container network configuration method, apparatus, device, and storage medium. Background Art

[0002] With the continuous development of network virtualization technology, container technology, as a key technology within virtualization, has attracted considerable attention. Currently, container networks are available through a common network standard specification as a plug-in, allowing users to dynamically configure the network when creating or destroying containers.

[0003] The existing container network interfaces based on general network standards are not compatible and adaptable to complex cloud environments. That is, different types of bare metal gateways are not compatible during container network configuration, which limits the container network configuration to a certain extent, greatly reduces the applicable scenarios of container network configuration, reduces the flexibility of container network configuration, and limits its scope of application to a certain extent. Summary of the Invention

[0004] The present invention provides a container network configuration method, apparatus, device, and storage medium to improve the flexibility of container network configuration and enhance the applicable scenarios or scope of container network configuration.

[0005] According to one aspect of the present invention, a container network configuration method is provided, the method comprising:

[0006] In response to the container network creation request, create a target container and select a target bare metal node from at least one bare metal node deployed in the current environment;

[0007] When the target container is scheduled to the target bare metal node, obtaining the container Internet Protocol IP address of the target container from the resource service platform;

[0008] According to the node address of the target bare metal node, obtain the port information corresponding to the container IP address from the resource service platform;

[0009] Perform container network configuration on the target container according to the port information.

[0010] According to another aspect of the present invention, a container network configuration device is provided, the device comprising:

[0011] A container creation module is configured to create a target container in response to a container network creation request, and select a target bare metal node from at least one bare metal node deployed in the current environment;

[0012] A container address acquisition module, configured to acquire the container Internet Protocol (IP) address of the target container from the resource service platform when the target container is scheduled to the target bare metal node;

[0013] A port information acquisition module is used to obtain the port information corresponding to the container IP address from the resource service platform according to the node address of the target bare metal node;

[0014] A network configuration module is used to perform container network configuration on the target container according to the port information.

[0015] According to another aspect of the present invention, an electronic device is provided, comprising:

[0016] at least one processor; and

[0017] a memory communicatively connected to the at least one processor; wherein,

[0018] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the container network configuration method described in any embodiment of the present invention.

[0019] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the container network configuration method according to any embodiment of the present invention when executed.

[0020] The technical solution of the embodiment of the present invention obtains the container IP address of the target container from the resource service platform in response to the container network creation request, obtains the port information corresponding to the container IP address from the resource service platform according to the node address of the target bare metal node, and performs container network configuration for the target container according to the port information. In this process, by obtaining the port information corresponding to the container IP address from the resource service platform based on the node address of the target bare metal node, it is possible to adapt to different types of bare metal gateways, improve the flexibility of container network configuration, and enhance the applicable scenarios or scope of container network configuration.

[0021] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0023] Figure 1 This is a flowchart of a container network configuration method provided according to the first embodiment of the present invention;

[0024] Figure 2 This is a flowchart of a container network configuration method provided according to the second embodiment of the present invention;

[0025] Figure 3 This is a structural diagram of a container network configuration device provided according to Embodiment 3 of the present invention;

[0026] Figure 4 1 is a schematic diagram of the structure of an electronic device that implements the container network configuration method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0027] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.

[0028] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0029] Example 1

[0030] Figure 1This is a flowchart of a container network configuration method provided in the first embodiment of the present invention. This embodiment is applicable to the case of dynamically configuring container network resources. The method can be executed by a container network configuration device. The container network configuration device can be implemented in the form of hardware and / or software. The container network configuration device can be configured in an electronic device. Figure 1 As shown, the method includes:

[0031] S110. In response to the container network creation request, create a target container, and select a target bare metal node from at least one bare metal node deployed in the current environment.

[0032] S120: When the target container is scheduled to the target bare metal node, obtain the container Internet Protocol IP address of the target container from the resource service platform.

[0033] S130. According to the node address of the target bare metal node, obtain the port information corresponding to the container IP address from the resource service platform.

[0034] S140: Perform container network configuration on the target container according to the port information.

[0035] It should be noted that the method of this embodiment can be executed by a container network plug-in, specifically CNI (Container Network Interface), which is called by users in a plug-in manner to execute the creation, destruction and reconstruction process of the container. The container network configuration method of this embodiment can implement the management of container network resources based on the operator mechanism of K8s (Kubernetes, container coding platform), wherein the controller component of CNI can run on the Master (master) node of K8s, the plugin component can run on the node (master) node of K8s, the master node and each slave node of K8s can be bare metal nodes, and the dynamic configuration of container network resources is implemented in the form of plug-ins. Among them, the controller component and plugin component of CNI both belong to the container network plug-in of the PaaS (Platform as a Service) resource management plug-in. PaaS is between Software as a Service (SaaS) and Infrastructure as a Service (IaaS), solves the software environment that application operation depends on, provides container interface management services, and implements the addition, deletion and query operations of stateful containers.

[0036] Among them, the container network creation request can be initiated by relevant technical personnel through the configuration file or command tool of the container coding platform according to their actual needs, or it can be automatically generated by an automation tool. For example, in the continuous integration / continuous deployment (CI / CD) process, the tool chain (such as Jenkins, etc.) can automatically trigger the creation of network resources and can also automatically trigger the creation of underlying network resources. This embodiment does not limit this.

[0037] The current environment may be a Kubernetes environment with multiple bare metal nodes deployed. As tasks execute, some bare metal nodes may be occupied while others may be idle. After the target container is created, at least one candidate bare metal node in an idle state may be selected from the at least one bare metal node, and a target bare metal node may be randomly selected from the candidate bare metal nodes.

[0038] It should be noted that each bare metal node can be managed by the PaaS platform. When the PaaS platform manages the bare metal node, it also manages the node-related information of the bare metal node, such as the node address information.

[0039] When the target container is scheduled to the target bare metal node, the container IP (Internet Protocol) address of the target container is obtained from the resource service platform. The resource service platform can be an IaaS platform. The IaaS platform maintains the container IP addresses of different containers.

[0040] In an optional embodiment, a pre-created container network segment is stored in the resource service platform; obtaining the container Internet Protocol IP address of the target container from the resource service platform includes: sending a container address acquisition request to the resource service platform, so that when the resource service platform receives the container address acquisition request, it selects an unoccupied address from the container network segment as the container IP address for feedback.

[0041] The resource service platform can pre-configure the corresponding container network segment for newly created containers. When the target container's container IP address is obtained from the resource service platform, the resource service platform can locate the target container's corresponding container network segment based on the container address acquisition request, randomly select an unoccupied IP address within the container network segment as the target container's container IP address, and provide feedback.

[0042] The above technical solution realizes that when it is determined that there is a configuration requirement for the container IP address, the resource service platform allocates the container IP to the target container based on the uniformly allocated container network segment through the unified management of the network segment of the newly created container by the resource service platform. This realizes reliable and secure management of the container IP, avoids IP allocation conflicts based on a unified dynamic allocation mechanism, and improves the flexibility of container IP allocation.

[0043] The node address of the target bare metal node can be obtained from the PaaS platform. It should be noted that the standard CNI is not compatible with different types of bare metal gateways and cannot support complex cloud environments that contain different bare metal gateway types. Therefore, to further address the bare metal gateway adaptation issue during container network configuration, a logical processing mechanism for different gateway types can be introduced when obtaining the port information corresponding to the container IP address from the resource service platform to achieve adaptation.

[0044] In an optional embodiment, based on the node address of the target bare metal node, the port information corresponding to the container IP address is obtained from the resource service platform, including: determining the gateway type of the bare metal gateway corresponding to the target bare metal node based on the node address of the target bare metal node; determining the port call logic based on the gateway type; and based on the port call logic, obtaining the port information corresponding to the container IP address from the resource service platform.

[0045] Specifically, based on the node address of the target bare metal node, the node details of the target bare metal node can be queried based on the node address. The node details can then be parsed to determine the gateway type of the bare metal gateway corresponding to the target bare metal node. For example, gateway types can include centralized gateway, enhanced gateway, and distributed gateway.

[0046] It's important to note that different types of bare metal gateways have different port call logic for obtaining the port information corresponding to the container IP address from the resource service platform. For example, the interface corresponding to the centralized gateway on the resource service platform is the port interface. Based on the port interface call logic, the gateway obtains the calling port and corresponding port information corresponding to the container IP address from the resource service platform. Specifically, the resource service platform uses the container IP address to create and bind the port, and then obtains the corresponding port information.

[0047] For another example, the enhanced gateway's corresponding interface in the resource service platform is the subport interface. Based on the subport interface's call logic, it obtains the calling port corresponding to the container's IP address and its corresponding port information from the resource service platform. Specifically, the resource service platform uses the container's IP address to create and bind the subport port, and then obtains the corresponding port information.

[0048] Therefore, after determining the gateway type of the bare metal gateway corresponding to the target bare metal node, the corresponding port call logic can be determined based on the gateway type. Based on the corresponding port call logic, the resource service platform obtains the call port created based on the container IP address and its corresponding port information. The port information can include MAC (Media Access Control) addresses and VLAN IDs (Virtual Local Area Network Identifiers).

[0049] The above technical solution determines the gateway type of the corresponding bare metal gateway according to the node address of the target bare metal node, and provides the port call logic corresponding to different gateway types to obtain the port information corresponding to the container IP address from the resource service platform. It realizes support and compatibility for different types of bare metal gateways in the process of configuring container networks in complex cloud environments, solves the adaptation problem of different types of bare metal gateways, enriches the applicable scenarios of container network configuration, and improves the flexibility and scalability of container network configuration.

[0050] The container network is configured for the target container according to the port information, specifically by adding the port information to the target container.

[0051] Furthermore, to achieve accurate configuration of the target container, in an optional embodiment, container network configuration is performed on the target container based on the port information, including: determining the media access control MAC address and virtual local area network identifier VLANID based on the port information; configuring a virtual network card corresponding to the target container based on the MAC address, and placing the VLAN ID into the target container to achieve dynamic loading of the container network of the target container; wherein the virtual network card corresponding to the target container is pre-created before the target container is created.

[0052] It should be noted that before creating the target container, it is necessary to virtualize several virtual network cards. Specifically, SR-IOV (Single Root Input / Output Virtualization) technology can be used to virtualize several virtual network cards using a pair of physical network cards.

[0053] Specifically, the port information is parsed to obtain the MAC address and VLAN ID. A virtual network card is randomly selected from several pre-virtualized virtual network cards as the target container's corresponding virtual network card. The MAC address is then used to configure the target container's corresponding virtual network card's MAC address. The VLAN ID is also placed in the target container to enable dynamic container network loading for the target container.

[0054] The above technical solution determines the MAC address and virtual local area network identifier VLAN ID based on the port information, uses the MAC address to configure the virtual network card corresponding to the target container, and places the VLAN ID into the target container, thereby achieving accurate configuration of the target container network and improving the comprehensiveness and reliability of the container network configuration.

[0055] The technical solution of the embodiment of the present invention obtains the container IP address of the target container from the resource service platform in response to the container network creation request, obtains the port information corresponding to the container IP address from the resource service platform according to the node address of the target bare metal node, and performs container network configuration for the target container according to the port information. In this process, by obtaining the port information corresponding to the container IP address from the resource service platform based on the node address of the target bare metal node, it is possible to adapt to different types of bare metal gateways, improve the flexibility of container network configuration, and enhance the applicable scenarios or scope of container network configuration.

[0056] Furthermore, for containers that have been created and put into use, there may be a need to destroy the container and rebuild it after migration. In order to recycle or destroy the created container, in an optional embodiment, after configuring the container network for the target container based on the port information, it also includes: in response to the container recycling request for the target container, sending a port unbinding request to the resource service platform, so that the resource service platform can unbind the port corresponding to the container IP address according to the port unbinding request and delete the port information of the port corresponding to the container IP address.

[0057] The container recycling request may be a request to recycle, delete, or destroy a created target container, and may be initiated by a relevant technical staff who has a need, or may be automatically initiated after a preset container usage cycle is reached. This embodiment does not impose any restrictions on this.

[0058] Specifically, in response to the container recycling request for the target container, a port unbinding request is sent to the resource service platform; the resource service platform parses the port unbinding request, determines the gateway type of the bare metal gateway of the bare metal node called by the target container, and unbinds and deletes the calling port corresponding to the target container according to the port calling logic corresponding to the gateway type, and deletes the port information related to the calling port and all custom resources maintained.

[0059] The above technical solution sends a port unbinding request to the resource service platform, and the resource service platform unbinds the port corresponding to the container IP address and deletes the port information of the port corresponding to the container IP address. It realizes the unbinding between the container and the port that needs to be deleted, destroyed or recycled, and is compatible with operations such as container deletion corresponding to different gateway types, thereby improving the compatibility and applicability of container recycling or deletion scenarios.

[0060] Furthermore, once a container has been created and put into use, there may be a need to migrate it or rebuild it after a failure. For example, the bare metal node that a container uses may be decommissioned, requiring the container to be migrated to another bare metal node. Alternatively, if the container's status is abnormal or external factors cause the bare metal node it uses to fail, the container may need to be rebuilt.

[0061] In an optional embodiment, after configuring the container network for the target container according to the port information, the method further includes: determining the fixed address identifier of the target container in response to a container reconstruction request for the target container; if the target container is determined to be a container with a fixed IP address requirement according to the fixed address identifier, retaining the container IP address of the target container; unbinding the port corresponding to the container IP address, and retaining the port and its corresponding port information in the container service platform.

[0062] Among them, the container reconstruction request can be a request for migration of an already created target container or re-establishment after a failure. It can be initiated by relevant technical personnel who have the need, or it can be automatically initiated when the preset migration and reconstruction conditions are met. This embodiment does not limit this.

[0063] The address fixation identifier indicates whether the target container requires a fixed IP address. The address fixation identifier for each target container is typically determined by the initiator of the container rebuild request or the container creation request. Therefore, the address fixation identifier can be obtained by parsing the container creation request or the container rebuild request.

[0064] If the target container is determined to require a fixed IP address based on the fixed address identifier, the target container's container IP address is retained. At the same time, the port corresponding to the container IP address is unbound, but the port and its corresponding port information are retained in the container service platform. Specifically, the binding between the target container and the container IP address is not changed in the configuration file corresponding to the target container. Only the binding between the container IP address and the port is unbound, but the port information is not deleted.

[0065] When the target container, using a fixed address identifier, is identified as requiring a fixed IP address, the above technical solution retains the target container's container IP address and only unbinds the port corresponding to the container IP address. However, the port and its corresponding port information are retained in the container service platform. This addresses the issue of standard CNI not supporting container IP address retention, which prevents fixed container IP addresses and fails to meet the requirements of stateful applications such as MySQL. It enables a container reconstruction process that can select a fixed container IP address based on actual application needs.

[0066] Furthermore, in an optional embodiment, after determining the fixed address identifier of the target container in response to the container reconstruction request for the target container, the method further includes: if it is determined based on the fixed address identifier that the target container is a container that does not require a fixed IP address, unbinding the port corresponding to the container IP address and deleting the port information of the port corresponding to the container IP address; re-requesting the container IP address of the target container from the resource service platform, and obtaining and binding the port and port information corresponding to the re-requested container IP address from the resource service platform.

[0067] If the target container is determined to be a container that does not require a fixed IP address based on the address fixed identifier, the port corresponding to the container IP address is unbound, and the unbinding information between the container IP address and the port is changed in the configuration file corresponding to the target container. The resource service platform is requested to re-request the container IP address of the target container, and the resource service platform re-determines an unoccupied IP address based on the container network segment corresponding to the target container. The resource service platform also re-obtains and binds the port and port information corresponding to the container IP address requested by Chongqing, and uses the port information to re-configure the container network for the target container.

[0068] When the target container is determined to require a fixed IP address through an address fixation identifier, the above technical solution retains the target container's container IP address and only unbinds the port corresponding to the container IP address. However, the port and its corresponding port information are retained in the container service platform. This addresses the problem that standard CNI does not support the retention of container IP addresses, meaning it cannot fix container IP addresses and cannot meet the requirements of stateful applications such as MySQL. It enables the container reconstruction process to choose a non-fixed container IP address based on actual application needs.

[0069] Example 2

[0070] Figure 2 This is a flowchart of a container network configuration method provided in Example 2 of the present invention. This embodiment provides a preferred example based on the above embodiment.

[0071] like Figure 2 As shown, the method includes the following specific steps:

[0072] S201. Use SR-IOV technology to virtualize a plurality of virtual network cards using a pair of physical network cards.

[0073] S202: In response to the container network creation request, create a target container, and select a target bare metal node from at least one bare metal node deployed in the current environment.

[0074] S203. When the target container is scheduled to the target bare metal node, a container address acquisition request is sent to the resource service platform, so that the resource service platform can select an unoccupied address from the container network segment as the container IP address for feedback when receiving the container address acquisition request.

[0075] S204. Determine the gateway type of the bare metal gateway corresponding to the target bare metal node according to the node address of the target bare metal node.

[0076] S205: Determine the port call logic according to the gateway type, and obtain the port information corresponding to the container IP address from the resource service platform based on the port call logic.

[0077] S206: Determine the MAC address and VLAN ID based on the port information, configure the virtual network card corresponding to the target container based on the MAC address, and place the VLAN ID in the target container to achieve dynamic container network loading for the target container. If there is a container recycling request for the target container, execute S207; if there is a container reconstruction request for the target container, execute S208-S209;

[0078] S207: Send a port unbinding request to the resource service platform, so that the resource service platform can unbind the port corresponding to the container IP address according to the port unbinding request and delete the port information of the port corresponding to the container IP address.

[0079] S208: Determine the fixed address identifier of the target container.

[0080] S209A: If the target container is determined to be a container requiring a fixed IP address based on the fixed address identifier, the container IP address of the target container is retained, and the port corresponding to the container IP address is unbound, and the port and its corresponding port information are retained in the container service platform.

[0081] S209B. If it is determined based on the fixed address identifier that the target container is a container that does not require a fixed IP address, the port corresponding to the container IP address is unbound, the port information of the port corresponding to the container IP address is deleted, the container IP address of the target container is re-requested from the resource service platform, and the port and port information corresponding to the re-requested container IP address are obtained and bound.

[0082] Example 3

[0083] Figure 3 This is a structural diagram of a container network configuration device provided by the third embodiment of the present invention. The container network configuration device provided by the embodiment of the present invention is applicable to the case of dynamically configuring container network resources. The container network configuration device can be implemented in the form of hardware and / or software, such as Figure 3 As shown, the device specifically includes: a container creation module 301, a container address acquisition module 302, a port information acquisition module 303 and a network configuration module 304.

[0084] The container creation module 301 is configured to create a target container in response to a container network creation request, and select a target bare metal node from at least one bare metal node deployed in the current environment;

[0085] A container address acquisition module 302 is configured to acquire a container Internet Protocol (IP) address of the target container from a resource service platform when the target container is scheduled to the target bare metal node.

[0086] The port information acquisition module 303 is used to obtain the port information corresponding to the container IP address from the resource service platform according to the node address of the target bare metal node;

[0087] The network configuration module 304 is configured to perform container network configuration on the target container according to the port information.

[0088] The technical solution of the embodiment of the present invention obtains the container IP address of the target container from the resource service platform in response to the container network creation request, obtains the port information corresponding to the container IP address from the resource service platform according to the node address of the target bare metal node, and performs container network configuration for the target container according to the port information. In this process, by obtaining the port information corresponding to the container IP address from the resource service platform based on the node address of the target bare metal node, it is possible to adapt to different types of bare metal gateways, improve the flexibility of container network configuration, and enhance the applicable scenarios or scope of container network configuration.

[0089] Optionally, the port information acquisition module 303 is specifically configured to:

[0090] Determine the gateway type of the bare metal gateway corresponding to the target bare metal node according to the node address of the target bare metal node;

[0091] Determine the port call logic according to the gateway type;

[0092] Based on the port call logic, the port information corresponding to the container IP address is obtained from the resource service platform.

[0093] Optionally, the network configuration module 304 is specifically configured to:

[0094] Determine a media access control MAC address and a virtual local area network identifier VLANID according to the port information;

[0095] Configure a virtual network card corresponding to the target container according to the MAC address, and put the VLAN ID into the target container to implement dynamic container network loading of the target container;

[0096] The virtual network card corresponding to the target container is pre-created before the target container is created.

[0097] Optionally, the resource service platform stores a pre-created container network segment; the container address acquisition module 302 is specifically configured to:

[0098] A container address acquisition request is sent to the resource service platform, so that the resource service platform selects an unoccupied address from the container network segment as the container IP address for feedback when receiving the container address acquisition request.

[0099] Optionally, the device further includes:

[0100] A container deletion module is configured to, after configuring the target container network according to the port information, send a port unbinding request to the resource service platform in response to a container recycling request for the target container, so that the resource service platform can unbind the port corresponding to the container IP address according to the port unbinding request and delete the port information of the port corresponding to the container IP address.

[0101] Optionally, the device further includes:

[0102] An address identifier determining module, configured to determine a fixed address identifier of the target container in response to a container reconstruction request for the target container after performing container network configuration for the target container according to the port information;

[0103] an address reservation module, configured to reserve the container IP address of the target container if it is determined, based on the address fixed identifier, that the target container is a container requiring a fixed IP address;

[0104] The port unbinding module is used to unbind the port corresponding to the container IP address and retain the port and its corresponding port information in the container service platform.

[0105] Optionally, the device further includes:

[0106] a port information deletion module configured to, after determining the fixed address identifier of the target container in response to the container reconstruction request for the target container, unbind the port corresponding to the container IP address and delete the port information of the port corresponding to the container IP address if it is determined, based on the fixed address identifier, that the target container is a container that does not require a fixed IP address;

[0107] The IP address reconstruction module is used to re-request the container IP address of the target container from the resource service platform, and obtain and bind the port and port information corresponding to the re-requested container IP address from the resource service platform.

[0108] The container network configuration device provided in the embodiment of the present invention can execute the container network configuration method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0109] Example 4

[0110] Figure 4 A schematic diagram of the structure of an electronic device 40 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.

[0111] like Figure 4As shown, the electronic device 40 includes at least one processor 41 and a memory, such as a read-only memory (ROM) 42, a random access memory (RAM) 43, etc., which is communicatively connected to the at least one processor 41. The memory stores a computer program that can be executed by the at least one processor, and the processor 41 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 42 or the computer program loaded from the storage unit 48 into the random access memory (RAM) 43. Various programs and data required for the operation of the electronic device 40 can also be stored in the RAM 43. The processor 41, ROM 42, and RAM 43 are connected to each other via a bus 44. An input / output (I / O) interface 45 is also connected to the bus 44.

[0112] Multiple components in the electronic device 40 are connected to the I / O interface 45, including an input unit 46, such as a keyboard, a mouse, etc.; an output unit 47, such as various types of displays, speakers, etc.; a storage unit 48, such as a magnetic disk, an optical disk, etc.; and a communication unit 49, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 49 allows the electronic device 40 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0113] Processor 41 can be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of processor 41 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors that run machine learning model algorithms, digital signal processors (DSPs), and any other suitable processors, controllers, microcontrollers, etc. Processor 41 executes the various methods and processes described above, such as the container network configuration method.

[0114] In some embodiments, the container network configuration method can be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 48. In some embodiments, part or all of the computer program can be loaded and / or installed on electronic device 40 via ROM 42 and / or communication unit 49. When the computer program is loaded into RAM 43 and executed by processor 41, one or more steps of the container network configuration method described above can be performed. Alternatively, in other embodiments, processor 41 can be configured to execute the container network configuration method in any other suitable manner (e.g., via firmware).

[0115] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0116] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer program is executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer program may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0117] In the context of the present invention, computer-readable storage media can be tangible media that can contain or store a computer program for use with an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Computer-readable storage media can include but are not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, computer-readable storage media can be machine-readable signal media. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0118] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0119] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0120] A computing system may include clients and servers. The clients and servers are typically remote from each other and typically interact via a communication network. This client-server relationship arises through computer programs running on the respective computers, creating a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host. This server is a hosting product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and VPS services.

[0121] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the present invention can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved. This is not limited herein.

[0122] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.

Claims

1. A container network configuration method, characterized in that: include: In response to the container network creation request, create a target container and select a target bare metal node from at least one bare metal node deployed in the current environment; When the target container is scheduled to the target bare metal node, obtaining the container Internet Protocol IP address of the target container from the resource service platform; According to the node address of the target bare metal node, obtain the port information corresponding to the container IP address from the resource service platform; Perform container network configuration on the target container according to the port information.

2. The method according to claim 1, characterized in that The acquiring, from the resource service platform according to the node address of the target bare metal node, port information corresponding to the container IP address includes: Determine the gateway type of the bare metal gateway corresponding to the target bare metal node according to the node address of the target bare metal node; Determine the port call logic according to the gateway type; Based on the port call logic, the port information corresponding to the container IP address is obtained from the resource service platform.

3. The method according to claim 1, characterized in that The performing container network configuration on the target container according to the port information includes: Determine a media access control MAC address and a virtual local area network identifier VLAN ID according to the port information; Configure a virtual network card corresponding to the target container according to the MAC address, and put the VLAN ID into the target container to implement dynamic container network loading of the target container; The virtual network card corresponding to the target container is pre-created before the target container is created.

4. The method according to claim 1, wherein The resource service platform stores a pre-created container network segment; and obtaining the container Internet Protocol (IP) address of the target container from the resource service platform includes: A container address acquisition request is sent to the resource service platform, so that the resource service platform selects an unoccupied address from the container network segment as the container IP address for feedback when receiving the container address acquisition request.

5. The method according to claim 1, characterized in that After configuring the target container network according to the port information, the method further includes: In response to the container recycling request for the target container, a port unbinding request is sent to the resource service platform, so that the resource service platform unbinds the port corresponding to the container IP address according to the port unbinding request and deletes the port information of the port corresponding to the container IP address.

6. The method according to claim 1, characterized in that After configuring the target container network according to the port information, the method further includes: In response to a container reconstruction request for the target container, determining an address fixed identifier of the target container; If it is determined according to the fixed address identifier that the target container is a container requiring a fixed IP address, retaining the container IP address of the target container; The port corresponding to the container IP address is unbound, and the port and its corresponding port information are retained in the container service platform.

7. The method according to claim 6, characterized in that After determining the fixed address identifier of the target container in response to the container reconstruction request for the target container, the method further includes: If it is determined according to the fixed address identifier that the target container is a container that does not require a fixed IP address, an unbinding operation is performed on the port corresponding to the container IP address to delete the port information of the port corresponding to the container IP address; Re-request the container IP address of the target container from the resource service platform, and obtain and bind the port and port information corresponding to the re-requested container IP address from the resource service platform.

8. A container network configuration device, characterized in that: include: A container creation module is configured to create a target container in response to a container network creation request, and select a target bare metal node from at least one bare metal node deployed in the current environment; A container address acquisition module, configured to acquire the container Internet Protocol (IP) address of the target container from the resource service platform when the target container is scheduled to the target bare metal node; A port information acquisition module is used to obtain the port information corresponding to the container IP address from the resource service platform according to the node address of the target bare metal node; A network configuration module is used to perform container network configuration on the target container according to the port information.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor. The computer program is executed by the at least one processor to enable the at least one processor to execute the container network configuration method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the container network configuration method according to any one of claims 1 to 7 when executed.