CN112243044A - Container address allocation method and device - Google Patents

Container address allocation method and device Download PDF

Info

Publication number
CN112243044A
CN112243044A CN201910639313.4A CN201910639313A CN112243044A CN 112243044 A CN112243044 A CN 112243044A CN 201910639313 A CN201910639313 A CN 201910639313A CN 112243044 A CN112243044 A CN 112243044A
Authority
CN
China
Prior art keywords
address
container
available
pool
allocated
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910639313.4A
Other languages
Chinese (zh)
Other versions
CN112243044B (en
Inventor
戴声
王兴刚
王华夏
毛茂德
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Huya Technology Co Ltd
Original Assignee
Guangzhou Huya Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Huya Technology Co Ltd filed Critical Guangzhou Huya Technology Co Ltd
Priority to CN201910639313.4A priority Critical patent/CN112243044B/en
Publication of CN112243044A publication Critical patent/CN112243044A/en
Application granted granted Critical
Publication of CN112243044B publication Critical patent/CN112243044B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5061Pools of addresses
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application provides a container address allocation method and a device, which are applied to data processing equipment, wherein address pools corresponding to container group identifiers of different container groups are stored in the data processing equipment in advance; the method comprises the following steps: receiving a container address allocation request sent by a container, wherein the container address allocation request comprises a container group identifier of a container group in which the container is located; searching a target address pool corresponding to the container group identification; an available address is selected from the pool of target addresses to assign to the container. Therefore, the addresses of the containers in the same container group are from the same address pool, so that the addresses of the same container group are relatively fixed, and the address dependence configuration of the containers and the management and maintenance of the container addresses are facilitated.

Description

Container address allocation method and device
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for allocating container addresses.
Background
The container (container) technology is a technology for packaging and deploying an application program, and a dependency, a class library, a configuration file and other binary files required by the application program, and can enable the application program to smoothly run when a running environment is switched.
After the container is deployed, an IP address needs to be allocated to the container so as to be capable of carrying out communication interaction with other components. In some schemes, a scheme of dynamically allocating an IP address to a container is adopted, but when the container is created, upgraded and reconstructed, an action of applying for an address is executed, and the IP address of the container after each upgrade or reconstruction is changed by adopting a global dynamic IP address allocation mode. Resulting in the need for the more strongly dependent components to the IP address of the container to reconfigure the IP address to interact with the container. In addition, the time for applying addresses for the containers is different, so that IP address areas of the containers of different types are mutually alternated, the management is inconvenient, the use and maintenance complexity of the containers is improved, and the production efficiency is reduced.
Disclosure of Invention
In order to overcome at least one of the deficiencies in the prior art, an object of the present application is to provide a container address allocation method, which is applied to a data processing device, where the data processing device stores address pools corresponding to container group identifiers of different container groups in advance; the method comprises the following steps:
receiving a container address allocation request sent by a container, wherein the container address allocation request comprises a container group identifier of a container group in which the container is located;
searching a target address pool corresponding to the container group identification;
an available address is selected from the pool of target addresses to assign to the container.
Another objective of the present application is to provide a container address allocation apparatus, which is applied to a data processing device, where the data processing device stores address pools corresponding to container group identifiers of different container groups in advance; the device comprises:
the device comprises a request receiving module, a sending module and a receiving module, wherein the request receiving module is used for receiving a container address allocation request sent by a container, and the container address allocation request comprises a container group identifier of a container group where the container is located;
the address pool query module is used for searching a target address pool corresponding to the container group identifier;
and the address allocation module is used for selecting an available address from the target address pool and allocating the address to the container.
It is another object of the present application to provide a machine-readable storage medium having stored thereon machine-executable instructions that, when executed by one or more processors, perform the container address assignment method provided herein.
Compared with the prior art, the method has the following beneficial effects:
the container address allocation method and device provided by the application carry the container group identifier of the container group where the container is located in the container address allocation request sent by the container, and select the available address in the corresponding address pool according to the container group identifier for allocation. Therefore, the addresses of the containers in the same container group are from the same address pool, so that the addresses of the same container group are relatively fixed, and the address dependence configuration of the containers and the management and maintenance of the container addresses are facilitated.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 is a schematic diagram of a data processing apparatus provided in an embodiment of the present application;
fig. 2 is a schematic flowchart of a container address allocation method according to an embodiment of the present disclosure;
fig. 3 is a second schematic flowchart of a container address allocation method according to an embodiment of the present application;
fig. 4 is one of functional block diagrams of a container address allocation apparatus according to an embodiment of the present disclosure;
fig. 5 is a second functional block diagram of a container address allocation apparatus according to an embodiment of the present disclosure.
Icon: 100-a data processing device; 110-container address assignment means; 111-request receiving module; 112-address pool query module; 113-address assignment module; 114-address release module; 115-address deletion module; 116-a capacity configuration module; 117-address pool assignment module; 120-a machine-readable storage medium; 130-a processor.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
Referring to fig. 1, fig. 1 is a schematic diagram of a data processing apparatus 100 according to the present embodiment, where the data processing apparatus includes a container address allocating device 110, a machine-readable storage medium 120, and a processor 130.
The machine-readable storage medium 120 and the processor 130 are electrically connected to each other, directly or indirectly, to enable transmission or interaction of data. For example, the components may be electrically connected to each other via one or more communication buses or signal lines. The container address allocating means 110 includes at least one software function module that can be stored in the form of software or firmware (firmware) in the machine-readable storage medium 120 or solidified in an Operating System (OS) of the data processing apparatus 100. The processor 130 is configured to execute executable modules stored in the machine-readable storage medium 120, such as software functional modules and computer programs included in the container address allocation apparatus 110.
The machine-readable storage medium 120 may be, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Read-Only Memory (EPROM), an electrically Erasable Read-Only Memory (EEPROM), and the like. The machine-readable storage medium 120 is used for storing a program, and the processor 130 executes the program after receiving an execution instruction.
Referring to fig. 2, fig. 2 is a schematic diagram of a container address allocation method provided in this embodiment, and the following explains each step of the method in detail.
Step S110, receiving a container address allocation request sent by a container, where the container address allocation request includes a container group identifier corresponding to a container group in which the container is located.
In this embodiment, when creating a container, a container group identifier of a container group in which the container is located may be added to the container parameter, and the container group may be a collection of containers having similar functions or implementing a certain function together. The container group identifier may be an identifier capable of representing a unique identity of the container group in the entire operating environment, and the container group identifier may be a combination of a plurality of letters and numbers.
In this embodiment, the data processing device 100 may be configured with an address pool service program for performing address pool management, and the address pool service program may provide an address application interface for applying for a container address. The action of sending the container address allocation request when the container is created may be calling the address application interface, and transferring the container group identifier of the container, thereby requesting the address pool service program to obtain the container address.
Taking the kubernets container cluster management system as an example, the container group identifier may be configured in the Annotation information of the Pod unit, and when the container in the Pod unit is created, the container group identifier in the Annotation information is obtained and is transmitted to the address pool service program through the address application interface.
Step S120, searching a target address pool corresponding to the container group identification.
In this embodiment, the data processing apparatus 100 may store address pools corresponding to different container group identifiers in advance. In step S120, the address pool service program searches an address pool corresponding to the container group identifier in the container address allocation request as the target address pool.
Step S130, selecting an available address from the target address pool to allocate to the container.
In this embodiment, the addresses in the address pool may have different identifications according to different allocation states of the addresses. For example, when an address is a free address, the address may be identified as an available address. An address may be identified as a pre-emptive address when the address is applied for by the container but has not yet been formally used by the container. But an address is applied by the container and when it has been formally used by the container, the address may be identified as an assigned address.
After inquiring the target address pool, the address pool service program can select an address identified as an available address from the target address pool to be allocated to the container sending the container address allocation request.
Based on the above design, in the scheme provided in this embodiment, addresses may be allocated to containers in corresponding address pools according to container group identifiers in a container address allocation request, and thus, addresses allocated to containers of the same container group all come from the same address pool, so that addresses of the same container group are relatively fixed, which facilitates address dependency configuration of containers and management and maintenance of container addresses.
Optionally, in step S110 in this embodiment, the container address allocation request may further include a Unique Identifier of the container, where the Unique Identifier may be an Identifier capable of identifying a Unique identity of the container in a container group or in the entire deployment environment of the container, for example, a Universal Unique Identifier (UUID) of the container.
In an example, referring to fig. 3, before step S130, the method for allocating a container address provided in this embodiment may further include step S210.
Step S210, querying whether an allocated address corresponding to the unique identifier exists in the target address pool.
In this embodiment, the address pool may further record a corresponding relationship between the allocated address and a unique identifier of the container that obtains the allocated address. After determining the target address pool, the address pool service program may query whether an allocated address corresponding to the unique identifier exists in the target address pool, that is, whether an address has been allocated to the container.
If the allocated address corresponding to the unique identifier is found, step S220 is executed.
If the assigned address corresponding to the unique identifier is not found, step S130 is executed, and step S140 is executed after step S130 is executed.
Step S220, assigning the inquired assigned address to the container.
In this embodiment, if the allocated address corresponding to the unique identifier is found in step S210, which indicates that the container was allocated with the address, the container may be requested for address again due to upgrade or rebuild, and the same address that was used is required to be allocated to the container, then the address pool service program allocates the found allocated address to the container.
If the allocated address corresponding to the unique identifier is not found in step S210, indicating that no address has been allocated to the container, and the container may be a newly created container for which a new address needs to be allocated, the address pool service program executes step S130 to select an available address from the target address pool to allocate to the container.
And after step S130, step S140 is executed to identify the available address as an allocated address, and record the correspondence between the allocated address and the unique identifier of the container. In this way, if the container is later repurposed for an address for reasons such as an upgrade or rebuild, the container may be assigned a used address based on the unique identifier of the container.
In another example, before step S120, the address pool service program may also directly search for whether there is an allocated address corresponding to the unique identifier in all allocated addresses according to the unique identifier in the container address allocation request.
Optionally, in this embodiment, when a container is deleted, a container address release request may be sent to the address pool service program, where the container address release request includes an allocated address allocated to the container.
For example, the address pool service program may further provide an address release interface, and when the container is deleted, the address release interface may be called to transfer the address of the container, so as to inform the address pool service program to release the address allocated for the container.
After receiving the container address release request, the address pool service program may identify the allocated address as an available address, and record the release time of the available address.
In step S130, when the address pool service program selects an available address from the target address pool to allocate to a container, the address pool service program selects an available address with the latest release time from the available addresses in the target address pool to allocate to the container.
In other words, in the present embodiment, the available addresses released later are allocated to other containers for use earlier, depending on the release time of each available address. Therefore, addresses which frequently change in the address pool and correspond to the containers are kept in a certain range, and management and maintenance of the container addresses are facilitated.
Optionally, in this embodiment, an available address is allocated to the address pool, and the release time of the allocated available address is configured to be 0. For example, when creating the address pool or when the address pool is expanded, the release time of the available address allocated for the address pool is configured to be 0 first. Since the addresses of the new release time 0 are always allocated the container at the latest, these addresses newly allocated to the address pool are assigned the lowest priority to the container.
Optionally, in this embodiment, the address pool service program may periodically detect a release time of each available address in the address pool, and calculate an unused time length of each available address.
And if the available address with the unused time reaching the first preset time threshold is detected, indicating that the total number of the addresses of the address pool is greater than the number of the addresses required by the container group corresponding to the address pool, deleting the available address from the address pool by the address pool service program.
Optionally, in this embodiment, the data processing apparatus 100 further records an application time of an address in each address pool, that is, a time when an available address is allocated to an address pool.
The address pool service program may detect an unallocated duration of an available address having a release timestamp of 0 according to the application time.
And if the available address with the unallocated time reaching the second preset time threshold is detected, indicating that the total number of the addresses of the address pool is greater than the number of the addresses required by the container group corresponding to the address pool, deleting the available address from the address pool by the address pool service program.
Optionally, in this embodiment, the address pool service program may receive an address pool capacity configuration instruction, and record a target address capacity of the address pool configuration carried in the address pool configuration instruction. For example, the address pool service program may also provide an address capacity configuration interface, which may be invoked to configure the target address capacity of each address pool.
The address pool service routine may periodically detect a release time for each available address in the address pool and calculate an unused time duration for each available address. And if the available address with the unused time reaching the first preset time threshold is detected, and the total number of the addresses in the address pool is larger than the target address capacity of the address pool, indicating that the address pool needs capacity reduction, deleting the available address from the address pool by the address pool service program.
Alternatively, the address pool service program may periodically detect the unallocated time length of the available address having the release timestamp of 0 according to the application time. And if the total number of the addresses in the address pool is larger than the target address capacity of the address pool and the total number of the addresses in the address pool is larger than the target address capacity of the address pool, deleting the available addresses from the address pool.
Therefore, the addresses which are unused for a long time in the address pool can be cleaned, so that the long-term occupancy rate of the invalid addresses in the pool is reduced, and the overall availability of the addresses is improved.
Optionally, in this embodiment, when allocating an address for a container, the address pool service program may sort, from front to back, addresses in the target address pool according to an order of the allocated address, the pre-occupied address, the available address with the later release time, and the available address with the earlier release time, and then check whether an available address exists in the top-ranked addresses within the current target address capacity range of the target address pool.
If so, the available address with the highest ranking is selected to be allocated to the container.
If the addresses in the current target address capacity range of the target address pool do not exist, namely the addresses in the current target address capacity range of the target address pool are all allocated addresses or pre-occupied addresses, the capacity of the target address pool is full, and the addresses cannot be allocated continuously, a notification that no available addresses exist is returned to the container.
Optionally, in this embodiment, the address pool service program may further provide a management interface for performing addition, query, and the like on the address pool, and the management interface configures the address pool managed by the address pool service program.
Referring to fig. 4, the present embodiment further provides a container address allocation apparatus 110 applied to the data processing device 100 shown in fig. 1, where the data processing device 100 stores address pools corresponding to container group identifiers of different container groups in advance; the container address allocation apparatus 110 may include a request receiving module 111, an address pool querying module 112, and an address allocation module 113.
The request receiving module 111 is configured to receive a container address allocation request sent by a container, where the container address allocation request includes a container group identifier of a container group in which the container is located.
In this embodiment, the request receiving module 111 may be configured to execute step S110 shown in fig. 1, and reference may be made to the description of step S110 for a detailed description of the request receiving module 111.
And an address pool query module 112, configured to find a target address pool corresponding to the container group identifier.
In this embodiment, the address pool query module 112 may be configured to execute step S120 shown in fig. 1, and the detailed description about the address pool query module 112 may refer to the description about step S120.
An address assignment module 113, configured to select an available address from the target address pool to assign to the container.
In this embodiment, the address assignment module 113 may be configured to execute step S130 shown in fig. 1, and the detailed description about the address assignment module 113 may refer to the description about step S130.
Optionally, in this embodiment, the container address allocation request further includes a unique identifier of the container.
The address assignment module 113 is specifically configured to: inquiring whether an allocated address corresponding to the unique identifier exists in the target address pool or not; if the allocated address corresponding to the unique identifier is inquired, the inquired allocated address is allocated to the container; if the allocated address corresponding to the unique identifier is not inquired, selecting an available address from the target address pool to allocate to the container, identifying the available address as an allocated address, and recording the corresponding relation between the allocated address and the unique identifier of the container.
Optionally, in this embodiment, the request receiving module is further configured to receive a container address release request sent by a container, where the container address release request includes an allocated address allocated to the container.
Referring to fig. 5, the data processing apparatus 100 may further include an address release module 114.
The address release module 114 is configured to identify the allocated address as an available address, and record a release time of the available address.
The address allocation module 113 is specifically configured to select an available address with the latest release time from the available addresses in the target address pool, and allocate the available address to the container.
Optionally, in an example, the data processing apparatus 100 may further include an address deletion module 115.
The address deleting module 115 is configured to detect a release time of each available address in the address pool, and calculate an unused duration of each available address; and if the available address with the unused time length reaching the first preset time length threshold value is detected, deleting the available address from the address pool.
Optionally, in another example, the data processing apparatus 100 may further include a capacity configuration module 116 and an address deletion module 115.
The capacity configuration module 116 is configured to receive an address pool capacity configuration instruction, and record a target address capacity of the address pool configuration carried in the address pool configuration instruction.
The address deleting module 115 is configured to detect a release time of each available address in the address pool, and calculate an unused duration of each available address; and if the available address with the unused time reaching the first preset time threshold is detected, and the total number of the addresses in the address pool is greater than the target address capacity of the address pool, deleting the available address from the address pool.
Optionally, in this embodiment, the data processing apparatus 100 may further include an address pool assignment module 117.
The address pool allocation module 117 is configured to allocate an available address to the address pool, and configure the release time of the allocated available address as 0.
Optionally, in an example, the data processing apparatus 100 further records application time of addresses in each address pool. The data processing device 100 may also include an address deletion module 115.
The address deletion module 115 is configured to detect an unallocated duration of an available address with a release timestamp of 0 according to the application time; and if the available address with the unallocated time reaching the second preset time threshold is detected, deleting the available address from the address pool.
Optionally, in another example, the data processing apparatus 100 further records application time of addresses in each address pool. The data processing device 100 may further include a capacity configuration module 116 and an address deletion module 115.
The capacity configuration module 116 is configured to receive an address pool capacity configuration instruction, and record a target address capacity of the address pool configuration carried in the address pool configuration instruction.
The address deleting module 115 is configured to periodically detect an unallocated duration of an available address with a release timestamp of 0 according to the application time; and if the total number of the addresses in the address pool is larger than the target address capacity of the address pool and the total number of the addresses in the address pool is larger than the target address capacity of the address pool, deleting the available addresses from the address pool.
To sum up, the container address allocation method and apparatus provided in the present application carry the container group identifier of the container group in which the container is located in the container address allocation request sent by the container, and select an available address in the corresponding address pool according to the container group identifier for allocation. Therefore, the addresses of the containers in the same container group are from the same address pool, so that the addresses of the same container group are relatively fixed, and the address dependence configuration of the containers and the management and maintenance of the container addresses are facilitated.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The above description is only for various embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of changes or substitutions within the technical scope of the present application, and all such changes or substitutions are included in the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (15)

1. A container address allocation method is characterized in that the method is applied to data processing equipment, and address pools corresponding to container group identifications of different container groups are stored in the data processing equipment in advance; the method comprises the following steps:
receiving a container address allocation request sent by a container, wherein the container address allocation request comprises a container group identifier of a container group in which the container is located;
searching a target address pool corresponding to the container group identification;
an available address is selected from the pool of target addresses to assign to the container.
2. The method of claim 1, wherein the container address assignment request further comprises a unique identification of the container; before selecting an available address from the pool of target addresses to assign to the container, the method further comprises:
inquiring whether an allocated address corresponding to the unique identifier exists in the target address pool or not;
if the allocated address corresponding to the unique identifier is inquired, the inquired allocated address is allocated to the container;
if the allocated address corresponding to the unique identifier is not inquired, selecting an available address from the target address pool to allocate to the container, identifying the available address as an allocated address, and recording the corresponding relation between the allocated address and the unique identifier of the container.
3. The method of claim 1, further comprising:
receiving a container address release request sent by a container, wherein the container address release request comprises an allocated address allocated to the container;
identifying the allocated address as an available address, and recording the release time of the available address;
the step of selecting an available address from the target address pool to allocate to the container comprises:
and selecting the available address with the latest release time from the available addresses in the target address pool to be allocated to the container.
4. The method of claim 3, further comprising:
detecting the release time of each available address in the address pool, and calculating the unused time length of each available address;
and if the available address with the unused time length reaching the first preset time length threshold value is detected, deleting the available address from the address pool.
5. The method of claim 3, further comprising:
receiving an address pool capacity configuration instruction, and recording the target address capacity of the address pool configuration carried in the address pool configuration instruction;
detecting the release time of each available address in the address pool, and calculating the unused time length of each available address;
and if the available address with the unused time reaching the first preset time threshold is detected, and the total number of the addresses in the address pool is greater than the target address capacity of the address pool, deleting the available address from the address pool.
6. The method of claim 3, further comprising:
an available address is allocated to the address pool, and a release time of the allocated available address is configured to be 0.
7. The method according to claim 6, wherein the data processing device further records application time of addresses in each address pool; the method further comprises the following steps:
detecting the unallocated duration of the available address with the release timestamp of 0 according to the application time;
and if the available address with the unallocated time reaching the second preset time threshold is detected, deleting the available address from the address pool.
8. The method according to claim 6, wherein the data processing device further records application time of addresses in each address pool; the method further comprises the following steps:
receiving an address pool capacity configuration instruction, and recording the target address capacity of the address pool configuration carried in the address pool configuration instruction;
according to the application time, periodically detecting the unallocated duration of the available address with the release timestamp of 0;
and if the total number of the addresses in the address pool is larger than the target address capacity of the address pool and the total number of the addresses in the address pool is larger than the target address capacity of the address pool, deleting the available addresses from the address pool.
9. The container address allocation device is applied to data processing equipment, and address pools corresponding to container group identifications of different container groups are stored in the data processing equipment in advance; the device comprises:
the device comprises a request receiving module, a sending module and a receiving module, wherein the request receiving module is used for receiving a container address allocation request sent by a container, and the container address allocation request comprises a container group identifier of a container group where the container is located;
the address pool query module is used for searching a target address pool corresponding to the container group identifier;
and the address allocation module is used for selecting an available address from the target address pool and allocating the address to the container.
10. The apparatus of claim 9, wherein the container address assignment request further comprises a unique identification of the container;
the address allocation module is specifically configured to: inquiring whether an allocated address corresponding to the unique identifier exists in the target address pool or not; if the allocated address corresponding to the unique identifier is inquired, the inquired allocated address is allocated to the container; if the allocated address corresponding to the unique identifier is not inquired, selecting an available address from the target address pool to allocate to the container, identifying the available address as an allocated address, and recording the corresponding relation between the allocated address and the unique identifier of the container.
11. The apparatus of claim 9,
the request receiving module is further configured to receive a container address release request sent by a container, where the container address release request includes an allocated address allocated to the container;
the device further comprises:
the address release module is used for identifying the allocated address as an available address and recording the release time of the available address;
the address allocation module is specifically configured to select an available address with the latest release time from the available addresses in the target address pool, and allocate the available address to the container.
12. The apparatus of claim 11, further comprising:
the address deleting module is used for detecting the release time of each available address in the address pool and calculating the unused time length of each available address; and if the available address with the unused time length reaching the first preset time length threshold value is detected, deleting the available address from the address pool.
13. The apparatus of claim 12, further comprising:
and the address pool allocation module is used for allocating the available addresses to the address pool and configuring the release time of the allocated available addresses as 0.
14. The apparatus according to claim 11, wherein the data processing device further records an application time of an address in each address pool; the device further comprises:
the address deleting module detects the unallocated duration of the available address with the release timestamp of 0 according to the application time; and if the available address with the unallocated time reaching the second preset time threshold is detected, deleting the available address from the address pool.
15. A machine-readable storage medium having stored thereon machine-executable instructions which, when executed by one or more processors, perform the method of any one of claims 1-8.
CN201910639313.4A 2019-07-16 2019-07-16 Container address allocation method and device Active CN112243044B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910639313.4A CN112243044B (en) 2019-07-16 2019-07-16 Container address allocation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910639313.4A CN112243044B (en) 2019-07-16 2019-07-16 Container address allocation method and device

Publications (2)

Publication Number Publication Date
CN112243044A true CN112243044A (en) 2021-01-19
CN112243044B CN112243044B (en) 2023-05-19

Family

ID=74166514

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910639313.4A Active CN112243044B (en) 2019-07-16 2019-07-16 Container address allocation method and device

Country Status (1)

Country Link
CN (1) CN112243044B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113626054A (en) * 2021-08-16 2021-11-09 聚好看科技股份有限公司 Business service updating method and device
CN113766043A (en) * 2021-05-11 2021-12-07 腾讯科技(深圳)有限公司 Method and device for configuring target container, computer equipment and storage medium
CN114070822A (en) * 2021-11-17 2022-02-18 苏州博纳讯动软件有限公司 Kubernetes Overlay IP address management method
CN114500464A (en) * 2021-12-13 2022-05-13 天翼物联科技有限公司 Container static IP distribution method, system, device and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060126629A1 (en) * 2004-12-13 2006-06-15 International Network Services, Inc. Internet protocol address management system and method
CN102238239A (en) * 2010-04-21 2011-11-09 电信科学技术研究院 IP address allocation method and device
CN107566541A (en) * 2017-08-03 2018-01-09 携程旅游信息技术(上海)有限公司 Capacitor network resource allocation methods, system, storage medium and electronic equipment
CN107580083A (en) * 2017-09-20 2018-01-12 北京京东尚科信息技术有限公司 A kind of method and system of container IP address distribution
CN108833163A (en) * 2018-06-13 2018-11-16 平安科技(深圳)有限公司 Creation method, device, computer equipment and the storage medium of Linux virtual server

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060126629A1 (en) * 2004-12-13 2006-06-15 International Network Services, Inc. Internet protocol address management system and method
CN102238239A (en) * 2010-04-21 2011-11-09 电信科学技术研究院 IP address allocation method and device
CN107566541A (en) * 2017-08-03 2018-01-09 携程旅游信息技术(上海)有限公司 Capacitor network resource allocation methods, system, storage medium and electronic equipment
CN107580083A (en) * 2017-09-20 2018-01-12 北京京东尚科信息技术有限公司 A kind of method and system of container IP address distribution
CN108833163A (en) * 2018-06-13 2018-11-16 平安科技(深圳)有限公司 Creation method, device, computer equipment and the storage medium of Linux virtual server

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113766043A (en) * 2021-05-11 2021-12-07 腾讯科技(深圳)有限公司 Method and device for configuring target container, computer equipment and storage medium
CN113766043B (en) * 2021-05-11 2024-02-23 腾讯科技(深圳)有限公司 Method, device, computer equipment and storage medium for configuring target container
CN113626054A (en) * 2021-08-16 2021-11-09 聚好看科技股份有限公司 Business service updating method and device
CN114070822A (en) * 2021-11-17 2022-02-18 苏州博纳讯动软件有限公司 Kubernetes Overlay IP address management method
CN114070822B (en) * 2021-11-17 2022-10-14 江苏博云科技股份有限公司 Kubernetes Overlay IP address management method
CN114500464A (en) * 2021-12-13 2022-05-13 天翼物联科技有限公司 Container static IP distribution method, system, device and storage medium
CN114500464B (en) * 2021-12-13 2023-12-12 天翼物联科技有限公司 Container static IP distribution method, system, device and storage medium

Also Published As

Publication number Publication date
CN112243044B (en) 2023-05-19

Similar Documents

Publication Publication Date Title
CN112243044A (en) Container address allocation method and device
CN107229555B (en) Identification generation method and device
JP7374100B2 (en) Resource reservation method, resource reservation device, resource reservation device, and resource reservation system
CN108683516B (en) Application instance upgrading method, device and system
CN105335187B (en) Application processing method and device
CN107590033B (en) Method, device and system for creating DOCKER container
CN107656695B (en) Data storage and deletion method and device and distributed storage system
EP4013000A1 (en) Cloud service processing method and device, cloud server, cloud service system and storage medium
CN113037794B (en) Method, device and system for computing resource allocation scheduling
KR102100323B1 (en) Method and server for the service of machine learning platform
CN107844274B (en) Hardware resource management method, device and terminal based on super-fusion storage system
CN108616424B (en) Resource scheduling method, computer equipment and system
CN111290838B (en) Application access request processing method and device based on container cluster
CN106383668B (en) Information storage method, storage management equipment and client
CN103139255A (en) Method for allocating resource identification and identification section
US20180188990A1 (en) Method, apparatus and system for inserting disk
CN114745358A (en) IP address management method, system and controller in load balancing service
CN110457114B (en) Application cluster deployment method and device
CN107623705B (en) Storage mode upgrading method, device and system based on video cloud storage system
CN110798358B (en) Distributed service identification method and device, computer readable medium and electronic equipment
CN109005071B (en) Decision deployment method and scheduling equipment
CN104618414A (en) Implementation method of distributed service, service agent device and distributed system
CN116366606A (en) IP address allocation method and device, electronic equipment and storage medium
US20170149893A1 (en) Metadata server, network device and automatic resource management method
CN113157497B (en) Data storage method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant