IP address allocation method and device of container unit, equipment and medium

By allocating fixed IP addresses to container units in a cloud-native network and scheduling to idle nodes, the communication problems caused by dynamic changes in container units' IP addresses are solved, and the stability of business processes and the full utilization of node resources are achieved.

CN120238518APending Publication Date: 2025-07-01PING AN PAY ELECTRONIC PAYMENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510504717.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-21
Publication Date
2025-07-01

AI Technical Summary

Technical Problem

In large-scale containerized environments, dynamic changes in the IP address of container units often lead to communication problems with upstream systems and external services, affecting the stability of business processes.

Method used

By adding a fixed identifier to the application configuration file of the cloud native network, a fixed IP address is assigned to the container unit, and an available IP address is selected from the public IP pool. After fixed processing, it is used for the newly created container unit and scheduled to any idle computing node.

Benefits of technology

The container unit has a fixed IP address allocation. The container unit is scheduled to any idle node through the fixed IP address, so that the node resources can be fully utilized, adapt to the needs of a large-scale containerized environment, and ensure the stability of business processes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120238518A_ABST
    Figure CN120238518A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of cloud computing, and discloses an IP address allocation method and device for a container unit, equipment and a medium, and the method comprises the steps: adding a first fixed identifier in an application configuration file of a cloud native network, the first fixed identifier being used for allocating a fixed IP address for the container unit, the IP address being started on network connection equipment; when the cloud native network creates the application program for the first time, selecting an available IP address from the public IP pool and distributing the available IP address to a container unit newly created by the application program; the available IP address is fixedly used for the newly-created container unit after being subjected to fixing processing, and the newly-created container unit is scheduled to any idle computing node according to the IP address subjected to fixing processing. The container unit can be scheduled to any idle node through the fixedly allocated IP address, so that node resources are fully utilized to better adapt to the requirements of a large-scale containerization environment, and the stability of a service process is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of cloud computing, and particularly to a method, device, equipment and medium for allocating IP addresses of container units. Background Art

[0002] With the wide application of containerization technology, the number of containers and resource requirements are constantly changing, which requires network resources to be dynamically allocated according to the real-time needs of containers to avoid network congestion or resource waste. Generally, container units use IP addresses to identify devices or users. By managing the IP addresses of container units, network connection and data transmission can be achieved. Without reasonable IP address allocation, container units cannot be recognized and accessed in the cloud-native network, and their functions cannot be realized.

[0003] In the related art, in a large-scale containerized environment, the IP address allocation of container units depends on a predefined IP pool. Here, the predefined IP pool usually determines the allocation strategy of container units when the network is deployed. However, the network topology in the containerized environment is complex and changeable, and the dynamic change of the IP address of the application system often causes communication problems with upstream systems and external services, affecting the stability of the business process. Summary of the Invention

[0004] The present invention provides a method, device, computer equipment and medium for allocating IP addresses of container units to solve the technical problem that the dynamic change of the IP address of the application system in the related art often causes communication problems with upstream systems and external services, affecting the stability of the business process.

[0005] In a first aspect, a method for allocating IP addresses of container units is provided, including:

[0006] Adding a first fixed identifier to the application configuration file in the cloud-native network, where the first fixed identifier is used to allocate a fixed IP address for the container unit, and the IP address is started on the network connection device;

[0007] When the cloud-native network creates an application for the first time, selecting an available IP address from the public IP pool and allocating it to the newly created container unit of the application;

[0008] Fixing the available IP address for the newly created container unit to use fixedly, and scheduling the newly created container unit to any idle computing node according to the fixed IP address.

[0009] In a second aspect, a device for allocating IP addresses of container units is provided, including:

[0010] An adding module, configured to add a first fixed identifier to an application configuration file of a cloud-native network, where the first fixed identifier is used to assign a fixed IP address to a container unit, and the IP address is started on a network connection device;

[0011] An allocating module, configured to select an available IP address from a public IP pool and allocate it to a newly created container unit of an application when the cloud-native network creates the application for the first time;

[0012] A scheduling module, configured to fixedly use the available IP address for the newly created container unit after fixed processing, and schedule the newly created container unit to any idle computing node according to the fixed IP address after fixed processing.

[0013] In a third aspect, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the above IP address allocation method for the container unit are implemented.

[0014] In a fourth aspect, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above IP address allocation method for the container unit are implemented.

[0015] In the solution implemented by the above IP address allocation method, device, computer device, and storage medium for the container unit, a first fixed identifier can be added to an application configuration file of a cloud-native network. The first fixed identifier is used to assign a fixed IP address to a container unit, and the IP address is started on a network connection device; when the cloud-native network creates an application for the first time, an available IP address is selected from a public IP pool and allocated to a newly created container unit of the application; the available IP address is fixedly used for the newly created container unit after fixed processing, and the newly created container unit is scheduled to any idle computing node according to the fixed IP address after fixed processing. In the present invention, by fixedly processing the available IP address and using it for the container unit in the cloud-native network, a fixed IP address allocation for the container unit is realized. Through the fixedly allocated IP address, the container unit can be scheduled to any idle node, so that the node resources are fully utilized to better meet the requirements of a large-scale containerized environment and ensure the stability of the business process. Description of the Drawings

[0016] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0017] Figure 1 It is a schematic diagram of an application environment of the IP address allocation method for the container unit in an embodiment of the present invention;

[0018] Figure 2 It is a schematic flowchart of the IP address allocation method for the container unit in an embodiment of the present invention;

[0019] Figure 3 is Figure 1 a schematic flowchart of a specific implementation manner of step S10 in;

[0020] Figure 4 It is a schematic flowchart of the IP address allocation method for the container unit in another embodiment of the present invention;

[0021] Figure 5 is Figure 1 a schematic flowchart of a specific implementation manner of step S104 in;

[0022] Figure 6 It is a schematic flowchart of the IP address allocation method for the container unit in an embodiment of the present invention;

[0023] Figure 7 is Figure 1 a schematic flowchart of a specific implementation manner of step S30 in;

[0024] Figure 8 It is a schematic flowchart of the IP address allocation method for the container unit in another embodiment of the present invention;

[0025] Figure 9 It is a schematic structural diagram of the IP address allocation device for the container unit in an embodiment of the present invention;

[0026] Figure 10 It is a schematic structural diagram of a computer device in an embodiment of the present invention;

[0027] Figure 11 It is another schematic structural diagram of a computer device in an embodiment of the present invention. Specific Embodiments

[0028] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0029] The IP address allocation method for the container unit provided by the embodiments of the present invention can be applied in, such as Figure 1In the application environment, the client adds a first fixed identifier to the application configuration file of the cloud-native network. The first fixed identifier is used to assign a fixed IP address to the container unit, and the IP address is started on the network connection device. When the cloud-native network creates an application for the first time, an available IP address is selected from the public IP pool and assigned to the newly created container unit of the application. After the available IP address is fixed, it is fixedly used by the newly created container unit. According to the fixed IP address, the newly created container unit is scheduled to any idle computing node on the server side. In the present invention, by using the available IP address after fixed processing in the cloud-native network for the container unit, the container unit has a fixed IP address assignment. Through the fixed-assigned IP address, the container unit can be scheduled to any idle node, making full use of the node resources to better meet the requirements of the large-scale containerized environment and ensuring the stability of the business process. Among them, the client can include, but is not limited to, various personal computers, laptop computers, smartphones, tablet computers, and portable wearable devices. The server side can be implemented by an independent server or a server cluster composed of multiple servers. The present invention will be described in detail through specific embodiments below.

[0030] Please refer to Figure 2 as shown in Figure 2 FIG. is a schematic flowchart of a method for assigning an IP address to a container unit provided by an embodiment of the present invention, including the following steps:

[0031] S10: Add a first fixed identifier to the application configuration file of the cloud-native network.

[0032] The method for assigning an IP address to a container unit provided by the present invention can be applied in a containerized application environment, and each container unit may run different microservices or application components. For example, an e-commerce application may be split into multiple microservices such as user service, order service, and payment service, and each microservice is deployed in a container unit. In order for these container units to communicate with each other, an independent IP address needs to be assigned to each container unit, so that different microservices can communicate through the IP address to ensure the normal operation of the entire application system. Here, the container unit is the smallest deployable computing unit in the node cluster, including one or more closely related containers. These containers usually share the same network namespace, storage volume, and other resources and run on the same computing unit to achieve more efficient resource sharing and collaborative work. For example, a container unit contains a web application container and a database container, and the two containers communicate through the local network and share the storage volume to store data.

[0033] Among them, the first fixed identifier is used to assign a fixed IP address to the container unit, and the IP address is started on the network connection device. Here, the computing node is a unit in the cloud-native network used to undertake computing tasks, and it can be a physical machine, a virtual machine, a container, etc. The fixed IP address refers to an IP address that is long-term and stable for the container unit in the network environment. Compared with the dynamic IP address, the fixed IP address will not be automatically changed due to device restart, network connection change, or other factors.

[0034] Generally speaking, in order to adapt to network environment changes and meet system availability, the IP address of the application system may change dynamically, and the dynamic change of the IP address of the application system often leads to communication problems with upstream systems and external services. For example, when the egress gateway application runs in the cloud environment, the dynamic change of its IP address will cause frequent adjustment of firewall policies. For example, when the container unit of the egress gateway is rebuilt or expanded, the new IP address needs to be updated to the firewall policy in time, otherwise it may lead to network communication interruption or security policy failure. This frequent change of IP address will increase the maintenance complexity of the firewall and even become a bottleneck in system performance, affecting overall availability. Also, for example, in some distributed systems, applications communicate with each other through IP addresses. If the IP address of the downstream application changes frequently, the upstream application needs to continuously update the configuration file or service discovery mechanism, increasing the complexity and maintenance cost of the system. In addition, some core applications are called by multiple systems, and the dynamic change of the IP address will affect the stable access of the upstream system, resulting in service interruption or performance degradation. The embodiment of the present invention deploys a fixed IP for the application system by specifying an IP pool to ensure the stability and security of the network.

[0035] In a specific implementation scenario, the fixed IP assignment provides a fixed IP address for the container unit, ensuring that each container unit has a unique and stable identifier in the network, which is convenient for other devices to communicate. Among them, as Figure 3 shown, in step S10, that is, adding the first fixed identifier to the application configuration file in the cloud-native network includes the following steps:

[0036] S11: Determine the metadata of the container unit in the application configuration file of the cloud-native network.

[0037] S12: For the metadata of the container unit, identify the need for a fixed IP address for the container unit by custom adding annotations and / or labels, and the annotations and / or labels meet the format requirements of the cloud-native network.

[0038] In this embodiment, the application configuration file of the cloud-native network is a file used to define how the cloud-native network runs and configures in the container environment. It is usually written in a set format and contains configuration information in multiple parts. In the application configuration file, global parameters of the cloud-native network can be configured, such as network mode, IP address management method, and encryption options, etc. Parameters related to network proxies can also be configured, including the enabled state and working mode of the proxy. At the same time, network policies for the node cluster can be configured to determine whether to enable and whether to support custom policy resources.

[0039] Specifically, the application configuration file of the cloud-native network records the configuration information of the connection to the node cluster, enabling the cloud-native network to connect to the interface server of the node cluster. This is the basis for obtaining the metadata of the container unit. Then, the metadata of the specified container unit is obtained through the selector in the application configuration file. Here, filtering can be performed according to information such as the label and namespace of the container unit. For example, by setting a specific label selector, the cloud-native network can identify the container unit with a specific label and obtain the metadata of this container unit. These metadata include information such as the name and creation time of the container unit. For the metadata of the container unit that needs to be assigned a fixed IP address, annotations and / or labels can be added customarily. For example, a label named fixed-ip.requirement is created and its value is set to true to indicate that this container unit requires a fixed IP address. It should be noted that the annotations and / or labels here meet the format requirements of the cloud-native network.

[0040] S20: When the cloud-native network creates an application for the first time, select an available IP address from the public IP pool and assign it to the newly created container unit of the application.

[0041] In this embodiment, the public IP pool is a set of public IP addresses that can be collectively allocated in the cloud-native network environment. These IP addresses have public accessibility and can be directly accessed on the Internet. When a new application or container unit is created in the native cloud network, the system will select an available IP address from the public IP pool for allocation. This dynamic allocation mechanism can flexibly provide network addresses according to the actual needs of the application, improving the utilization rate of IP resources. When an application no longer needs a certain public IP address, this IP address will be released back to the public IP pool for reallocation to other applications or container units that need it, thus realizing the recycling of IP resources.

[0042] It can be understood that in order to maintain data consistency between different computing nodes, when a computing node in the node cluster needs to obtain or update an IP address, the distributed key-value storage system can be used to record the IP address allocation information of the container unit, avoiding network configuration errors caused by data inconsistency.

[0043] Further, as Figure 4 shown, after step S20, the method further includes the following steps:

[0044] S40: Package the available IP address and the network configuration information of the newly created container unit into a key-value pair and send it to the distributed key-value storage system to record the IP address allocation information of the container unit through the distributed key-value storage system.

[0045] Correspondingly, S50: When the node cluster in the cloud-native network triggers the reconstruction of the container unit, allocate the original fixed IP address to the corresponding container unit according to the IP address allocation information recorded in the distributed key-value storage system.

[0046] In this embodiment, the distributed key-value storage system is used for sharing and configuring service discovery, providing reliable data storage and coordination services for the node cluster. When a new container unit is created in the node cluster, the network plugin of the node cluster is responsible for allocating an available IP address to it. This IP address allocation is based on pre-set network policies and address pools to ensure that the IP addresses in the node cluster do not conflict and comply with the network sail. Once the IP address allocation is completed, the relevant IP address information, such as the IP address itself, subnet mask, gateway, etc., and other network configuration information related to the container unit will be organized together. Then these information will be packaged into the form of a key-value pair. The key is usually a string that uniquely identifies the container unit, such as a name or UID, and the value is a data structure containing all the IP addresses and network configuration information. The generated key-value pair is sent to the distributed key-value storage system through the internal mechanism of the node cluster to record the IP address allocation information of the container unit and maintain the IP address allocation information of the container unit.

[0047] It can be understood that due to certain reasons, such as container unit failure, configuration change, etc., resulting in the need to reconstruct the container unit, the relevant components in the node cluster will detect this reconstruction requirement. At this time, the system will immediately start the process of obtaining the original IP address allocation information of the container unit.

[0048] Next, the system will access the distributed key-value storage system. As a reliable distributed key-value storage system, the distributed key-value storage system has previously recorded the IP address allocation information of each container unit. The system will query in the distributed key-value storage system based on the unique identifier of the reconstructed container unit, such as the container unit name, UID, etc. Through this unique identifier, the system can accurately find the key-value pair corresponding to the reconstructed container unit, and the "value" part stored in this key-value pair contains the fixed IP address previously assigned to the container unit and related network configuration information, such as subnet mask, gateway, etc. After obtaining this information, the system will pass this network configuration information to the component responsible for allocating IP addresses to the reconstructed container unit, usually the network plugin of the cloud-native network. The network plugin will perform a series of operations at the network level based on the received information and configure the original fixed IP address to the reconstructed container unit.

[0049] During the configuration process, the network plugin will interact with network devices in the cluster, such as switches, to ensure that the newly configured IP address can be correctly recognized and routed in the network. At the same time, it will also update the network connections and security policies related to the container unit to ensure that the reconstructed container unit can communicate normally with other container units and services with its previous network identity.

[0050] After the above operations, the reconstructed container unit will be assigned the original fixed IP address, so that it can continue to play its due role in the node cluster and will not affect the communication and cooperation between other components due to the change of the IP address.

[0051] In the actual application scenario, considering the continuous expansion of business requirements, the node cluster needs to newly create container units to meet the increasing business requirements. This requires allocating IP addresses for the newly created container units on the basis of the original IP address allocation. Further, as Figure 5 shown, after step S40, the method further includes the following steps:

[0052] S60: When the application needs to be scaled out, select an unused IP address from the public IP pool according to the IP address allocation information recorded in the distributed key-value storage system, and assign the unused IP address to the container unit created by the scale-out after fixed processing.

[0053] In this embodiment, when the application needs to be scaled out, new container units need to be created. At this time, the component responsible for IP address allocation will start to work. It first queries the IP address information already allocated in the distributed key-value storage system. Since the distributed key-value storage system records the IP address information already allocated in the node cluster, including the IP address corresponding to each container unit and the relevant network configuration details. Then, it checks the IP addresses in the public IP pool against the IP address information already allocated in the distributed key-value storage system, selects unused IP addresses in the public IP pool. The unused IP addresses are equivalent to unallocated IP addresses, and further allocates the unallocated IP addresses to the container units created during the scaling out.

[0054] In an actual application scenario, computing nodes may fail, which will affect the normal operation of the container units running on them. To avoid data loss, the container units need to be removed from the computing nodes.

[0055] Further, as Figure 6 shown, after step S40, the method further includes the following steps:

[0056] S70: When the container unit is removed from the computing node, release the IP address fixedly used by the container unit back to the public IP pool, and update the IP address allocation information corresponding to the released IP address in the distributed key-value storage system, so that the released IP address can be reused by other container units.

[0057] In this embodiment, when the container unit is removed from the computing node, the relevant network management component will identify the fixed IP address occupied by the container unit and unbind this IP address from the network configuration of the container unit. This released fixed IP address will be returned to the public IP pool. The public IP pool is a repository for storing available IP address segments, and all released IP addresses will return here to wait for reallocation. Next, the system will update the allocation information of this IP address in the distributed key-value storage system. Correspondingly, the system finds the key-value pair of the IP address allocation information corresponding to the previously removed container unit and updates the status therein to "unallocated" or "available", indicating that this IP address can be used by other container units.

[0058] Through the above steps, the released fixed IP address can re-enter the IP address allocation process. When a newly created container unit needs to be allocated an IP address subsequently, the system will query the distributed key-value storage system and the public IP pool. If this released IP address is in an available state, it can be allocated to the new container unit, realizing the recycling of IP address resources, improving the resource utilization rate, and ensuring the reasonable allocation of IP addresses in the node cluster.

[0059] S30: Fix the available IP address for the newly created container unit after fixation processing, and schedule the newly created container unit to any idle computing node according to the fixed IP address.

[0060] In this embodiment, the available IP address has the characteristic of being applicable to any computing node. In a large-scale cloud computing scenario, the number of computing nodes may change dynamically, and the business requirements may also be adjusted at any time. At the same time, this characteristic also provides strong support for coping with network failures. When a network failure occurs in a certain computing node, for example, its original IP address cannot be used due to network conflicts or hardware problems, the system can quickly obtain a new available IP address from the IP address pool and reconfigure it for the computing node, so that the computing node can quickly restore the network connection and reduce the business interruption time caused by the failure.

[0061] In a specific implementation scenario, the available IP address can be fixed by binding it to the container unit. Next, the system will search for idle computing nodes in the node cluster according to the fixed IP address, so as to schedule the created container unit to the corresponding computing node. Among them, as Figure 7 shown, in step S30, that is, after fixing the available IP address for the newly created container unit, and scheduling the newly created container unit to any idle computing node according to the fixed IP address, includes the following steps:

[0062] S31: Bind the available IP address as a fixed IP address to the newly created container unit and store the formed mapping relationship in the application fixed IP pool.

[0063] S32: Schedule the newly created container unit to any idle computing node according to the fixed IP address in the application fixed IP pool.

[0064] In this embodiment, the available IP address is an IP address selected from the public IP pool. If this IP address wants to be used as a fixed IP address, it can be bound to the container unit. After the binding is completed, the system will record the mapping relationship between this fixed IP address and the container unit and store it in the application fixed IP pool. Here, the application fixed IP pool is equivalent to a database storing mapping relationships, which is convenient for the subsequent system to query and manage IP addresses.

[0065] Correspondingly, the system will search for computing nodes within the entire node cluster based on the bound fixed IP address. Specifically, it can evaluate the working status of each computing node one by one and carefully check various resource metrics of the computing nodes to determine the computing nodes in the idle state. For example, whether there is still idle computing power of the CPU, whether the memory space is sufficient, whether the storage capacity is enough, etc. Once a qualified idle computing node is successfully locked, the system will immediately execute the scheduling operation and deploy the newly created container unit to this idle computing node. In this way, the newly created container unit can run smoothly on the selected computing node and communicate and interact with other components in the network by means of the previously bound fixed IP address, enabling the entire application to run stably.

[0066] It can be understood that when a container unit in the cloud-native network needs to be re-enabled for some reason, since there is a pre-established mapping relationship between the container unit and the fixed IP address, the fixed IP address used by the container unit can be accurately queried according to the pre-established mapping relationship later, and the container unit can be scheduled to any idle computing node according to the fixed IP address. Further, as Figure 8 shown, after step S30, the method further includes the following steps:

[0067] S80: When the newly created container unit is re-enabled, use the mapping relationship to query the fixed IP address mapped by the container unit, and schedule the container unit to any idle computing node according to the fixed IP address.

[0068] In this embodiment, the scenarios where the container unit is re-enabled include the following: When a new version of the application is released, it is necessary to update the application code / configuration file or dependencies of the container unit, and usually the container unit needs to be re-enabled. If resource bottlenecks occur during the operation of the container unit, such as too high CPU usage, insufficient memory, or limited network bandwidth, resulting in a decline in the performance of the application or even abnormal operation, the container unit needs to be re-enabled. When the container fails or crashes due to software errors, hardware problems, or other reasons, in order to restore the normal operation of the application, the container unit needs to be re-enabled.

[0069] Specifically, the IP address allocated to the container unit will form a mapping relationship and be stored in the application fixed IP pool after being fixed. When the container unit is re-enabled, the fixed IP address corresponding to the container unit will usually be queried in the mapping relationship according to the unique identifier of the container unit. Once the fixed IP address mapped by the container unit is obtained, it is necessary to check the status of the nodes in the cluster to schedule the container unit to any idle computing node.

[0070] It is understandable that each computing node continuously reports its own operating status and resource usage to the system, including key information such as the CPU busyness, memory occupancy, remaining disk space, and network bandwidth usage. The system will evaluate these computing nodes one by one to determine whether a computing node is in an idle state. Here, the idle state means that the computing node has sufficient resources to accept the operation of new container units and will not affect the normal execution of container units and other tasks it has carried due to insufficient resources. After completing the status evaluation of all computing nodes, the system will select the computing nodes in the idle state from among many computing nodes. If there are multiple idle computing nodes, the system will make a selection according to the pre-set scheduling policies. These policies include but are not limited to the load balancing principle, that is, preferentially selecting the computing node with relatively lower current load to ensure a more balanced resource allocation across the entire cluster; or considering network topology factors and selecting the computing node that is closer to the network resources required by the container unit and has lower network latency to optimize the network communication performance of the container unit.

[0071] When the idle computing node is finally determined, the system will perform the key scheduling operation. Through a series of complex coordination and instruction transmissions, the system will schedule the container units to be scheduled to the selected idle computing nodes. During this process, the container units will carry the fixed IP address information queried previously, restart on the new computing nodes and perform network configuration to ensure that they can communicate and interact with other components in the network normally by virtue of the fixed IP address. In this way, it not only ensures that the container units can run stably on appropriate computing resources but also maintains their fixed identities in the network, thus guaranteeing the stable and efficient operation of the entire cloud-native application system.

[0072] It should be understood that the magnitudes of the sequence numbers of the steps in the above embodiments do not mean the order of execution. The order of execution of each process should be determined according to its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.

[0073] In one embodiment, there is provided an IP address allocation device for a container unit, and the IP address allocation device for the container unit corresponds one-to-one with the IP address allocation method for the container unit in the above embodiment. As Figure 9 shown, the IP address allocation device for the container unit includes an adding module 101, an allocating module 102, and a scheduling module 103. The detailed descriptions of each functional module are as follows:

[0074] The adding module 101 is used to add a first fixed identifier to the application configuration file of the cloud-native network, and the first fixed identifier is used to allocate a fixed IP address for the container unit, and the IP address is started on the network connection device;

[0075] An allocation module 102, which is used to select an available IP address from a public IP pool and allocate it to a newly created container unit of an application when a cloud-native network first creates an application;

[0076] A scheduling module 103, which is used to fixedly use the available IP address for the newly created container unit after fixed processing, and schedule the newly created container unit to any idle computing node according to the fixed IP address after fixed processing.

[0077] In one embodiment, the adding module 101 is specifically used for:

[0078] Determine the metadata of the container unit in the application configuration file of the cloud-native network;

[0079] For the metadata of the container unit, identify the requirement for a fixed IP address for the container unit by customizing and adding annotations and / or labels, and the annotations and / or labels meet the format requirements of the cloud-native network.

[0080] In one embodiment, the scheduling unit 103 is specifically used for:

[0081] Bind the available IP address as a fixed IP address to the newly created container unit to form a mapping relationship and store it in the application fixed IP pool;

[0082] Schedule the newly created container unit to any idle computing node according to the fixed IP address in the application fixed IP pool.

[0083] In one embodiment, the scheduling unit is specifically further used for:

[0084] After fixedly using the available IP address for the newly created container unit after fixed processing and scheduling the newly created container unit to any idle computing node according to the fixed IP address after fixed processing, when the newly created container unit is restarted, query the fixed IP address mapped by the container unit by using the mapping relationship, and schedule the container unit to any idle computing node according to the fixed IP address.

[0085] In one embodiment, the device further includes:

[0086] A storage unit, which is used to, after selecting an available IP address from a public IP pool and allocating it to a newly created container unit of an application when a cloud-native network first creates an application, pack the available IP address and the network configuration information of the newly created container unit into a key-value pair and send it to a distributed key-value storage system, so as to record the IP address allocation information of the container unit through the distributed key-value storage system;

[0087] Correspondingly, the allocation unit is further configured to, when the node cluster in the cloud native network triggers the reconstruction of the container unit, allocate the original fixed IP address to the corresponding container unit according to the IP address allocation information recorded in the distributed key-value storage system.

[0088] In one embodiment, the device further includes:

[0089] An expansion module, configured to, after packing the available IP address and the network configuration information of the newly created container unit into a key-value pair and sending it to the distributed key-value storage system, when the application needs to be expanded, select an unused IP address from the public IP pool according to the IP address allocation information recorded in the distributed key-value storage system, and allocate the unused IP address to the container unit created by expansion after fixed processing.

[0090] In one embodiment, the device further includes:

[0091] A release module, configured to, after packing the available IP address and the network configuration information of the newly created container unit into a key-value pair and sending it to the distributed key-value storage system, when the container unit is removed from the computing node, release the IP address fixedly used by the container unit back to the public IP pool, and update the IP address allocation information corresponding to the released IP address in the distributed key-value storage system, so that the released IP address can be reused by other container units.

[0092] The present invention provides an IP address allocation device for container units. By using the available IP address after fixed processing for the container units in the cloud native network, the container units are allocated fixed IP addresses. Through the fixed allocated IP addresses, the container units can be scheduled to any idle node, so that the node resources are fully utilized to better meet the requirements of the large-scale containerized environment and ensure the stability of the business process.

[0093] For the specific limitations on the IP address allocation device for container units, reference can be made to the limitations on the method in the intelligent question and answer section above, which will not be elaborated here. Each module in the above IP address allocation device for container units can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor of the computer device in hardware form or be independent of it, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to the above modules.

[0094] In one embodiment, a computer device is provided. The computer device can be a server, and its internal structure diagram can be as Figure 10As shown in the figure. The computer device includes a processor, a memory, a network interface, and a database connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile and / or volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external client via a network connection. When the computer program is executed by the processor, it implements the functions or steps on the server side of an IP address allocation method for a container unit.

[0095] In one embodiment, a computer device is provided. The computer device can be a client, and its internal structure diagram can be as Figure 11 shown in the figure. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external server via a network connection. When the computer program is executed by the processor, it implements the functions or steps on the client side of an IP address allocation method for a container unit

[0096] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented:

[0097] Add a first fixed identifier to the application configuration file in the cloud-native network. The first fixed identifier is used to allocate a fixed IP address to a container unit, and the IP address is started on a network connection device;

[0098] When the cloud-native network creates an application for the first time, select an available IP address from the public IP pool and allocate it to the newly created container unit of the application;

[0099] After the available IP address is fixed, it is fixedly used by the newly created container unit, and the newly created container unit is scheduled to any idle computing node according to the fixed IP address.

[0100] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:

[0101] Add a first fixed identifier to the application configuration file of the cloud-native network. The first fixed identifier is used to assign a fixed IP address to a container unit, and the IP address is started on a network connection device.

[0102] When the cloud-native network creates an application for the first time, select an available IP address from the public IP pool and assign it to the newly created container unit of the application.

[0103] After the available IP address is fixed, it is fixedly used by the newly created container unit, and the newly created container unit is scheduled to any idle computing node according to the fixed IP address.

[0104] It should be noted that for the functions or steps that can be achieved by the above computer-readable storage medium or computer device, reference can be made to the relevant descriptions on the server side and the client side in the foregoing method embodiments. To avoid repetition, they will not be described one by one here.

[0105] Those of ordinary skill in the art can understand that all or part of the processes of implementing the methods in the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, storage, database, or other medium used in the various embodiments provided in the present application can include non-volatile and / or volatile memories. Non-volatile memories can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memories can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM), etc.

[0106] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the above division of each functional unit and module is used as an example. In actual applications, the above functions can be allocated to different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above.

[0107] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention, and should all be included within the protection scope of the present invention.

Claims

1. A method for allocating IP addresses to a container unit, characterized in that: include: Adding a first fixed identifier in an application configuration file of the cloud native network, where the first fixed identifier is used to assign a fixed IP address to the container unit, where the IP address is started on a network connection device; When the cloud native network creates an application for the first time, an available IP address is selected from the public IP pool and assigned to the newly created container unit of the application; The available IP address is fixedly processed for use by the newly created container unit, and the newly created container unit is dispatched to any idle computing node according to the fixed IP address.

2. The method for allocating IP addresses of container units according to claim 1, characterized in that: Adding the first fixed identifier in the application configuration file of the cloud native network includes: Determine the metadata of the container unit in the application configuration file of the cloud native network; With respect to the metadata of the container unit, annotations and / or labels are added by customization to identify that the container unit requires a fixed IP address, and the annotations and / or labels meet the format requirements of the cloud native network.

3. The method for allocating IP addresses of container units according to claim 1, characterized in that: The fixing the available IP address for fixed use by the newly created container unit after the fixing process, and scheduling the newly created container unit to any idle computing node according to the fixed IP address, includes: Binding the available IP address as a fixed IP address to the newly created container unit to form a mapping relationship and storing it in an application fixed IP pool; The newly created container unit is scheduled to any idle computing node according to the fixed IP address in the application fixed IP pool.

4. The method for allocating IP addresses of container units according to claim 3, characterized in that: After the available IP address is fixedly processed for use by the newly created container unit, and the newly created container unit is scheduled to any idle computing node according to the fixed IP address, the method further includes: When the newly created container unit is reactivated, the mapping relationship is used to query the fixed IP address mapped by the container unit, and the container unit is scheduled to any idle computing node according to the fixed IP address.

5. The method for allocating an IP address of a container unit according to any one of claims 1 to 4, characterized in that: After selecting an available IP address from a public IP pool and allocating it to a newly created container unit of the application when the cloud native network creates the application for the first time, the method further includes: Packing the available IP address and the network configuration information of the newly created container unit into a key-value pair and sending the pair to the distributed key-value storage system, so as to record the IP address allocation information of the container unit through the distributed key-value storage system; Correspondingly, when the node cluster in the cloud native network triggers the reconstruction of the container unit, the original fixed IP address is allocated to the corresponding container unit according to the IP address allocation information recorded in the distributed key-value storage system.

6. The method for allocating IP addresses of container units according to claim 5, characterized in that: After packaging the available IP address and the network configuration information of the newly created container unit to form a key-value pair and sending it to the distributed key-value storage system, the method further includes: When the application needs to be expanded, an unused IP address is selected from the public IP pool according to the IP address allocation information recorded in the distributed key-value storage system, and the unused IP address is allocated to the container unit created for expansion after being fixed.

7. The method for allocating IP addresses of container units according to claim 5, characterized in that: After packaging the available IP address and the network configuration information of the newly created container unit to form a key-value pair and sending it to the distributed key-value storage system, the method further includes: When a container unit is removed from a computing node, the IP address fixedly used by the container unit is released back to the public IP pool, and the IP address allocation information corresponding to the released IP address is updated in the distributed key-value storage system so that the released IP address can be reused by other container units.

8. An IP address allocation device for a container unit, characterized in that: include: An adding module, configured to add a first fixed identifier to an application configuration file of the cloud native network, wherein the first fixed identifier is used to assign a fixed IP address to the container unit, and the IP address is started on a network connection device; An allocation module, which is used to select an available IP address from the public IP pool and allocate it to a newly created container unit of the application when the cloud native network creates an application for the first time; The scheduling module is used to fix the available IP address for use by the newly created container unit after fixed processing, and schedule the newly created container unit to any idle computing node according to the fixed IP address.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method for allocating an IP address for a container unit according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method for allocating an IP address of a container unit according to any one of claims 1 to 7 are implemented.