CN107580083B - Method and system for allocating IP addresses of containers - Google Patents

Method and system for allocating IP addresses of containers Download PDF

Info

Publication number
CN107580083B
CN107580083B CN201710854707.2A CN201710854707A CN107580083B CN 107580083 B CN107580083 B CN 107580083B CN 201710854707 A CN201710854707 A CN 201710854707A CN 107580083 B CN107580083 B CN 107580083B
Authority
CN
China
Prior art keywords
address
container
addresses
allocated
pool
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.)
Active
Application number
CN201710854707.2A
Other languages
Chinese (zh)
Other versions
CN107580083A (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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information 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 Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201710854707.2A priority Critical patent/CN107580083B/en
Publication of CN107580083A publication Critical patent/CN107580083A/en
Application granted granted Critical
Publication of CN107580083B publication Critical patent/CN107580083B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a method and a system for allocating IP addresses of containers, and relates to the technical field of computers. One embodiment of the method comprises: establishing a one-to-one corresponding binding relationship between part of IP addresses in the total address pool and corresponding containers according to a first allocation requirement; under the condition of receiving a request for allocating an IP address, judging whether a container of the IP address to be allocated has a binding relationship with the IP address; if so, allocating the IP address bound to the container of the IP address to be allocated to the container; otherwise, allocating the unbound IP addresses in the total address pool to the containers of the IP addresses to be allocated. The implementation method can realize the binding of the IP address and the container, further ensure that the IP address is not changed when the container is restarted or migrated, and ensure that the service is not interrupted.

Description

Method and system for allocating IP addresses of containers
Technical Field
The invention relates to the technical field of computers, in particular to a method and a system for allocating IP addresses of containers.
Background
A container is a series of processes isolated from the rest of the system, running from a template image, and all the files needed to support the process are provided by the image. The Docker is an open-source application container engine, so that developers can package their applications and dependency packages into a portable container, and then distribute the container to any running Linux machine, and virtualization can also be realized. The containers are fully sandboxed without any interface between each other. Nowadays, Docker is also more and more widely applied, and no matter whether the Docker is supported by integrating code activity on github or Redhat in RHEL6.5, even though Google's ompute Engine also supports Docker to run on top of it. Kubernetes is a Google open-source container cluster management system, is an important member in a Docker ecosphere, provides functions of application deployment, maintenance, extension mechanism and the like, and can conveniently manage cross-machine operation containerized application by utilizing the Kubernetes. How Kubernetes flexibly configures the IP address of a container is undoubtedly an important issue for building a network.
Currently, methods such as Flannel, Calico-cni, etc. are used for network management by Kubernetes. The Flannel is matched with the Docker to enable all nodes in the cluster to re-plan the use rule of the IP addresses, so that containers on different nodes can obtain the IP addresses which belong to the same intranet and are not repeated, and the containers on different nodes can directly communicate through the intranet IP. However, in designing a network, the etcd server needs to be configured if the container IP range on each physical machine or on some physical machines needs to be specified. Furthermore, the Flannel packs the TCP data packet in another network packet for routing forwarding and communication, and the default mode of data communication between nodes is UDP forwarding. This results in a loss of network performance and is complicated when analyzing network failures.
Calico-CNI is a CNI or network plug-in mode that requires the use of a combination of two executables and configuration files, the Calico and Calico-ipam. Directly integrated with kubel, runs at each node to discover the created container, randomly assigns a subnet from the configured address field to the physical node, and assigns an address from the subnet to the container. In this approach, containers on the same physical machine share the same subnet, and containers on different physical machines cannot share the same subnet.
The above methods cannot realize the binding of the container and the IP address, and when the container is restarted on the same physical machine or is migrated to another physical machine, the IP address changes. This will not work properly for services listening to fixed IP addresses.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and a system for allocating a container IP address, which can allocate IP addresses to all nodes through a configured total address pool, and can bind a part of IP addresses in the total address pool with a container according to requirements, so as to ensure that an IP address is unchanged when the container is restarted or migrated, and ensure that a service is not interrupted.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a method of container IP address allocation.
The method for allocating the IP address of the container comprises the following steps: establishing a one-to-one corresponding binding relationship between part of IP addresses in the total address pool and corresponding containers according to a first allocation requirement; under the condition of receiving a request for allocating an IP address, judging whether a container of the IP address to be allocated has a binding relationship with the IP address; if so, allocating the IP address bound to the container of the IP address to be allocated to the container; otherwise, the unbound IP addresses in the total address pool are allocated to the containers to which the IP addresses are to be allocated.
Optionally, the step of establishing a one-to-one correspondence binding relationship between part of the IP addresses in the total address pool and the corresponding containers according to the first allocation requirement includes: reading a part of IP addresses from the total address pool according to a first distribution requirement, and determining a binding label of a container to be bound with the IP addresses according to the first distribution requirement; establishing a one-to-one corresponding relation between the binding tag and the read IP address; recording the corresponding relation in a static allocation list; the step of judging whether the container to which the IP address is to be allocated has a binding relationship with the IP address comprises the following steps: judging whether a container to which an IP address is to be allocated has a binding tag; the step of allocating the IP address bound to the container of the IP address to be allocated to the container comprises the following steps: acquiring a binding label of a container to be allocated with an IP address; searching out a corresponding IP address in the static allocation list according to the binding label; and allocating the IP address to the container to be allocated with the IP address.
Optionally, before the step of establishing a one-to-one corresponding binding relationship between a part of IP addresses in the total address pool and corresponding containers according to the first allocation requirement, the method further includes: configuring a total address pool according to the number of the predetermined IP addresses; the pool of total addresses is then stored in the database of the etcd.
Optionally, before the step of establishing a one-to-one corresponding binding relationship between a part of IP addresses in the total address pool and corresponding containers according to the first allocation requirement, the method further includes: configuring a designated address pool for a designated physical machine through a configuration file according to a second allocation requirement, wherein all IP addresses in the designated address pool are contained in the total address pool;
the step of allocating the unbound IP addresses in the total address pool to the container to which the IP address is to be allocated comprises: judging whether a physical machine where the container of the IP address to be allocated is located is configured with a designated address pool or not; if not, allocating the unbound IP addresses in the total address pool to the containers of the IP addresses to be allocated; otherwise, allocating the unbound IP addresses in the designated address pool to the containers of the IP addresses to be allocated.
Optionally, the step of allocating the unbound IP addresses in the total address pool to the container to which the IP addresses are to be allocated further includes: judging whether the designated address pool and the designated address pools of other physical machines have intersection or not; if the intersection exists, outputting error information; otherwise, allocating the IP address in the unallocated list in the designated address pool to the container of the IP address to be allocated, removing the IP address from the unallocated list, and recording the IP address in the allocated list corresponding to the container from which the IP address is obtained.
Optionally, the step of allocating the IP address bound to the container to which the IP address is to be allocated to the container includes: determining an IP address positioned at the first position according to the sequence of the currently bound IP addresses, and then allocating the IP address to the container; the step of allocating the unbound IP addresses in the total address pool to the container to which the IP address is to be allocated comprises: the IP address located at the first bit is determined according to the order of unbound IP addresses in the total address pool, and then assigned to the container.
Optionally, after the IP address is assigned to the container, the method further includes: and according to the allocated IP address, creating a pair of path-pair for the container acquiring the IP address.
The system for allocating the IP address of the container comprises the following steps: the configuration module is used for establishing a one-to-one corresponding binding relationship between part of IP addresses in the total address pool and corresponding containers according to the first distribution requirement; the judging module is used for judging whether a container of the IP address to be allocated has a binding relationship with the IP address or not under the condition of receiving the request of allocating the IP address; the static allocation module is used for allocating the IP address bound to the container of the IP address to be allocated to the container after the judgment module judges that the container of the IP address to be allocated has the binding relationship with the IP address; and the dynamic allocation module is used for allocating the unbound IP addresses in the total address pool to the containers of the IP addresses to be allocated after the judgment module judges that the containers of the IP addresses to be allocated have no binding relationship with the IP addresses.
Optionally, the configuration module is further configured to read a part of IP addresses from the total address pool according to the first allocation requirement, and determine a binding tag of a container to which the IP address is to be bound according to the first allocation requirement; establishing a one-to-one corresponding relation between the binding tag and the read IP address; recording the corresponding relation in a static allocation list; the judging module is also used for judging whether the container to be allocated with the IP address has the binding label.
Optionally, the static allocation module comprises: the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring a binding label of a container to be allocated with an IP address; the searching unit is used for searching out a corresponding IP address in the static allocation list according to the binding label; and the allocation unit is used for allocating the IP address to the container of the IP address to be allocated.
Optionally, the configuration module is further configured to, before the step of establishing a one-to-one corresponding binding relationship between a part of the IP addresses in the total address pool and the corresponding containers according to the first allocation requirement, configure the total address pool according to a predetermined number of the IP addresses; the pool of total addresses is then stored in the database of the etcd.
Optionally, before the step of establishing a one-to-one binding relationship between a part of IP addresses in a total address pool and corresponding containers according to the first allocation requirement, configuring, according to a second allocation requirement, a designated address pool for a designated physical machine through a configuration file, where all IP addresses in the designated address pool are included in the total address pool; and
the dynamic allocation model is also used for judging whether a physical machine where the container of the IP address to be allocated is located is configured with an appointed address pool or not; if not, allocating the IP address which is not bound in the total address pool to the container of the IP address to be allocated; otherwise, allocating the unbound IP addresses in the designated address pool to the containers of the IP addresses to be allocated.
Optionally, the dynamic allocation module is further configured to determine whether the specified address pool and the specified address pools of other physical machines have an intersection; if the intersection exists, outputting error information; if not, allocating the IP address in the unallocated list in the designated address pool to the container of the IP address to be allocated, removing the IP address from the unallocated list, and recording the IP address in the allocated list corresponding to the container for acquiring the IP address.
Optionally, the static allocation module is further configured to determine, according to the order of the currently bound IP addresses, an IP address located at the first bit, and then allocate the IP address to the container;
the dynamic allocation module is further used for determining the IP address at the first bit according to the sequence of the unbound IP addresses in the total address pool and then allocating the IP address to the container.
Optionally, the method further comprises: and the creating module is used for creating a pair of veth-pair for the container which acquires the IP address according to the allocated IP address after the IP address is allocated to the container.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided an apparatus for allocating an IP address of a container.
The device for allocating the IP address of the container comprises the following components: one or more processors; a storage device, configured to store one or more programs, which when executed by the one or more processors, cause the one or more processors to implement the method for allocating a container IP address.
To achieve the above object, according to one aspect of the embodiments of the present invention, there is provided a computer readable medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the above method of container IP address assignment.
One embodiment of the above invention has the following advantages or benefits: after configuring a total address pool, establishing a one-to-one corresponding binding relationship between part of IP addresses in the total address pool and corresponding containers according to a first allocation requirement, so that allocation is performed according to the binding relationship when the IP addresses are allocated. After receiving the request of allocating the IP address, and judging that the container of the IP address to be allocated is bound with the IP address, performing static allocation, and allocating the bound IP address to the container. Furthermore, when the container is restarted on the same physical machine or is transferred to another physical machine, the IP address is not changed, and the service is ensured not to be interrupted. The problem that the container and the IP address cannot be bound when the IP address is allocated to the container in the prior art is solved. In addition, the total address pool configured by the invention can be used for all containers in the cluster, and in the process of allocating the IP address, the IP address in the total address pool can be directly acquired and allocated to the container, so that not only is any IP address ensured to be used in all nodes, but also the flexibility of the cluster is improved, and meanwhile, the method for allocating the IP address of the container is simplified.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with specific embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
fig. 1 is a schematic diagram of a main flow of a method of container IP address assignment according to an embodiment of the present invention;
FIG. 2 is a schematic illustration of dynamic allocation according to an embodiment of the present invention;
FIG. 3 is a schematic illustration of static allocation according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of the major modules of a system for container IP address assignment, according to an embodiment of the present invention;
FIG. 5 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 6 is a schematic block diagram of a computer system suitable for use with a terminal device or server implementing an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Technical terms involved in the embodiments of the present invention are explained as follows:
kubernetes: kubernetes is a Google open-source container cluster management system, provides functions of application deployment, maintenance, extension mechanism and the like, and can conveniently manage cross-machine operation containerization application by utilizing the Kubernetes;
kubelet: in the Kubernetes cluster, a Kubelet service is started on each Node (also called Minion). The process is used for processing tasks issued to the Master node and managing Pod and containers in Pod. Each Kubelet process registers the information of the node on an API Server, reports the use condition of the node resource to the Master node periodically, and monitors the container and the node resource through the cAdvise;
docker: docker is an open source application container engine, which allows developers to package their applications and dependencies into a portable container and then distribute them to any running Linux machine, and also to implement virtualization. The container completely uses a sandbox mechanism, and no interface exists between the containers;
flannel: flannel is a network planning service designed by the CoreOS team for kubernets; briefly, the method has the functions that Docker containers created by different node hosts in a cluster have unique virtual IP addresses of the whole cluster, and the Docker containers can be interconnected;
CNI: CNI (container network interface) is a specification of an operation container network, including specification of a method, specification of parameters, and the like. CNI is only concerned with the network connection of containers, allocates network resources when a container is created, and deletes allocated resources when a container is deleted. For this reason, CNI is widely supported and specification is easy to implement. The CNI interface only needs to realize two methods, one is called when a container is created, and the other is called when the container is deleted;
pod: a Pod corresponds to a group of containers consisting of several containers, the containers within the same group sharing a network namespace and IP addresses. Pod is a "logical host" model that is built in a containerized environment and is application-oriented, and may contain one or more containers that are closely related to each other. The Pod is responsible for creating a new Pod to replace the old by the replication controller;
label: a label is a key/value pair from attach to Pod that conveys user-defined attributes. For example, you may create a "static IP" label that marks the IP name used by the Pod by label (static IP is domain1 ServerIP);
overlay: the Overlay is a virtual network on the traditional network, and the traditional network does not need any adaptation, so that the physical layer network only corresponds to the calculation of the physical layer (a physical machine and a virtualization layer management network). The Overlay carries out network construction and expansion on the network equipment at the edge through a control protocol, and specific implementation technologies comprise EVI, TRILL, VPLS, LISP, VXLAN and the like;
etcd: the etcd is a key/value storage service applied in a distributed environment. By using the characteristics of the etcd, the application programs can share information, configure or perform service discovery in the cluster, and the etcd can copy the data in each node of the cluster and ensure that the data is always correct. etcd is an indispensable ring in both CoreOS and kubernets systems;
virtual Ethernet Pair, which is called a Virtual network card Pair, a Virtual link exists between the two. All packets coming in from one end of the pair of ports will come out from the other end and vice versa.
Fig. 1 is a schematic diagram of a main flow of a method of container IP address assignment according to an embodiment of the present invention.
As shown in fig. 1, the method for allocating IP addresses to containers according to the embodiment of the present invention mainly includes:
s101: and establishing a one-to-one corresponding binding relationship between part of IP addresses in the total address pool and the corresponding containers according to the first allocation requirement. Before the binding relationship is established, a total address pool is configured according to the number of the predetermined IP addresses, and the total address pool is stored in a database of the etcd, so that distributed storage is realized. The total address pool may be stored not only in the etcd but also in other servers as long as distributed storage is available. The etcd is a key/value storage service applied in a distributed environment. By taking advantage of the properties of etcd, applications can share information, configure or discover services in a cluster, and etcd will replicate these data in the various nodes of the cluster and ensure that the data is always correct. The predetermined number of IP addresses may be set according to network planning, i.e. the requirement for the number of IP addresses.
The binding relationship is established by one-to-one correspondence between a certain container and a certain IP address in the total address pool, and the container and the certain IP address are recorded on the etcd server. When allocating the address, checking whether the container is in one-to-one correspondence with a certain IP address, if so, allocating the IP address to the container, and otherwise, allocating the container with the unbound IP address in the total address pool. Reading a part of IP addresses from a total address pool according to a first allocation requirement, and determining a binding label (label) of a container of the IP addresses to be bound according to the first allocation requirement; establishing a one-to-one corresponding relation between the binding tag and the read IP address; the correspondence is recorded in a static allocation list. In the static allocation list, all the bound IP addresses can be found, and the static allocation list can also be stored in the etcd in a distributed manner. The step of judging whether the container to be allocated with the IP address has a binding relationship with the IP address comprises the following steps: and judging whether the container to be allocated with the IP address has a binding label. And the step of assigning the IP address bound to the container to which the IP address is to be assigned to the container comprises: acquiring a binding label of a container to be allocated with an IP address; searching out a corresponding IP address in the static allocation list according to the binding label; and allocating the IP address to the container to which the IP address is to be allocated. The binding relationship between the label and the IP address is established, so that the calling of a user can be facilitated, because the MAC (Media Access Control) addresses of different containers in multiple accesses are different, but the label can be kept the same. Therefore, if the external service is based on the IP, the IP address obtained by the user in multiple accesses can be kept unchanged through the binding of the label and the IP address, and the calling of the user is further facilitated.
S102: and under the condition of receiving the request of allocating the IP address, judging whether a container of the IP address to be allocated has a binding relationship with the IP address. If the IP address is bound with the corresponding container through the label, after the request for allocating the IP address is received, whether the container of the IP address to be allocated has the label is judged, if so, the binding relationship between the container of the IP address to be allocated and a certain IP address in the total address pool can be judged, and S103 is further executed, namely, static allocation is carried out. If the container to be allocated with the IP address does not have label, the container to be allocated with the IP address is judged not to be bound with the IP address, and S104 is further executed, namely dynamic allocation is carried out.
S103: and allocating the IP address bound by the container to which the IP address is to be allocated to the container. In the static allocation process, according to a received request for allocating the IP address, a binding label of a container of the IP address to be allocated is obtained, a corresponding IP address is found in the static allocation list according to the binding label, and the IP address is allocated to the container of the IP address to be allocated.
S104: and allocating the unbound IP addresses in the total address pool to the containers to be allocated with the IP addresses. In the process of configuring the total address pool, the designated address pool can be configured for the designated physical machine through the configuration file according to the second allocation requirement, and all the IP addresses in the designated address pool are contained in the total address pool, namely the designated address pool is subordinate to the total address pool. In practical application, there may be a specific address pool that needs to be specifically set for a certain physical machine, and when an IP address is allocated to the physical machine, the IP address is obtained from the specific address pool for allocation. If the requirement for configuring the designated address pool does not exist, the IP address can be directly acquired from the total address pool for allocation when the IP address is allocated.
Thus, the dynamic allocation further comprises: and judging whether the physical machine where the container to be allocated with the IP address is located is configured with a specified address pool. If not, allocating the unbound IP addresses in the total address pool to a container to be allocated with the IP addresses; otherwise, allocating the unbound IP addresses in the designated address pool to the container to be allocated with the IP addresses. Through the process, the requirement that the user sets the corresponding appointed address pool for the specific physical machine in the IP address distribution can be met. Meanwhile, the dynamic allocation further comprises: judging whether the designated address pool and the designated address pools of other physical machines have intersection or not; if the intersection exists, outputting error information; otherwise, allocating the IP address in the unallocated list in the designated address pool to the container of the IP address to be allocated, removing the IP address from the unallocated list, and recording the IP address in the allocated list corresponding to the container of the acquired IP address. By judging whether the designated address pool and the designated address pools of other physical machines have intersection, the IP address can be ensured to uniquely identify the container.
After configuring the total address pool or the designated address pool, an unallocated list and an allocated list are created, the unallocated list is initialized to the total address pool or the designated address pool (IP addresses in the total address pool or the designated address pool are both in the unallocated list), and the allocated list is initialized to be empty. And, the IP addresses in the unallocated list are sorted and stored according to the size of the IP addresses. In the process of allocating an IP address, the IP address at the head of the table is taken out of the unallocated list and moved to the allocated list. Meanwhile, the corresponding relation between the allocated IP address and the container for acquiring the IP address is recorded in the allocated list, so that when a certain container is deleted, the IP address of the deleted container can be found out through the corresponding relation. And (4) recovering the IP address, namely moving the IP address from the allocated list to the unallocated list, and deleting the corresponding relation stored in the allocated list and the information of the IP address. And, adding the IP address to the end of the unallocated list does not destroy the original order. The process of allocation described above is the way of dequeuing and enqueuing. In order to allocate the IP addresses in the total address pool to the containers to be allocated with the IP addresses according to the dequeuing and enqueuing mode, the IP addresses allocated to the containers can be conveniently predicted, and the problem that the prior Calico-cni randomly allocates subnets to each physical machine to cause the unpredictability of a user is solved.
The method for allocating the IP address of the container in the embodiment of the invention also comprises the following steps: after static allocation or dynamic allocation is carried out, namely after a container of an IP address to be allocated is allocated to the IP address, a pair of veth-pair (virtual Ethernet pair) is created for the container acquiring the IP address according to the allocated IP address. And creating a pair of path-pair, one end of which is sent to the inside of the container, and the other end of which exists outside the container in the form of a network card. The network packet is directly forwarded from the network card to the inside of the container without using a bridge interface. The address allocated by the method for allocating the IP address of the container in the embodiment of the invention is a network card allocated to the inside of the container, and the smoothness of a network can be ensured only by matching with a route. The container IP address allocation method of the embodiment of the invention is based on the fact that the IP address of the traditional network does not use overlay or bridging, simplifies the network architecture and ensures the maximization of the network performance.
FIG. 2 is a schematic diagram of dynamic allocation according to an embodiment of the present invention.
After determining that dynamic allocation is performed when a request for allocating an IP address is received, as shown in fig. 2, it is determined whether a physical machine to which a container to be allocated with an IP address belongs configures a designated address pool. If the designated address pool is not configured, the IP address is acquired from the total address and is allocated to the container of the IP address to be allocated. In the process of allocation, in order to distinguish allocated IP addresses from unallocated IP addresses, an unallocated list (assignedips queue) and an allocated list (assignedips queue) may be created. If it has already been created, it does not need to be created again. And after the unallocated list and the allocated list are created, taking out the first IP address in the unallocated list to allocate to the container, deleting the IP address in the unallocated list, and adding the IP address to the allocated list. For example, the IP address queue is initialized and arranged in the order from small to large, but when a certain address is released, the address is added at the tail of the queue, and then the IP addresses are distributed from beginning to end in the order of the queue. For example: the initial queues for the IP addresses are 172.30.1.1, 172.30.1.2, 172.30.1.3, 172.30.1.4. When three containers are requested, 172.30.1.1, 172.30.1.2 and 172.30.1.3 are respectively allocated to the three containers, and only 172.30.1.4 is left in the unsignedIPs queue. When a container brought to 172.30.1.2 is destroyed and the address is released, the released address is added to the tail of the unsignedIPs queue, 172.30.1.4, 172.30.1.2. If the container applies for allocating the IP address, the IP addresses are allocated according to the sequence of the IP addresses of the current unidentified IDs queue, and 172.30.1.4 is allocated to the container instead of 172.30.1.2.
If the physical machine to which the container to be allocated with the IP address belongs is configured with a designated address pool, whether the designated address pool belongs to the total address pool or not is judged, and if not, an error is prompted. Because the total address pool set in the embodiment of the present invention can be used globally, each designated address pool of the configuration should belong to the total address pool. And after the appointed address pool is judged to belong to the total address pool, in order to ensure the uniqueness of the IP address of the container, whether the appointed address pool has intersection with the appointed address pools of other physical machines or not is continuously judged, and if the intersection exists, an error is also prompted. Because the configuration of the designated address pool for the physical machine is realized through the configuration file, the fact that the designated address pool does not have intersection with the designated address pools of other physical machines is judged, the designated address pool is recorded in the database of the etcd, and the synchronization of the configuration file and the etcd is further realized. If the specified address pool is already recorded on the etcd, it does not need to be recorded again.
As shown in fig. 2, after the designated address pool is recorded on the etcd, an unsignedIPs queue and a signedIPs queue are created for the designated address pool, and the unsignedIPs queue is initialized as the designated address pool, that is, the IP addresses in the designated address pool are all in the unsignedIPs queue. At the same time, the signedIPs queue is initialized to empty. If the IP address is distributed to the physical machine of the designated address pool, the creation of the unsignedIPs queue and the signedIPs queue is not needed, and the initialization operation is also not needed. After the steps, the process of allocating the IP address is still carried out according to a dequeue-in-pair mode, namely, the first IP address in the current unidentified dIPs queue is taken out, and if container deletion exists, the IP address of the container is added to the last unidentified dIPs queue.
And after taking out the first IP address in the unsignedIPs queue, judging whether the IP address belongs to a static allocation list, if so, moving the IP address to the static allocation list, and continuing to judge from the first IP address in the current unsignedIPs queue. And if the extracted IP address does not belong to the static allocation list, moving the IP address from the unsignedIPs queue to the signedIPs queue. Furthermore, unallocated IP addresses are stored in the unsigedips queue, and the allocated IP addresses and container information for acquiring the IP addresses are recorded in the unsigedips queue.
FIG. 3 is a schematic illustration of static allocation according to an embodiment of the present invention.
After static allocation is determined according to the label of the container to which the IP address is to be allocated, as shown in fig. 3, whether the IP address bound to the container belongs to the total address pool is determined according to the label, and if the total address pool is used globally, a prompt error does not exist. And if the IP address bound by the container belongs to the total address pool, modifying the container corresponding to the bound IP address into the current container and recording the current container in the static allocation list. In the static allocation process, one IP address can be reused, and the binding relationship is modified to enable the IP address to be allocated to different containers. And determining whether the binding relation between the IP address and the container changes or not according to the judgment of the binding relation at this time and the judgment of which container the IP address searched through the binding relation is allocated to. If the binding has changed, it needs to record which container this address is currently used by. If the binding relation is not changed, recording is not required to be performed again.
Based on the above process, the retraction of the IP address when the container is deleted is simple. The method comprises the steps of firstly finding out an IP address through the corresponding relation between a container and the IP address, moving the IP address from a signedIPS queue to an unsignedIPs queue, and clearing the corresponding relation between the IP address and the container. If the IP address is in the static binding list, only the corresponding relation between the IP address and the container needs to be deleted.
In the prior art, in the process of allocating the IP address through the flannel, a user needs to set a flannel overlay network belonging to the same intranet IP segment on an etcd server. When Docker on a physical node starts, if a flannel network model is used, flannel allocates a small range of subnets from the overlay network to this node. So that the containers on the physical node all use the IP address in this subnet. The specific process comprises the following steps: firstly, setting a { "Network": 10.1.0.0/16"} overlay Network on an etcd server, then using the parameters of a flanker process on a physical machine when the docker process is started, and allocating subnets by using flannel, such as the following two physical machines, one is allocated 10.1.15.1/24 and the other is allocated 10.1.20.1/24. The embodiment of the invention simplifies the process of allocating IP addresses by setting the address pool, which is similar to directly taking addresses from 10.1.0.0/16 network without allocating subnets for each physical machine.
Moreover, when designing a network, if the container IP range on each physical machine or some physical machines needs to be specified, the flannel needs to configure the etcd server, and the method for allocating the container IP address in the embodiment of the present invention only needs to modify the configuration file. The method for allocating the IP address of the container is a KubernetescMI method, and can be used by matching a binary file sDHclient and a configuration file. The configuration file is loaded when the kubel is started, an IP address used by a container on the node, namely a specified address pool (subnet) is configured, and in addition, a static allocation list for binding the specified container and the IP address is configured on the etcd. Recorded in the static allocation list is the correspondence between the label field of the container pod and the IP address. CNI typically requires the implementation of two interfaces, cmdAdd to give containers an address and cmdDel to retract an address. Wherein, cmdAdd and cmddDel are function interfaces in the CNI plug-in, and the embodiment of the invention is realized by the CNI plug-in.
First, check whether there is label in the parameter (container name or container ID) of cmdAdd, if there is static allocation, otherwise, dynamic allocation is performed.
For dynamic allocation of IP addresses, a total address pool (defaultPool) set in the database of the etcd is first needed. The subnet in the configuration file on each kubel node must belong to this address pool. If subnet is not configured, defaultPool is used by default. And the sDHclient also checks whether a specified address pool intersected with the subnet exists on the etcd, if so, an error is reported, and a user is prompted to modify the configuration to prevent the same IP address from being allocated.
The sDHclient will assign IP addresses to the containers pod respectively according to the ground dequeue pair. And recording the unsignedIPs queue and the assigned signedIPs queue in the etcd to ensure that repeated IP addresses cannot be assigned. In addition, subnet of the physical machine configuration is recorded on the etcd to prevent the subnet from being overlapped with other nodes. In addition, the correspondence between the container and the allocated IP address is recorded in the etcd so that the IP address can be correctly recovered when the container is deleted. Meanwhile, before the IP address is allocated to the container, whether the IP address is in the static address binding list needs to be checked, if the IP address is in the static address binding list, the address needs to be skipped, and the address needs to be removed from the unidentified dIPs list, so that the sDHclient is prevented from allocating the IP address to the unbound container.
Fig. 4 is a schematic diagram of the main blocks of a system for container IP address assignment according to an embodiment of the present invention. As shown in fig. 4, a system 400 for allocating IP addresses to containers according to an embodiment of the present invention mainly includes: a configuration module 401, a determination module 402, a static allocation module 403, and a dynamic allocation module 404.
The configuration module 401 is configured to establish a one-to-one corresponding binding relationship between part of the IP addresses in the total address pool and the corresponding containers according to a first allocation requirement after configuring the total address pool;
the judging module 402 is configured to, in a case where a request for allocating an IP address is received, judge whether a container to which the IP address is to be allocated establishes a binding relationship with an IP address in the total address pool;
the static allocation module 403 is configured to perform static allocation after the determining module determines that the container of the IP address to be allocated and the IP address in the total address pool establish a binding relationship, where the static allocation includes: allocating the IP address bound in the total address pool of the container to be allocated with the IP address to the container to be allocated with the IP address;
the dynamic allocation module 404 is configured to perform dynamic allocation after the determining module determines that the container of the IP address to be allocated and the IP address in the total address pool do not establish a binding relationship, where the dynamic allocation includes: and allocating the unbound IP addresses in the total address pool to the containers to be allocated with the IP addresses.
The configuration module 401 determines a binding tag of a container to be bound with the IP address according to the first allocation requirement; establishing a one-to-one corresponding relation between the binding label and the IP address in the total address pool; the correspondence is recorded in a static allocation list. Furthermore, the static allocation module 403 includes: the acquiring unit is used for acquiring the binding label of the container to which the IP address is to be allocated according to the received request for allocating the IP address; the searching unit is used for searching out a corresponding IP address in the static allocation list according to the binding label; and the allocation unit is used for allocating the IP address to the container to be allocated with the IP address.
The configuration module 401 is further configured to configure the total address pool according to the network planning, and store the total address pool in the database of the etcd in a distributed manner. And configuring a designated address pool for the designated physical machine through the configuration file according to the second allocation requirement, wherein all IP addresses in the designated address pool are contained in the total address pool.
The dynamic allocation module 404 is further configured to determine whether a physical machine where a container to be allocated with an IP address is located configures an assigned address pool; if not, the dynamic allocation module allocates the unbound IP addresses in the total address pool to a container of the IP addresses to be allocated; otherwise, the dynamic allocation module allocates the unbound IP addresses in the designated address pool to the container of the IP addresses to be allocated. The dynamic allocation module is also used for judging whether the designated address pool and the designated address pools of other physical machines have intersection; if the intersection exists, outputting error information; otherwise, allocating the IP address in the unallocated list in the designated address pool to the container of the IP address to be allocated, removing the IP address from the unallocated list, and recording the IP address in the allocated list corresponding to the container of the acquired IP address.
In the process of allocating the IP addresses, the static allocation module and the dynamic allocation module allocate the IP addresses in the total address pool to containers to be allocated with the IP addresses according to a dequeue and enqueue mode. The system for allocating the container IP address in the embodiment of the invention also comprises a creating module which is used for creating a pair of path-pair for the container to be allocated with the IP address according to the allocated IP address after static allocation or dynamic allocation is carried out.
The system for distributing the container IP address writes a total address pool in the database of the etcd in advance, and each kubel node can freely share the total address pool as required. Each kubel node can also be configured with a designated address pool for the kubel node through a configuration file according to requirements, and the designated address pools all belong to a total address pool written in the etcd in advance. If the designated address pool is not configured, the total address pool preset in the etcd is used by default in the process of allocating the IP address. Meanwhile, the system for allocating the container IP address in the embodiment of the present invention further provides a function of binding the container and the IP address, unlike the case where the container and the IP address are bound by a MAC address and an IP address in a Dynamic Host Configuration Protocol (DHCP), the system for allocating the container IP address in the embodiment of the present invention binds a container label and an IP address. The system for allocating the IP address of the container of the embodiment of the invention also creates a path-pair, one end of the path-pair is sent to the inside of the container, and the other end of the path-pair exists outside the container in the form of a network card. The network packet is directly forwarded from the network card to the inside of the container without using a bridge interface. The address allocated by the system for allocating the IP address of the container in the embodiment of the invention is configured to the network card in the container, and the smoothness of the network can be ensured only by matching with the route.
Fig. 5 illustrates an exemplary system architecture 500 of a system for container IP address assignment or a method for container IP address assignment to which embodiments of the present invention may be applied.
As shown in fig. 5, the system architecture 500 may include terminal devices 501, 502, 503, a network 504, and a server 505. The network 504 serves to provide a medium for communication links between the terminal devices 501, 502, 503 and the server 505. Network 504 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 501, 502, 503 to interact with a server 505 over a network 504 to receive or send messages or the like. The terminal devices 501, 502, 503 may have various communication client applications installed thereon, such as a shopping application, a web browser application, a search application, an instant messaging tool, a mailbox client, social platform software, and the like.
The terminal devices 501, 502, 503 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 505 may be a server that provides various services, such as a background management server that supports shopping websites browsed by users using the terminal devices 501, 502, 503. The background management server can analyze and process the received data such as the product information inquiry request and feed back the processing result to the terminal equipment.
It should be noted that the method for allocating the container IP address provided by the embodiment of the present invention is generally executed by the server 505, and accordingly, the system for allocating the container IP address is generally disposed in the server 505.
It should be understood that the number of terminal devices, networks, and servers in fig. 5 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 6, a block diagram of a computer system 600 suitable for use with a terminal device implementing an embodiment of the invention is shown. The terminal device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU)601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as an internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such embodiments, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 601.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. 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 or flowchart illustration, and combinations of blocks in the block diagrams 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.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor comprises a configuration module, a judgment module, a static allocation module and a dynamic allocation module. For example, the configuration module may be further described as a module that establishes a one-to-one binding relationship between part of IP addresses in the total address pool and corresponding containers according to a first allocation requirement after configuring the total address pool.
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: after a total address pool is configured, establishing a one-to-one corresponding binding relationship between part of IP addresses in the total address pool and corresponding containers according to a first distribution requirement; under the condition of receiving a request for allocating an IP address, judging whether a container of the IP address to be allocated and the IP address in the total address pool establish a binding relationship; if yes, performing static allocation, wherein the static allocation comprises the following steps: allocating the IP address bound in the total address pool by the container of the IP address to be allocated to the container of the IP address to be allocated; otherwise, performing dynamic allocation, wherein the dynamic allocation comprises: and allocating the unbound IP addresses in the total address pool to the containers to be allocated with the IP addresses.
According to the technical scheme of the embodiment of the invention, a total address pool is configured to be used by all containers in the cluster, and any address can be ensured to be used by all nodes. And the binding relationship is established through the container label and the IP address, so that the IP address is unchanged when the container is restarted or migrated. By integrating dynamic IP address allocation and static IP address allocation, the network layout is more convenient.
The above-described embodiments should not be construed as limiting the scope of the invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations, and substitutions may occur depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (17)

1. A method for container IP address assignment, comprising:
establishing a one-to-one corresponding binding relationship between part of IP addresses in the total address pool and corresponding containers according to a first allocation requirement;
under the condition of receiving a request for allocating an IP address, judging whether a container of the IP address to be allocated has a binding relationship with the IP address;
if so, allocating the IP address bound to the container of the IP address to be allocated to the container;
otherwise, allocating the unbound IP addresses in the total address pool to the containers of the IP addresses to be allocated.
2. The method of claim 1,
the step of establishing a one-to-one corresponding binding relationship between part of the IP addresses in the total address pool and the corresponding containers according to the first allocation requirement comprises: reading a part of IP addresses from the total address pool according to a first distribution requirement, and determining a binding label of a container to be bound with the IP addresses according to the first distribution requirement; establishing a one-to-one corresponding relation between the binding tag and the read IP address; recording the corresponding relation in a static allocation list;
the step of judging whether the container to which the IP address is to be allocated has a binding relationship with the IP address comprises the following steps: judging whether a container to be allocated with an IP address has a binding label;
the step of allocating the IP address bound to the container of the IP address to be allocated to the container comprises the following steps: acquiring a binding label of a container to be allocated with an IP address; searching out a corresponding IP address in the static allocation list according to the binding label; and allocating the IP address to the container to be allocated with the IP address.
3. The method according to claim 1, wherein before the step of establishing a one-to-one binding relationship between a part of IP addresses in the total address pool and corresponding containers according to the first allocation requirement, the method further comprises: configuring a total address pool according to the number of the predetermined IP addresses; the pool of total addresses is then stored in the database of the etcd.
4. The method of claim 1,
before the step of establishing a one-to-one corresponding binding relationship between part of the IP addresses in the total address pool and the corresponding containers according to the first allocation requirement, the method further includes: configuring a designated address pool for a designated physical machine through a configuration file according to a second allocation demand, wherein all IP addresses in the designated address pool are contained in the total address pool;
the step of allocating the unbound IP addresses in the total address pool to the container to which the IP address is to be allocated comprises: judging whether a physical machine where the container of the IP address to be allocated is located is configured with a designated address pool or not; if not, allocating the unbound IP addresses in the total address pool to the containers of the IP addresses to be allocated; otherwise, allocating the unbound IP addresses in the designated address pool to the containers of the IP addresses to be allocated.
5. The method of claim 4, wherein the step of assigning the unbound IP addresses in the total address pool to the container to which the IP address is to be assigned further comprises:
judging whether the designated address pool and the designated address pools of other physical machines have intersection or not;
if the intersection exists, outputting error information; otherwise, allocating the IP address in the unallocated list in the designated address pool to the container of the IP address to be allocated, removing the IP address from the unallocated list, and recording the IP address in the allocated list corresponding to the container for acquiring the IP address.
6. The method of claim 1,
the step of allocating the IP address bound to the container of the IP address to be allocated to the container comprises the following steps: determining an IP address positioned at the first position according to the sequence of the currently bound IP addresses, and then allocating the IP address to the container;
the step of allocating the unbound IP addresses in the total address pool to the container to which the IP address is to be allocated comprises: the IP address located at the first bit is determined according to the order of unbound IP addresses in the total address pool, and then assigned to the container.
7. The method of claim 1, wherein after assigning the IP address to the container, further comprising:
and according to the allocated IP address, creating a pair of virtual network devices for the container acquiring the IP address.
8. A system for container IP address assignment, comprising:
the configuration module is used for establishing a one-to-one corresponding binding relationship between part of IP addresses in the total address pool and the corresponding containers according to the first distribution requirement;
the judging module is used for judging whether a container of the IP address to be allocated has a binding relationship with the IP address or not under the condition of receiving the request of allocating the IP address;
the static allocation module is used for allocating the IP address bound to the container of the IP address to be allocated to the container after the judgment module judges that the container of the IP address to be allocated has the binding relationship with the IP address;
and the dynamic allocation module is used for allocating the unbound IP addresses in the total address pool to the containers of the IP addresses to be allocated after the judgment module judges that the containers of the IP addresses to be allocated have no binding relationship with the IP addresses.
9. The system of claim 8,
the configuration module is further used for reading out part of IP addresses from the total address pool according to the first distribution requirement and determining a binding label of a container to be bound with the IP addresses according to the first distribution requirement; establishing a one-to-one corresponding relation between the binding tag and the read IP address; recording the corresponding relation in a static allocation list;
the judging module is also used for judging whether the container to be allocated with the IP address has the binding label.
10. The system of claim 9, wherein the static allocation module comprises:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring a binding label of a container to be allocated with an IP address;
the searching unit is used for searching out a corresponding IP address in the static allocation list according to the binding label;
and the allocation unit is used for allocating the IP address to the container of the IP address to be allocated.
11. The system according to claim 8, wherein the configuration module is further configured to, before the step of establishing a one-to-one correspondence binding relationship between a part of the IP addresses in the total address pool and the corresponding containers according to the first allocation requirement, configure the total address pool according to a predetermined number of the IP addresses; the pool of total addresses is then stored in the database of the etcd.
12. The system according to claim 8, wherein the configuration module is further configured to, before the step of establishing a one-to-one binding relationship between a part of IP addresses in the total address pool and corresponding containers according to the first allocation requirement, configure a designated address pool for the designated physical machine through a configuration file according to the second allocation requirement, and all the IP addresses in the designated address pool are contained in the total address pool; and
the dynamic allocation model is further used for judging whether a physical machine where the container of the IP address to be allocated is located is configured with a designated address pool or not; if not, allocating the unbound IP addresses in the total address pool to the containers of the IP addresses to be allocated; otherwise, allocating the unbound IP addresses in the designated address pool to the containers of the IP addresses to be allocated.
13. The system of claim 12, wherein the dynamic allocation module is further configured to determine whether the pool of specified addresses intersects with pools of specified addresses of other physical machines; if the intersection exists, outputting error information; otherwise, allocating the IP address in the unallocated list in the designated address pool to the container of the IP address to be allocated, removing the IP address from the unallocated list, and recording the IP address in the allocated list corresponding to the container for acquiring the IP address.
14. The system of claim 8,
the static allocation module is also used for determining the IP address positioned at the first position according to the sequence of the currently bound IP address and then allocating the IP address to the container;
the dynamic allocation module is further used for determining the IP address at the first bit according to the sequence of the unbound IP addresses in the total address pool and then allocating the IP address to the container.
15. The system of claim 8, further comprising:
and the creating module is used for creating a pair of virtual network equipment for the container acquiring the IP address according to the allocated IP address after the IP address is allocated to the container.
16. An apparatus for container IP address assignment, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-7.
17. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-7.
CN201710854707.2A 2017-09-20 2017-09-20 Method and system for allocating IP addresses of containers Active CN107580083B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710854707.2A CN107580083B (en) 2017-09-20 2017-09-20 Method and system for allocating IP addresses of containers

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710854707.2A CN107580083B (en) 2017-09-20 2017-09-20 Method and system for allocating IP addresses of containers

Publications (2)

Publication Number Publication Date
CN107580083A CN107580083A (en) 2018-01-12
CN107580083B true CN107580083B (en) 2020-11-03

Family

ID=61036356

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710854707.2A Active CN107580083B (en) 2017-09-20 2017-09-20 Method and system for allocating IP addresses of containers

Country Status (1)

Country Link
CN (1) CN107580083B (en)

Families Citing this family (36)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108494880B (en) * 2018-04-18 2021-04-27 云家园网络技术有限公司 Communication method and system based on large-scale data center management
CN110445884A (en) * 2018-05-04 2019-11-12 中国移动通信集团浙江有限公司 A kind of container IP address management method and device
CN108881455B (en) * 2018-06-28 2020-12-08 西北工业大学 Data packaging and transmission method in heterogeneous cloud storage system of low-capacity storage node
CN110716787A (en) * 2018-07-13 2020-01-21 中兴通讯股份有限公司 Container address setting method, apparatus, and computer-readable storage medium
CN108810192A (en) * 2018-07-20 2018-11-13 郑州云海信息技术有限公司 A kind of static IP configuration method, device, equipment and readable storage medium storing program for executing
CN110769075B (en) * 2018-07-25 2022-07-05 中国电信股份有限公司 Container communication method, system, controller and computer readable storage medium
CN109462511B (en) * 2018-12-11 2021-12-24 中科曙光国际信息产业有限公司 Network establishing method and device
CN111352689B (en) * 2018-12-21 2023-04-07 中国电信股份有限公司 Method and device for realizing seamless migration of application containerized deployment
CN110138606B (en) * 2019-05-06 2022-03-15 携程旅游信息技术(上海)有限公司 Container network configuration method and system
CN110262873B (en) * 2019-05-17 2023-07-28 平安科技(深圳)有限公司 Configuration modification method and device for container application, computer equipment and storage medium
CN110149422A (en) * 2019-06-25 2019-08-20 苏州梦嘉信息技术有限公司 A kind of domain name management method and system
CN112243044B (en) * 2019-07-16 2023-05-19 广州虎牙科技有限公司 Container address allocation method and device
CN112769965B (en) * 2019-10-21 2023-02-07 中盈优创资讯科技有限公司 IP address management and distribution method, device and system
CN110750332A (en) * 2019-10-23 2020-02-04 广西梯度科技有限公司 Method for setting static IP (Internet protocol) in Pod in Kubernetes
CN111124604B (en) * 2019-12-05 2023-07-14 北京金山云网络技术有限公司 Method, device, equipment and storage medium for distributing pod IP address
CN111193783B (en) * 2019-12-19 2022-08-26 新浪网技术(中国)有限公司 Service access processing method and device
CN111147297B (en) * 2019-12-23 2022-07-15 广东省新一代通信与网络创新研究院 Multi-layer network plane construction method of kubernets
CN113037522A (en) * 2019-12-24 2021-06-25 华为数字技术(苏州)有限公司 Container unit management method and related equipment
CN113055500B (en) * 2019-12-26 2022-08-30 中国电信股份有限公司 Address request method, device and computer readable storage medium
CN111491040B (en) * 2020-04-09 2023-03-24 北京城市网邻信息技术有限公司 IP distribution method and IP distribution device
CN111835880A (en) * 2020-06-23 2020-10-27 新浪网技术(中国)有限公司 IP address allocation method and system
CN112153167B (en) * 2020-08-06 2023-02-28 北京百度网讯科技有限公司 Internet interconnection protocol management method, device, electronic equipment and storage medium
CN112565475B (en) * 2020-12-01 2023-07-11 成都精灵云科技有限公司 Ip address allocation method for adding new node in container cluster service layer
CN113766042A (en) * 2021-01-20 2021-12-07 北京沃东天骏信息技术有限公司 Container address configuration method, system, device, equipment and medium
CN115174529B (en) * 2021-03-18 2024-01-23 北京金山云网络技术有限公司 Network processing method and device, electronic equipment and storage medium
US11671401B2 (en) 2021-03-25 2023-06-06 Cisco Technology, Inc. Providing persistent external internet protocol address for extra-cluster services
CN114124905A (en) * 2021-11-03 2022-03-01 中盈优创资讯科技有限公司 Method and device for judging static address pool address occupation condition statistics
CN114070822B (en) * 2021-11-17 2022-10-14 江苏博云科技股份有限公司 Kubernetes Overlay IP address management method
CN114328330A (en) * 2021-11-22 2022-04-12 广州极飞科技股份有限公司 Address allocation method, equipment management and irrigation system, slave machine and input equipment
CN114500523A (en) * 2021-11-29 2022-05-13 上海浦东发展银行股份有限公司 Fixed IP application release method based on container cloud platform
CN114640652B (en) * 2022-02-24 2023-09-19 联想(北京)有限公司 Information processing method and device
CN114567617B (en) * 2022-02-25 2023-08-04 苏州浪潮智能科技有限公司 IP address allocation method, system, electronic equipment and storage medium
CN114827017B (en) * 2022-03-31 2024-01-30 北京声智科技有限公司 Communication method and device of Kafka cluster, electronic equipment and storage medium
CN115361359A (en) * 2022-08-18 2022-11-18 中电云数智科技有限公司 IP address management device and method based on kubernets
CN116016438B (en) * 2022-12-12 2023-08-15 上海道客网络科技有限公司 Method and system for uniformly distributing IP addresses by multiple subnets based on container cloud platform
CN115801733A (en) * 2023-02-02 2023-03-14 天翼云科技有限公司 Network address allocation method and device, electronic equipment and readable medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104951360A (en) * 2015-06-30 2015-09-30 北京奇虎科技有限公司 Configuration management mode and device based on Docker
CN105635336A (en) * 2015-12-31 2016-06-01 北京轻元科技有限公司 Dynamic and adaptive mixed cloud network management method
CN105763670A (en) * 2016-04-08 2016-07-13 北京搜狐新媒体信息技术有限公司 Method and device for allocating IP address to container
CN105893133A (en) * 2016-03-31 2016-08-24 乐视控股(北京)有限公司 Application service seamless migration method and system based on container technology
CN105897946A (en) * 2016-04-08 2016-08-24 北京搜狐新媒体信息技术有限公司 Obtaining method and system of access address
CN105978781A (en) * 2016-06-28 2016-09-28 浪潮电子信息产业股份有限公司 Method and system for establishing network connection of Docker container, and client side
CN106686088A (en) * 2016-12-30 2017-05-17 广东浪潮大数据研究有限公司 Management method supporting multi-network mode of Docker environment
CN106953943A (en) * 2017-04-25 2017-07-14 中国联合网络通信集团有限公司 Suitable for the method and device of switch communication
US9934073B2 (en) * 2015-10-23 2018-04-03 Futurewei Technologies, Inc. Extension of resource constraints for service-defined containers

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105491123B (en) * 2015-12-04 2019-02-22 北京航空航天大学 Communication means and device between container
CN106878484A (en) * 2017-02-27 2017-06-20 郑州云海信息技术有限公司 A kind of method of configuration Docker cluster external containers IP

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104951360A (en) * 2015-06-30 2015-09-30 北京奇虎科技有限公司 Configuration management mode and device based on Docker
US9934073B2 (en) * 2015-10-23 2018-04-03 Futurewei Technologies, Inc. Extension of resource constraints for service-defined containers
CN105635336A (en) * 2015-12-31 2016-06-01 北京轻元科技有限公司 Dynamic and adaptive mixed cloud network management method
CN105893133A (en) * 2016-03-31 2016-08-24 乐视控股(北京)有限公司 Application service seamless migration method and system based on container technology
CN105763670A (en) * 2016-04-08 2016-07-13 北京搜狐新媒体信息技术有限公司 Method and device for allocating IP address to container
CN105897946A (en) * 2016-04-08 2016-08-24 北京搜狐新媒体信息技术有限公司 Obtaining method and system of access address
CN105978781A (en) * 2016-06-28 2016-09-28 浪潮电子信息产业股份有限公司 Method and system for establishing network connection of Docker container, and client side
CN106686088A (en) * 2016-12-30 2017-05-17 广东浪潮大数据研究有限公司 Management method supporting multi-network mode of Docker environment
CN106953943A (en) * 2017-04-25 2017-07-14 中国联合网络通信集团有限公司 Suitable for the method and device of switch communication

Also Published As

Publication number Publication date
CN107580083A (en) 2018-01-12

Similar Documents

Publication Publication Date Title
CN107580083B (en) Method and system for allocating IP addresses of containers
US11658936B2 (en) Resizing virtual private networks in provider network environments
US10666609B2 (en) Management of domain name systems in a large-scale processing environment
US10320674B2 (en) Independent network interfaces for virtual network environments
CN109196474B (en) Distributed operation control in a computing system
US10148736B1 (en) Executing parallel jobs with message passing on compute clusters
CN103797462B (en) A kind of method and apparatus creating virtual machine
CN102710814B (en) The control method of virtual machine IP address and device
EP2344953B1 (en) Provisioning virtual resources using name resolution
US8448171B2 (en) Communications between virtual machines that have been migrated
US10095502B2 (en) Unified update tool for multi-protocol network adapter
US10666508B2 (en) Unified software defined networking configuration management over multiple hosting environments
CN110881007B (en) Container cluster network access method and device
US20120290695A1 (en) Distributed Policy Service
WO2015176636A1 (en) Distributed database service management system
CN112202615B (en) Multi-CNI cooperative work system and method
US20190372908A1 (en) Failover management using availability groups
US10673694B2 (en) Private network mirroring
US11343141B2 (en) Methods and apparatus to migrate physical server hosts between virtual standard switches and virtual distributed switches in a network
TW201434300A (en) Service migration across cluster boundaries
US11397622B2 (en) Managed computing resource placement as a service for dedicated hosts
CN105589731A (en) Virtual machine migration method and device
CN113810230A (en) Method, device and system for carrying out network configuration on containers in container cluster
US8930967B2 (en) Shared versioned workload partitions
CN109067573B (en) Traffic scheduling method and device

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