CN115543344A - Container instance deployment method, device and system - Google Patents

Container instance deployment method, device and system Download PDF

Info

Publication number
CN115543344A
CN115543344A CN202110728239.0A CN202110728239A CN115543344A CN 115543344 A CN115543344 A CN 115543344A CN 202110728239 A CN202110728239 A CN 202110728239A CN 115543344 A CN115543344 A CN 115543344A
Authority
CN
China
Prior art keywords
copies
nodes
resource pools
node
cluster
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.)
Pending
Application number
CN202110728239.0A
Other languages
Chinese (zh)
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.)
China Telecom Corp Ltd
Original Assignee
China Telecom Corp 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 China Telecom Corp Ltd filed Critical China Telecom Corp Ltd
Priority to CN202110728239.0A priority Critical patent/CN115543344A/en
Publication of CN115543344A publication Critical patent/CN115543344A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment

Abstract

The invention provides a deployment method, a device and a system of container instances, and relates to the field of cloud computing, wherein the method comprises the following steps: receiving a first request to deploy a plurality of first copies of a first container instance on a node in a cluster of nodes, the cluster of nodes comprising a plurality of first resource pools that do not overlap with each other, the first request indicating a preference to distributively deploy the plurality of first copies in different first resource pools; deploying the plurality of first copies on nodes in the cluster of nodes, comprising: when m is larger than or equal to 2 and is smaller than or equal to n, traversing at least m first resource pools in the plurality of first resource pools at one time to determine m nodes, wherein different nodes in the m nodes belong to different first resource pools, m is the number of undeployed first copies in the plurality of first copies, and n is the number of the plurality of first resource pools; deploying m undeployed first copies on the m nodes in parallel.

Description

Container instance deployment method, device and system
Technical Field
The present disclosure relates to the field of cloud computing, and in particular, to a method, an apparatus, and a system for deploying container instances.
Background
In the related art, when deploying a copy of a container instance, nodes in a node cluster are traversed once, and a node with the highest score is determined, so that a copy of the container instance is deployed on the determined node.
Disclosure of Invention
The inventors have noted that when multiple copies of a container instance need to be deployed, in this manner, multiple traversals are required, each traversal being able to determine only one node, resulting in inefficient deployment.
In order to solve the above problem, the embodiments of the present disclosure propose the following solutions.
According to an aspect of the embodiments of the present disclosure, there is provided a method for deploying a container instance, including: receiving a first request to deploy a plurality of first copies of a first container instance on a node in a cluster of nodes comprising a plurality of first resource pools that do not overlap with one another, the first request indicating that the plurality of first copies are preferentially distributed in different first resource pools; deploying the plurality of first copies on nodes in the cluster of nodes, comprising: when m is larger than or equal to 2 and is smaller than or equal to n, traversing at least m first resource pools in the plurality of first resource pools at one time to determine m nodes, wherein different nodes in the m nodes belong to different first resource pools, m is the number of undeployed first copies in the plurality of first copies, and n is the number of the plurality of first resource pools; deploying m undeployed first copies on the m nodes in parallel.
In some embodiments, deploying the first plurality of replicas on the nodes of the node cluster further comprises: in the case that m > n, traversing the plurality of first resource pools at a time to determine n nodes, different ones of the n nodes belonging to different first resource pools; deploying n undeployed first copies on the n nodes in parallel.
In some embodiments, traversing the plurality of first resource pools at a time to determine n nodes comprises: traversing each node in the n first resource pools to determine a score for each node; and determining the node with the highest score in each of the n first resource pools to obtain n nodes.
In some embodiments, the total number of the plurality of first replicas is a = k × n + t, where k and t are integers and k ≧ 1,2 ≦ t < n; traversing the plurality of first resource pools at a time to determine n nodes further comprises determining an average score for all nodes in each of the n first resource pools; traversing at least m of the plurality of first resource pools at a time to determine m nodes comprises: traversing each node in the m first resource pools to determine the score of each node, wherein the traversed m first resource pools are the first m first resource pools with the highest average score in the n first resource pools; and determining the node with the highest score in each of the m first resource pools to obtain m nodes.
In some embodiments, the method further comprises: receiving a second request to deploy a plurality of second copies of a second container instance on a node in the cluster of nodes; adding the plurality of first copies and the plurality of second copies to a queue, the plurality of first copies in the queue being before or after the plurality of second copies; sequentially retrieving the first copies from the queue prior to deploying the first copies on nodes in the node cluster; sequentially taking out the plurality of second copies from the queue; deploying the plurality of second copies on nodes in the cluster of nodes.
In some embodiments, enqueuing the first plurality of copies and the second plurality of copies comprises: creating the first copies and the second copies and adding the first copies and the second copies into the queue according to the sequence of creation time, wherein each first copy carries a first label, and each second copy carries a second label different from the first label; retrieving the first and second plurality of copies from the queue; rejoining the plurality of first copies and the plurality of second copies to the queue according to the first tag and the second tag such that the plurality of first copies precede or follow the plurality of second copies.
In some embodiments, the node cluster includes a plurality of second resource pools that do not overlap with each other, the second request indicating that the plurality of second copies are preferentially distributively deployed in different second resource pools; deploying the plurality of second copies on a node in the cluster of nodes comprises: and taking the plurality of second resource pools as the plurality of first resource pools and the plurality of second copies as the plurality of first copies, and repeatedly executing the step of deploying the plurality of first copies on the nodes in the node cluster.
In some embodiments, the first request carries a first resource value that needs to be consumed by a first container instance running, the second request carries a second resource value that needs to be consumed by a second container instance running, the second resource value being less than the first resource value, the plurality of first copies preceding the plurality of second copies in the queue.
According to another aspect of the embodiments of the present disclosure, there is provided a deployment apparatus for a container instance, including: a receiving module configured to receive a first request to deploy a plurality of first copies of a first container instance on a node in a cluster of nodes, the cluster of nodes including a plurality of first resource pools that do not overlap with each other, the first request indicating a priority to distributively deploy the plurality of first copies in different first resource pools; a deployment module configured to deploy the plurality of first copies on nodes in the cluster of nodes, comprising: when m is larger than or equal to 2 and is smaller than or equal to n, traversing at least m first resource pools in the plurality of first resource pools at one time to determine m nodes, wherein different nodes in the m nodes belong to different first resource pools, m is the number of undeployed first copies in the plurality of first copies, and n is the number of the plurality of first resource pools; deploying m undeployed first copies on the m nodes in parallel.
According to a further aspect of the embodiments of the present disclosure, there is provided a deployment apparatus for a container instance, including: a memory; and a processor coupled to the memory, the processor configured to perform the method of any of the above embodiments based on instructions stored in the memory.
According to still another aspect of the embodiments of the present disclosure, there is provided a deployment system of a container instance, including: a deployment apparatus for a container instance according to any of the embodiments above; and the node cluster.
According to a further aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium comprising computer program instructions, wherein the computer program instructions, when executed by a processor, implement the method of any one of the above embodiments.
In an embodiment of the disclosure, the first request indicates that the plurality of first copies of the first container instance are preferentially deployed in different first resource pools in a distributed manner. In this case, at least m first resource pools of the plurality of first resource pools are traversed at a time to determine m nodes belonging to different first resource pools, and then m undeployed first copies are deployed on the m nodes in parallel. Since m nodes can be determined in one traversal, the number of times that the deployment of the plurality of first replicas requires traversal of the plurality of first resource pools can be reduced, and the m first replicas can be deployed in parallel. In this way, the total deployment time of the plurality of first replicas can be reduced, thereby improving the deployment efficiency of the plurality of first replicas.
The technical solution of the present disclosure is further described in detail by the accompanying drawings and examples.
Drawings
In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present disclosure, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a flow diagram of a method of deploying a container instance, according to some embodiments of the present disclosure;
FIG. 2 is a flow diagram of a method for deploying a container instance according to further embodiments of the present disclosure;
FIG. 3 is a schematic structural diagram of a deployment device for an example container, according to some embodiments of the present disclosure;
FIG. 4 is a schematic structural diagram of a deployment device for an example of a container according to further embodiments of the present disclosure;
FIG. 5 is a schematic structural diagram of a deployment system for an instance of a container according to some embodiments of the present disclosure.
Detailed Description
The technical solutions in the embodiments of the present disclosure will be described clearly and completely with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the embodiments described are only some embodiments of the present disclosure, rather than all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments disclosed herein without making any creative effort, shall fall within the protection scope of the present disclosure.
The relative arrangement of the components and steps, the numerical expressions, and numerical values set forth in these embodiments do not limit the scope of the present disclosure unless specifically stated otherwise.
Meanwhile, it should be understood that the sizes of the respective portions shown in the drawings are not drawn in an actual proportional relationship for the convenience of description.
Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail but are intended to be part of the specification where appropriate.
In all examples shown and discussed herein, any particular value should be construed as merely illustrative, and not limiting. Thus, other examples of the exemplary embodiments may have different values.
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, further discussion thereof is not required in subsequent figures.
FIG. 1 is a flow diagram of a method of deploying a container instance, according to some embodiments of the present disclosure.
As shown in fig. 1, the deployment method of the container instance includes steps 102 to 104.
At step 102, a first request to deploy a plurality of first copies of a first container instance on a node in a cluster of nodes is received.
It should be understood that the first container instance (i.e., pod) includes one or more containerized applications.
Here, the node cluster includes a plurality of first resource pools that do not overlap with each other, each of the first resource pools including a plurality of nodes.
It should be understood that the node cluster may include a first pool of resources that overlap one another. The first resource pools that overlap with each other may be considered as one first resource pool as a whole.
The description will be given taking as an example a case where the node cluster includes 7 nodes (e.g., nodes 1-7), and the node cluster includes 4 first resource pools (e.g., first resource pools a-d). First resource pool a includes nodes 1 and 2, first resource pool b includes nodes 3 and 4, first resource pool c includes nodes 5 and 6, and first resource pool d includes nodes 6 and 7. The nodes in the first resource pools a and b do not overlap with other resource pools, and the nodes 6 in the first resource pools c and d overlap, i.e., the first resource pools c and d that overlap with each other are collectively regarded as 1 first resource pool. In other words, the node cluster includes 3 first resource pools that do not overlap with each other.
The first request indicates that the plurality of first copies are to be preferentially distributed in different first resource pools.
For example, the first request indicates that the first copies are preferentially distributed and deployed on nodes in different zones (zones), and at this time, the first resource pools are zones of a node cluster. For another example, the first request indicates that the first copies are preferentially distributed and deployed on nodes of different racks (Rack) in the same region, and in this case, the first resource pools are the racks in the region.
At step 104, a plurality of first replicas are deployed on nodes in a node cluster.
Here, the plurality of first replicas are deployed on nodes in the node cluster as follows.
Under the condition that m is more than or equal to 2 and less than or equal to n, firstly, traversing at least m first resource pools in the plurality of first resource pools at one time to determine m nodes. Here, m is the number of undeployed first copies in the plurality of first copies, and n is the number of the plurality of first resource pools. It should be understood that different ones of the determined m nodes belong to different first resource pools. Then, m undeployed first copies are deployed on the determined m nodes in parallel.
For example, a total number of the plurality of first copies of the first container instance (e.g., m) is less than or equal to n. In this case, the plurality of first resource pools may be traversed once to determine m nodes belonging to the m first resource pools from the plurality of first resource pools, thereby deploying the plurality of first replicas on the determined m nodes.
In some embodiments, traversing at least m of the plurality of first resource pools at a time to determine m nodes comprises: traversing each node in at least m first resource pools to determine a score for each node; and determining the node with the highest score in each of the m first resource pools, so as to obtain m nodes.
It should be understood that each node in the plurality of first resource pools (i.e., the n first resource pools) may be traversed first to determine a score for each node. Then, m nodes belonging to the m first resource pools are determined from the n first resource pools.
In the above embodiment, the first request indicates that the plurality of first copies of the first container instance are preferentially distributed in different first resource pools. In this case, at least m first resource pools of the plurality of first resource pools are traversed at a time to determine m nodes belonging to different first resource pools, and then m undeployed first copies are deployed on the m nodes in parallel. Since m nodes can be determined in one traversal, the number of times that the deployment of the plurality of first replicas requires traversal of the plurality of first resource pools can be reduced, and the m first replicas can be deployed in parallel. In this way, the total deployment time of the plurality of first replicas can be reduced, thereby improving the deployment efficiency of the plurality of first replicas.
The method of deploying the container instance shown in fig. 1 is further described below in connection with some embodiments.
In some embodiments, the number of undeployed first replicas, m, is greater than n. In the case where m > n, the first copy may be deployed as follows. First, a plurality of first resource pools are traversed at once to determine n nodes. Here, different ones of the determined n nodes belong to different first resource pools. Then, n undeployed first copies are deployed on the determined n nodes in parallel.
Similarly to traversing at least m first resource pools of the plurality of first resource pools at a time to determine m nodes, the plurality of first resource pools may be traversed at a time to determine n nodes as follows. First, each node in the n first resource pools may be traversed to determine a score for each node. Then, the node with the highest score in each of the n first resource pools is determined, so that n nodes are obtained.
In some embodiments, the total number of the plurality of first copies of the first container instance is a = k × n +1. Wherein k is an integer and k is not less than 1. In this case, k traversals may be first repeatedly performed in the manner described above, each traversal determining n nodes to deploy n undeployed first copies on the n nodes. Then, a traversal is performed to determine 1 node, so that the remaining 1 undeployed first copy is deployed on the node.
In still other embodiments, the total number of the plurality of first copies of the first container instance is a = k × n + t. Wherein t is an integer and 2. Ltoreq. T < n. In this case, k traversals may be first repeatedly performed in the manner described above, each traversal determining n nodes to deploy n undeployed first copies on the n nodes. Then, a traversal is made to determine t (i.e., m) nodes to deploy the remaining t undeployed first copies in parallel on the determined t nodes.
For example, the first request indicates that 5 first copies of the first container instance are preferentially deployed distributively in 3 first resource pools that do not overlap with each other. Before the first replica begins to be deployed, there are 5 undeployed first replicas. First, all nodes of the 3 first resource pools are traversed at once to determine 3 nodes, and then 3 first copies of the 5 first copies are deployed on the determined 3 nodes in parallel. After the deployment of the 3 first copies is completed, 2 undeployed first copies remain. Then, all nodes of the 3 first resource pools are traversed again to determine 2 nodes, and then the remaining 2 undeployed first copies are deployed in parallel on the determined 2 nodes. In this way, the 5 first copies of the first container example are all deployed on the nodes in the node cluster after two traversals, thereby greatly improving the deployment efficiency.
In some embodiments, the total number of the plurality of first copies of the first container instance is a = k × n + t. After traversing the n first resource pools to determine the score for each node, an average score for all nodes in each of the n first resource pools is further determined. Then, traversing at least m first resource pools of the plurality of first resource pools at a time to determine m nodes comprises: each node in the m first resource pools is traversed to determine a score for each node. Here, the m first resource pools traversed are the first m first resource pools with the highest average score among the n first resource pools. Then, the node with the highest score in each of the m first resource pools is determined, so that m nodes are obtained.
In the above embodiment, the average score of all nodes in each of the n first resource pools is first determined, and then when the last remaining m (i.e., t) first replicas are deployed, the first m first resource pools with the highest average score among the n first resource pools are traversed instead of traversing the n first resource pools. Therefore, the number of nodes needing to be traversed in the last traversal can be reduced, the traversal time is reduced, and the deployment efficiency is further improved.
As described above, for a received first request to deploy multiple first copies of a first container instance, deploying in the manner of the various embodiments described above may improve the deployment efficiency of the multiple first copies.
The inventor also noted that, in the related art, if other requests are received (for example, a second request for deploying multiple second copies of a second container instance on a node in a node cluster), multiple first copies and multiple second copies are arranged in a queue of copies to be deployed out of order according to the sequence of creation time, so that only one node can be determined and one copy can be deployed in one traversal. In view of this, the present disclosure also provides a method of deploying the container instance as shown in fig. 2.
FIG. 2 is a flow diagram of a method for deploying a container instance according to further embodiments of the present disclosure.
As shown in fig. 2, the deployment method of the container instance further includes steps 202 to 210 in addition to step 102 and step 104 shown in fig. 1.
Similarly to step 102, at step 202, a second request to deploy a plurality of second copies of the second container instance on nodes in the node cluster of step 102 is received.
At step 204, the first plurality of copies and the second plurality of copies are added to the queue. Here, the plurality of first copies in the queue precede or follow the plurality of second copies.
Implementations of enqueuing the first plurality of copies and the second plurality of copies are described below in connection with some embodiments.
In step 206, the first copies are sequentially taken from the queue.
In step 208, the second plurality of copies is sequentially pulled from the queue.
At step 210, a plurality of second replicas are deployed on nodes in the node cluster.
It is to be understood that step 104 is performed after step 206, and step 210 is performed after step 208.
It should also be understood that step 206 and step 104 are performed before step 208, or that step 208 and step 210 are performed before step 206.
For example, in the case where the first plurality of copies precedes the second plurality of copies in the queue, steps 206 and 104 may be performed first, followed by steps 208 and 210. For another example, in the case where the plurality of first copies in the queue is subsequent to the plurality of second copies, step 208 and step 210 may be performed first, and then step 206 and step 104 may be performed.
In the above embodiment, the plurality of first copies and the plurality of second copies are added to the queue, and the plurality of first copies in the queue are before or after the plurality of second copies. In this way, the plurality of first copies and the plurality of second copies are no longer arranged in the queue of the copies to be deployed out of order, thereby ensuring that a plurality of nodes can be determined by one traversal, and ensuring that the deployment efficiency of the plurality of first copies can be improved.
The implementation of step 204 is described below in connection with some embodiments.
In some embodiments, after receiving the first request and the second request, the plurality of first copies and the plurality of second copies are created first, and the plurality of first copies and the plurality of second copies are added to the queue according to the sequence of creation time. Here, each first copy created carries the same first tag and each second copy created carries the same second tag. It should be noted that the first copy carries a first tag that is different from the second tag carried by the second copy. The first and second plurality of copies are then taken out of the queue. Finally, the plurality of first copies and the plurality of second copies are re-queued according to the first tags and the second tags such that the plurality of first copies precede or follow the plurality of second copies.
For example, a plurality of first copies may first be identified from a first tag, and all of the first copies may be added to the queue in sequence. After all of the first copies are enqueued, a plurality of second copies are identified based on the second tags, and all of the second copies are enqueued in sequence. As such, all second copies follow all first copies in the queue.
In some embodiments, the first request carries a first resource value that the first container instance needs to consume for running, and the second request carries a second resource value that the second container instance needs to consume for running. The second resource value is less than the first resource value, and the plurality of first copies precedes the plurality of second copies in the queue. It should be appreciated that a first resource value greater than a second resource value indicates that the first request is prioritized over the second request. By having multiple first copies in the queue ahead of multiple second copies, it is possible to have multiple first copies of higher priority deployed preferentially.
In some embodiments, the cluster of nodes comprises a plurality of second resource pools that do not overlap with each other. The second request also indicates a preference to distributively deploy the plurality of second copies in different second resource pools. In this case, the step of deploying the plurality of first copies on the nodes in the node cluster may be repeatedly performed with the plurality of second resource pools as the plurality of first resource pools and the plurality of second copies as the plurality of first copies. In this way, the plurality of second copies can be deployed on the nodes of the node cluster according to the deployment mode of the plurality of first copies, so that the deployment efficiency of the plurality of second copies can be improved.
In still other embodiments, the second request indicates that multiple second copies are to be deployed in the same second resource pool. In this case, the plurality of second copies may be deployed one by one in the same second resource pool in a manner of determining one node per traversal for a plurality of traversals.
It should be understood that the second resource pool may be either the same resource pool as the first resource pool or a different resource pool than the first resource pool.
It should also be understood that the first request and the second request are received without limitation to quantity. In practice, multiple requests to deploy multiple copies of a container instance may be received and the deployment of the multiple copies may be implemented in the manner of the embodiments described above.
Fig. 3 is a schematic structural diagram of a deployment device for an example container according to some embodiments of the present disclosure.
As shown in fig. 3, the deployment apparatus 300 of the container instance includes a receiving module 301 and a deployment module 302.
The receiving module 301 is configured to receive a first request to deploy multiple first copies of a first container instance on a node in a cluster of nodes. Here, the node cluster includes a plurality of first resource pools that do not overlap with each other. The first request indicates a preference to distributively deploy the plurality of first copies in different first resource pools.
The deployment module 302 is configured to deploy a plurality of first replicas on nodes in the node cluster, including: under the condition that m is more than or equal to 2 and less than or equal to n, traversing at least m first resource pools in the plurality of first resource pools at one time to determine m nodes; the m undeployed first copies are deployed on the determined m nodes in parallel. Wherein m is the number of undeployed first copies in the plurality of first copies, and n is the number of the plurality of first resource pools. It should be understood that different ones of the determined m nodes belong to different first resource pools.
In some embodiments, the deployment module 302 is further configured to traverse the plurality of first resource pools at a time to determine n nodes, where m > n; n undeployed first replicas are deployed on the determined n nodes in parallel. Here, different ones of the n nodes belong to different first resource pools.
FIG. 4 is a schematic diagram of a deployment apparatus for an example container according to further embodiments of the present disclosure.
As shown in fig. 4, the deployment apparatus 400 of the container example comprises a memory 401 and a processor 402 coupled to the memory 401, the processor 402 being configured to execute the method of any of the foregoing embodiments based on instructions stored in the memory 401.
The memory 401 may include, for example, a system memory, a fixed non-volatile storage medium, and the like. The system memory may store, for example, an operating system, application programs, a Boot Loader (Boot Loader), and other programs.
The apparatus 400 may also include an input-output interface 403, a network interface 404, a storage interface 405, and the like. The interfaces 403, 404, 405 and the memory 401 and the processor 402 may be connected by a bus 406, for example. The input/output interface 403 provides a connection interface for input/output devices such as a display, a mouse, a keyboard, and a touch screen. The network interface 404 provides a connection interface for various networking devices. The storage interface 405 provides a connection interface for external storage devices such as an SD card and a usb disk.
It should be appreciated that the container instance deployment apparatus 300/400 provided by the embodiments of the present disclosure may be applied to different container instance management platforms (e.g., kubernets), thereby improving the deployment efficiency of container instances.
FIG. 5 is a schematic structural diagram of a deployment system for an instance of a container according to some embodiments of the present disclosure.
As shown in fig. 5, the deployment system of the container instance includes a deployment apparatus 300/400 of the container instance and a node cluster 501.
The node cluster 501 includes a plurality of nodes (12 are schematically shown in fig. 5). The node cluster 501 includes a plurality of resource pools (3 first resource pools and 2 second resource pools are schematically shown in fig. 5). In fig. 5, 3 first resource pools are, for example, 3 zones, and 2 second resource pools are, for example, 2 racks in the same zone.
Embodiments of the present disclosure also provide a computer-readable storage medium including computer program instructions, which when executed by a processor, implement the method of any one of the above embodiments.
Thus, various embodiments of the present disclosure have been described in detail. Some details that are well known in the art have not been described in order to avoid obscuring the concepts of the present disclosure. It will be fully apparent to those skilled in the art from the foregoing description how to practice the presently disclosed embodiments.
In the present specification, the embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts in the embodiments are referred to each other. For the deployment apparatus and system embodiments of the container example, since they substantially correspond to the method embodiments, the description is relatively simple, and reference may be made to the partial description of the method embodiments for relevant points.
As will be appreciated by one skilled in the art, embodiments of the present disclosure may be provided as a method, system, or computer program product. Accordingly, the present disclosure may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present disclosure may take the form of a computer program product embodied on one or more computer-usable non-transitory storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present disclosure is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the disclosure. It will be understood that the functions specified in one or more of the flows in the flow diagrams and/or one or more of the blocks in the block diagrams can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Although some specific embodiments of the present disclosure have been described in detail by way of example, it should be understood by those skilled in the art that the foregoing examples are for purposes of illustration only and are not intended to limit the scope of the present disclosure. It will be understood by those skilled in the art that various changes may be made in the above embodiments or equivalents may be substituted for elements thereof without departing from the scope and spirit of the present disclosure. The scope of the present disclosure is defined by the appended claims.

Claims (12)

1. A method of deploying a container instance, comprising:
receiving a first request to deploy a plurality of first copies of a first container instance on a node in a cluster of nodes comprising a plurality of first resource pools that do not overlap with one another, the first request indicating that the plurality of first copies are preferentially distributed in different first resource pools;
deploying the plurality of first copies on nodes in the cluster of nodes, comprising:
when m is larger than or equal to 2 and is smaller than or equal to n, traversing at least m first resource pools in the plurality of first resource pools at one time to determine m nodes, wherein different nodes in the m nodes belong to different first resource pools, m is the number of undeployed first copies in the plurality of first copies, and n is the number of the plurality of first resource pools;
deploying m undeployed first copies on the m nodes in parallel.
2. The method of claim 1, wherein deploying the plurality of first replicas on the nodes of the node cluster further comprises:
in the case that m > n, traversing the plurality of first resource pools at a time to determine n nodes, different ones of the n nodes belonging to different first resource pools;
deploying n undeployed first copies on the n nodes in parallel.
3. The method of claim 2, wherein traversing the plurality of first resource pools at one time to determine n nodes comprises:
traversing each node in the n first resource pools to determine a score for each node;
and determining the node with the highest score in each of the n first resource pools to obtain n nodes.
4. The method of claim 3, wherein the total number of the plurality of first replicas is a = k x n + t, wherein k and t are integers and k ≧ 1,2 ≦ t < n;
traversing the plurality of first resource pools at a time to determine n nodes further comprises determining an average score for all nodes in each of the n first resource pools;
traversing at least m of the plurality of first resource pools at a time to determine m nodes comprises:
traversing each node in the m first resource pools to determine the score of each node, wherein the traversed m first resource pools are the first m first resource pools with the highest average score in the n first resource pools;
and determining the node with the highest score in each of the m first resource pools to obtain m nodes.
5. The method of any of claims 1-4, further comprising:
receiving a second request to deploy a plurality of second copies of a second container instance on a node in the cluster of nodes;
adding the plurality of first copies and the plurality of second copies to a queue, the plurality of first copies in the queue being before or after the plurality of second copies;
sequentially retrieving the first copies from the queue before deploying the first copies on nodes in the cluster of nodes;
sequentially taking out the plurality of second copies from the queue;
deploying the plurality of second copies on nodes in the cluster of nodes.
6. The method of claim 5, wherein enqueuing the first plurality of copies and the second plurality of copies comprises:
creating the first copies and the second copies and adding the first copies and the second copies into the queue according to the sequence of creation time, wherein each first copy carries a first label, and each second copy carries a second label different from the first label;
retrieving the first and second plurality of copies from the queue;
rejoining the plurality of first copies and the plurality of second copies to the queue according to the first tag and the second tag such that the plurality of first copies precede or follow the plurality of second copies.
7. The method of claim 5, wherein the cluster of nodes includes a plurality of second resource pools that do not overlap with one another, the second request indicating a preference to distributively deploy the plurality of second copies in different second resource pools;
deploying the plurality of second copies on a node in the cluster of nodes comprises:
and taking the plurality of second resource pools as the plurality of first resource pools and the plurality of second copies as the plurality of first copies, and repeatedly executing the step of deploying the plurality of first copies on the nodes in the node cluster.
8. The method of claim 5, wherein the first request carries a first resource value that needs to be consumed by a first container instance running, the second request carries a second resource value that needs to be consumed by a second container instance running, the second resource value being less than the first resource value, the plurality of first copies preceding the plurality of second copies in the queue.
9. A deployment apparatus for a container instance, comprising:
a receiving module configured to receive a first request to deploy a plurality of first copies of a first container instance on a node in a cluster of nodes, the cluster of nodes including a plurality of first resource pools that do not overlap with each other, the first request indicating a priority to distributively deploy the plurality of first copies in different first resource pools;
a deployment module configured to deploy the plurality of first copies on nodes in the cluster of nodes, comprising: when m is larger than or equal to 2 and is smaller than or equal to n, traversing at least m first resource pools in the plurality of first resource pools at one time to determine m nodes, wherein different nodes in the m nodes belong to different first resource pools, m is the number of undeployed first copies in the plurality of first copies, and n is the number of the plurality of first resource pools; deploying m undeployed first copies on the m nodes in parallel.
10. A deployment apparatus for a container instance, comprising:
a memory; and
a processor coupled to the memory and configured to perform the method of any of claims 1-8 based on instructions stored in the memory.
11. A system for deploying container instances, comprising:
a deployment device for the container instance of claim 9 or 10; and
the node cluster.
12. A computer readable storage medium comprising computer program instructions, wherein the computer program instructions, when executed by a processor, implement the method of any of claims 1-8.
CN202110728239.0A 2021-06-29 2021-06-29 Container instance deployment method, device and system Pending CN115543344A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110728239.0A CN115543344A (en) 2021-06-29 2021-06-29 Container instance deployment method, device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110728239.0A CN115543344A (en) 2021-06-29 2021-06-29 Container instance deployment method, device and system

Publications (1)

Publication Number Publication Date
CN115543344A true CN115543344A (en) 2022-12-30

Family

ID=84716733

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110728239.0A Pending CN115543344A (en) 2021-06-29 2021-06-29 Container instance deployment method, device and system

Country Status (1)

Country Link
CN (1) CN115543344A (en)

Similar Documents

Publication Publication Date Title
CN109377232B (en) DAG-based block chain transaction sequencing method and device
CN111768006A (en) Artificial intelligence model training method, device, equipment and storage medium
CN107832143B (en) Method and device for processing physical machine resources
CN112214319B (en) Task scheduling method for sensing computing resources
CN111880939A (en) Container dynamic migration method and device and electronic equipment
US10102098B2 (en) Method and system for recommending application parameter setting and system specification setting in distributed computation
CN109597810B (en) Task segmentation method, device, medium and electronic equipment
CN111932257A (en) Block chain parallelization processing method and device
CN108140049B (en) Parallel batch processing of tree-based data structures
CN111083189B (en) System and method for processing data skew at runtime
CN109800078B (en) Task processing method, task distribution terminal and task execution terminal
JP2017204161A (en) Clustering device, clustering method, and clustering program
CN112306452A (en) Method, device and system for processing service data by merging and sorting algorithm
CN115543344A (en) Container instance deployment method, device and system
CN113222099A (en) Convolution operation method and chip
CN110704535A (en) Data binning method, device, equipment and computer readable storage medium
CN110688223B (en) Data processing method and related product
CN115346099A (en) Image convolution method, chip, equipment and medium based on accelerator chip
CN114741173A (en) DAG task arranging method and device, electronic equipment and storage medium
CN114237902A (en) Service deployment method and device, electronic equipment and computer readable medium
CN111343110B (en) Message processing method, SDN switch and computer readable storage medium
CN107247621B (en) Scheduling method and device for batch processing tasks
CN113515495B (en) Data file distribution method and device, intelligent equipment and computer storage medium
CN112306675A (en) Data processing method, related device and computer readable storage medium
CN115145714A (en) Method, device and system for scheduling container instances

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