CN110300130A - A kind of resource regulating method, device, electronic equipment and storage medium - Google Patents
A kind of resource regulating method, device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN110300130A CN110300130A CN201810233345.XA CN201810233345A CN110300130A CN 110300130 A CN110300130 A CN 110300130A CN 201810233345 A CN201810233345 A CN 201810233345A CN 110300130 A CN110300130 A CN 110300130A
- Authority
- CN
- China
- Prior art keywords
- pod
- target
- node
- target node
- pod set
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
- G06F9/4881—Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
- G06F9/5038—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/70—Admission control; Resource allocation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention discloses a kind of resource regulating method, device, electronic equipment and storage mediums, the described method includes: obtaining each of generation Pod to be scheduled in current dispatching cycle, the identical Pod of resources requirement is divided into same Pod set, and gather for each Pod, the resources requirement of any Pod in Pod set is gathered into corresponding target resource demand as the Pod;Each Pod set is successively determined as target Pod set, gather for current goal Pod, when surplus resources meet the quantity of the target Node of the target resource demand of target Pod set, when including the quantity of Pod in no less than target Pod set, a target Node is distributed for each Pod in target Pod set, and corresponding Pod is disposed on assigned target Node, wherein the target Node of difference Pod distribution is different.To improve scheduling of resource efficiency.
Description
Technical field
The present invention relates to technical field of data processing more particularly to a kind of resource regulating method, device, electronic equipment and deposit
Storage media.
Background technique
Scheduling of resource is that container orchestrating services (kubernetes) server cluster carries out important one of container organization work
Ring, wherein container group (Pod) is the minimum thread of kubernetes, is made of, belongs to multiple containers (container)
The container of one Pod has to operate on same node (Node), and the container on the same Pod shares identical
IP address.In kubernetes, it is responsible for arranging Pod by the scheduler (Scheduler) in kubernetes server cluster
To specific Node, it monitors Pod by the interface that API Server is provided, obtains Pod to be scheduled, then according to pre-selection plan
Slightly and preference policy gives each Node marking sequence, and then Pod is dispatched on the Node of highest scoring and is disposed.
The existing resource dispatching strategy for Pod includes: pre-selection strategy (Predicates) and preference policy
(Priorites), specifically, including: all Node of 1, traversal when carrying out scheduling of resource for Pod, according to pre-selection strategy
Satisfactory Node is filtered out, the requirement of pre-selection strategy is such as met without Node, which will be suspended, until existing
The Node met the requirements;It 2, is the symbol selected according to preference policy on the basis of pre-selection strategy selects satisfactory Node
It closes desired Node and carries out marking sequence, using the highest Node of score value as the Node for disposing the Pod.
However, the prior art, for each Pod, is required to when kubernetes server cluster carries out scheduling of resource
The primary all Node of traversal select satisfactory Node by pre-selection strategy, and are meeting of selecting by preference policy
It is required that Node carry out marking sequence, and using the highest Node of score value as the Node of deployment Pod, calculating process is complicated, Pod tune
Spend low efficiency, and when Node quantity is larger, exist largely compute repeatedly with memory space expense, cause the wave of resource
Take.
Summary of the invention
The present invention provides a kind of resource regulating method, device, electronic equipment and storage medium, to solve in the prior art
In the presence of largely computing repeatedly with memory space expense, the problem of causing low Pod dispatching efficiency and the wasting of resources.
In a first aspect, the invention discloses a kind of resource regulating methods, which comprises
Each of generation container group Pod to be scheduled in current dispatching cycle is obtained, according to the money of each Pod to be scheduled
The identical Pod of resources requirement is divided into same Pod set, and gathers for each Pod by source demand, by the Pod collection
The resources requirement of any Pod gathers corresponding target resource demand as the Pod in conjunction;
Each Pod set is successively determined as target Pod set, is gathered for current goal Pod, when surplus resources meet
The target Pod set target resource demand destination node Node destination number, the no less than target Pod set in wrap
When the first quantity containing Pod, a target Node is distributed for each Pod in target Pod set, wherein what difference Pod was distributed
Target Node is different;And according to the target Node distributed for each Pod, each Pod is deployed to corresponding target Node.
Using the dispatching method of the application, may be implemented to the identical Pod of multiple resource requirements in same dispatching cycle
Parallel Scheduling is selected satisfactory without traversing primary all Node for each Pod by pre-selection strategy
Node, and be that the satisfactory Node selected carries out marking sequence by preference policy, it avoids and computes repeatedly, saved and deposited
Space is stored up, Pod dispatching efficiency is improved, has saved resource.
In addition, in order to meet the needs of providing service for user, the demand for services amount that certain service object is provided compared with
When big, replicanism usually is taken to the corresponding Pod of the service object, although the Pod mark after duplication has differences,
Substantially be it is identical, the resources requirement needed be also it is identical, because the identical Pod of resources requirement is divided by the application
Same Pod set, while a target Node is distributed for each Pod in Pod set, wherein the target Node of difference Pod distribution
It is different;Avoiding the Pod that will be replicated, all distribution, when the Node breaks down, leads to service disruption in a Node
The case where.
Optionally, described to gather for current goal Pod, when surplus resources meet the target resource of target Pod set
When including the first quantity of Pod in the destination number of the target Node of demand, the no less than target Pod set, for the target
One target Node of each Pod distribution includes: in Pod set
Gather for current goal Pod, judges that current residual resource meets the target resource demand of target Pod set
Target Node the second quantity whether be no less than the target Pod set in include Pod the first quantity;
If so, distributing a target Node for each Pod in target Pod set;If not, by target Pod collection
Each Pod in conjunction is hung up, until the third quantity of target Node is no less than in target Pod set the first number comprising Pod
Amount distributes a target Node for each Pod in target Pod set.
By the optional mode, include if the second quantity of current goal Node is no less than in target Pod set
The first quantity of Pod directly distributes a target Node for each Pod in target Pod set;Otherwise, by target Pod collection
Each Pod in conjunction is hung up, until the third quantity of target Node is no less than in target Pod set the first number comprising Pod
Amount distributes a target Node for each Pod in target Pod set.It ensure that each Pod to be scheduled, can be disposed
The Node for meeting the resources requirement of the Pod to a surplus resources, ensure that the Stability and veracity of scheduling of resource.
Optionally, described to include: for one target Node of each Pod distribution in target Pod set
According to the unassigned IP subnet address of each target Node, one is distributed for each Pod in target Pod set
The unassigned IP subnet address of target Node.
By the optional mode, according to the unassigned IP subnet address of each target Node, for target Pod set
In each Pod distribute the unassigned IP subnet address of a target Node, kubernetes server cluster can be improved
The efficiency of networking is carried out according to the IP subnet address of the corresponding Node of Pod.
Optionally, the method also includes:
The IP subnet address that target Node is Pod distribution is labeled as having distributed.
By the optional mode, it can be duplicatedly distributed to avoid the IP subnet address of same Node, ensure that resource tune
The accuracy of degree.
Optionally, according to the resources requirement of each Pod to be scheduled, the identical Pod of resources requirement is divided into together
Include: in one Pod set
According to the resources requirement of each Pod to be scheduled and corresponding service service object, by resources requirement phase
Together and the identical Pod of corresponding service object is divided into same Pod set.
In order to improve the service ability of certain Pod, certain Pod in same service object may be replicated,
Therefore there may be multiple identical Pod under same service object, therefore can be by resources requirement in same service object
Identical Pod is divided into same Pod set, to improve scheduling of resource efficiency, and by the optional way, by resource requirement
It measures the identical Pod of identical and corresponding service object to be divided into same Pod set, can also avoid in a Pod set
The quantity of Pod is excessive, influences scheduling of resource efficiency.
Second aspect, the invention discloses a kind of resource scheduling device, described device includes:
Obtain module, each of generate container group Pod to be scheduled in current dispatching cycle for obtaining, according to it is each to
The identical Pod of resources requirement is divided into same Pod set, and is directed to each Pod by the resources requirement of the Pod of scheduling
The resources requirement of any Pod in Pod set is gathered corresponding target resource demand as the Pod by set;
Scheduler module is gathered for each Pod set to be successively determined as target Pod, is gathered for current goal Pod,
When surplus resources meet the target Pod set target resource demand destination node Node destination number, no less than should
When including the first quantity of Pod in target Pod set, a target Node is distributed for each Pod in target Pod set,
The target Node of middle difference Pod distribution is different;And according to the target Node distributed for each Pod, each Pod is deployed to correspondence
Target Node.
The third aspect, the invention discloses a kind of electronic equipment, including memory and processor;
The processor executes following process: obtaining in current dispatching cycle and generate for reading the program in memory
Each of container group Pod to be scheduled, according to the resources requirement of each Pod to be scheduled, by the identical Pod of resources requirement
It is divided into same Pod set, and gather for each Pod, using the resources requirement of any Pod in Pod set as being somebody's turn to do
Pod gathers corresponding target resource demand;Each Pod set is successively determined as target Pod set, for current goal
Pod set, when surplus resources meet the target Pod set target resource demand destination node Node destination number,
When including the first quantity of Pod in no less than target Pod set, a target is distributed for each Pod in target Pod set
Node, wherein the target Node of difference Pod distribution is different;And according to the target Node distributed for each Pod, by each portion Pod
Affix one's name to corresponding target Node.
Optionally, the processor is specifically used for gathering for current goal Pod, judges that current residual resource meets and is somebody's turn to do
Whether the second quantity of the target Node of the target resource demand of target Pod set is no less than in target Pod set
The first quantity of Pod;If so, distributing a target Node for each Pod in target Pod set;If not, by the target
Each Pod in Pod set is hung up, until the third quantity of target Node is no less than the comprising Pod in target Pod set
One quantity distributes a target Node for each Pod in target Pod set.
Optionally, the processor, specifically for the IP subnet address unassigned according to each target Node, for the mesh
Mark the unassigned IP subnet address that each Pod in Pod set distributes a target Node.
Optionally, the processor is also used to be that the IP subnet address that Pod is distributed is labeled as having distributed by target Node.
Optionally, the processor, specifically for according to each Pod to be scheduled resources requirement and corresponding service
The identical Pod of the identical and corresponding service object of resources requirement is divided into same Pod set by service object.
Fourth aspect, the invention discloses a kind of electronic equipment, comprising: processor, communication interface, memory and communication are total
Line, wherein processor, communication interface, memory complete mutual communication by communication bus;
It is stored with computer program in the memory, when described program is executed by the processor, so that the place
Manage the step of device executes any of the above-described the method.
5th aspect, the invention discloses a kind of computer readable storage medium, being stored with can be executed by electronic equipment
Computer program, when described program is run on the electronic equipment so that the electronic equipment execute any of the above-described
The step of the method.
The embodiment of the invention discloses a kind of resource regulating method, device, electronic equipment, storage medium, the method packets
It includes: each of generation container group Pod to be scheduled in current dispatching cycle is obtained, according to the resource need of each Pod to be scheduled
The identical Pod of resources requirement is divided into same Pod set, and gathers for each Pod by the amount of asking, will be in Pod set
The resources requirement of any Pod gathers corresponding target resource demand as the Pod;Each Pod set is successively determined as
Target Pod set, gathers for current goal Pod, when surplus resources meet the target resource demand of target Pod set
When including the first quantity of Pod in the destination number of destination node Node, the no less than target Pod set, for target Pod collection
Each Pod distributes a target Node in conjunction, wherein the target Node of difference Pod distribution is different;And it is distributed according to for each Pod
Target Node, each Pod is deployed to corresponding target Node.Due in the embodiment of the present invention, according to current dispatching cycle
The identical Pod of resources requirement is divided into same Pod set by the resources requirement of interior each Pod to be scheduled, and will be every
A Pod set is successively determined as target Pod set, meets the target resource demand of target Pod set in surplus resources
When including the first quantity of Pod in the destination number of destination node Node, the no less than target Pod set, for target Pod collection
Each Pod distributes a target Node in conjunction, realizes the Parallel Scheduling of Pod identical to multiple resources requirements, avoids
The primary all Node of traversal are required to for each Pod, satisfactory Node are selected by pre-selection strategy, and by preferred
Strategy is the process that the satisfactory Node selected carries out marking sequence, avoids and computes repeatedly, saved memory space, mentions
High Pod dispatching efficiency, has saved resource.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with
It obtains other drawings based on these drawings.
Fig. 1 is a kind of scheduling of resource process schematic provided in an embodiment of the present invention;
Fig. 2 is a kind of resource allocation process schematic diagram provided in an embodiment of the present invention;
Fig. 3 is a kind of scheduling of resource effect diagram provided in an embodiment of the present invention;
Fig. 4 is a kind of Pod creation provided in an embodiment of the present invention and scheduling of resource process schematic;
Fig. 5 is a kind of resource scheduling device structural schematic diagram provided in an embodiment of the present invention;
Fig. 6 is a kind of electronic equipment schematic diagram provided in an embodiment of the present invention;
Fig. 7 is a kind of electronic equipment schematic diagram provided in an embodiment of the present invention.
Specific embodiment
To make the objectives, technical solutions, and advantages of the present invention clearer, the set attached drawing present invention is made into one below
Step ground detailed description, it is clear that described embodiment is only a part of the embodiments of the present invention, rather than whole implementation
Example.Based on the embodiments of the present invention, obtained by those of ordinary skill in the art without making creative efforts
Every other embodiment, shall fall within the protection scope of the present invention.
Resource regulating method provided in an embodiment of the present invention can be applied in kubernetes server or kubernetes
Server cluster.Include following functions component in kubernetes server or kubernetes server cluster: service connects
Creation that mouth (apiServer) is used to be assigned according to user instructs, and creates Pod to be scheduled;Scheduler is responsible for wait dispatch
Pod distribute a Node;It is Pod to be scheduled distribution that service discovery storage repository (etcd), which is used to store Scheduler,
The identification information of Node;Node wherein includes agency's (kubelet) process and application container engine (docker) in Node, uses
In the identification information for being retrieved as the Pod to be scheduled that the Node is distributed from etcd by kubelet process, will be distributed for the Node
Pod to be scheduled be deployed in docker and run, complete the deployment to Pod to be scheduled.
However, for each Pode to be scheduled, it is all to be required to traversal in the prior art when carrying out scheduling of resource
Node, satisfactory Node is filtered out by specific Predicates, and conform to what Predicates was filtered out
On the basis of the Node asked, according to specific Priorites it is that satisfactory Node carries out marking sequence, and by score value highest
Node as the Node for disposing Pod to be scheduled.Wherein, Predicates strategy includes: in the prior art
NoDiskConflict: it checks on this host with the presence or absence of volume conflict.If this host carry volume,
Other to be equally dispatched on this host using this Pod rolled up, different storage rear end specific rules are different;
NoVolumeZoneConflict: under the premise of checking given area (zone) limitation, if checked on this host
Pod is disposed with the presence or absence of volume conflict;
PodToleratesNodeTaints: ensure the taints that the tolerates that Pod is defined can receive node to define;
CheckNodeMemoryPressure: check whether Pod can be dispatched to it has been reported that host memory pressure mistake
Big node;
CheckNodeDiskPressure: check whether Pod can be dispatched to the storage pressure mistake it has been reported that host
Big node;
MaxEBSVolumeCount: ensure that the EBS storage volume of carry is no more than the maximum value of setting, default 39;
MaxGCEPDVolumeCount: ensure that the GCE storage volume of carry is no more than the maximum value of setting, default 16;
MaxAzureDiskVolumeCount: ensure that the Azure storage volume of carry is no more than the maximum value of setting, write from memory
Recognize 16;
MatchInterPodAffinity: check whether Pod and other Pod meet compatibility rule;
GeneralPredicates: check whether Pod matches with kubernetes associated component on host;
NoVolumeNodeConflict: it under the premise of checking given Node limitation, is disposed on this host if checked
Pod is with the presence or absence of volume conflict.
Priorites includes:
LeastRequestedPriority: the CPU and interior there are the percentages of present node available resources that Pod needs are calculated
Than the node with minimum percent is exactly optimal;
BalancedResourceAllocation: it is most that every resource (CPU, memory) utilization rate is most balanced on node
It is excellent;
SelectorSpreadPriority: least by being distributed on Service and Replicaset ownership calculating Node
Similar Pod quantity, score calculate: quantity is fewer, and score is higher;
NodeAffinityPriority: node compatibility selection strategy provides two kinds of selectors and supports:
RequiredDuringSchedulingIgnoredDuringExecution (guarantees that selected host must satisfy all Pod
To host rule require), (scheduler can use up preferresDuringSchedulingIgnoredDuringExecution
It measures but does not guarantee to meet being required for NodeSelector);
TaintTolerationPriority: similar in Predicates strategy
PodToleratesNodeTaints, priority scheduling to the node that Taint is marked;
InterPodAffinityPriority:Pod compatibility selection strategy, similar NodeAffinityPriority,
Two kinds of selectors are provided to support: requiredDuringSchedulingIgnoredDuringExecution (selected by guaranteeing
Host must satisfy all Pod and require the rule of host),
(scheduler as far as possible but can not guarantee to meet preferresDuringSchedulingIgnoredDuringExecution
NodeSelector's is required), and two substrategies: PodAffinity and PodAntiAffinity are provided.
It is intended to improve in existing resource scheduling process for the Pod to be scheduled process for distributing Node in the application,
By being disposed parallel to the identical Pod to be dispatched of resources requirement, change under existing resource scheduling, for each wait dispatch
Pod be required to traverse primary all Node by pre-selection strategy, and need to select pre-selection strategy by preference policy
The Node for meeting pre-selection strategy requirement carries out the mode for the Node that traversal marking is selected as Node to be scheduled distribution, to mention
Deployment efficiency of the height to Pod.Specifically scheduling of resource process is with kubernetes server cluster in the following embodiments
Example is specifically described.
Embodiment 1:
Fig. 1 is a kind of scheduling of resource process schematic provided in an embodiment of the present invention, which includes:
S101: each of generation Pod to be scheduled in current dispatching cycle is obtained, according to the money of each Pod to be scheduled
The identical Pod of resources requirement is divided into same Pod set, and gathers for each Pod by source demand, by the Pod collection
The resources requirement of any Pod gathers corresponding target resource demand as the Pod in conjunction.
Scheduler in kubernetes server cluster periodically obtains the to be scheduled of apiService generation
Pod, and for each of generation Pod to be scheduled in current dispatching cycle, identify the resource requirement of each Pod to be scheduled
The identical Pod of resources requirement is divided into same Pod set, and gathers for each Pod by amount, will appoint in Pod set
The resources requirement of one Pod gathers corresponding target resource demand as the Pod.In embodiments of the present invention, the scheduling
Period can preset, and can be 10 seconds, 30 seconds, 50 seconds etc..
Such as: current dispatching cycle there are Pod to be scheduled include: Pod1, Pod2 ..., Pod10, according to each wait adjust
The identical Pod to be scheduled of resources requirement can be divided into same Pod collection by the resources requirement of the Pod of degree, Scheduler
In conjunction, obtained Pod set, including P1={ Pod1, Pod2, Pod3 }, P2={ Pod4, Pod5, Pod6, Pod8 }, P3=
{ Pod7, Pod9, Pod10 }, wherein the corresponding resources requirement of each Pod for including in each Pod set (Pi) is identical.
S102: being successively determined as target Pod set for each Pod set, gather for current goal Pod, when residue provides
Source meets the destination number of the destination node Node of the target resource demand of target Pod set, no less than target Pod collection
When in conjunction including the first quantity of Pod, a target Node is distributed for each Pod in target Pod set, wherein difference Pod
The target Node of distribution is different, i.e., each target Node is only assigned primary for each target Pod set;And according to being each
The target Node of Pod distribution, is deployed to corresponding target Node for each Pod.
After the Pod deployment in each Pod set, the Pod in the set can occupy the resource of Node, in order to avoid right
The resource of same Node is duplicatedly distributed, and when the embodiment of the present invention carries out scheduling of resource, is serially located for each Pod set
Reason after having disposed the Pod in a Pod set, can just start the Pod in the next Pod set of deployment one, until current scheduling
The Pod in all Pod set in period, which is disposed, to be completed.It is still illustrated by taking above-mentioned Pod set P1, P2, P3 as an example, in this hair
In bright embodiment, after completing to the deployment of Pod1, Pod2, Pod3 in P1, Pod4, Pod5, Pod6, Pod8 in P2 are disposed,
Finally dispose Pod7, Pod9, Pod10 in P3;It of courses the Pod7, Pod9 that can also first dispose in P3, Pod10, dispose again
Pod4, Pod5, Pod6, Pod8 in P2 finally dispose Pod1, Pod2, Pod3 in P1.In embodiments of the present invention not to portion
The sequencing of administration's Pod set is defined, as long as the deployment of Pod set meets serial order.
Each Pod set is successively determined as target Pod set by the Scheduler in kubernetes server cluster,
Gather for current goal Pod, according to the target resource demand that current goal Pod gathers, filters out kubernetes service
In device cluster surplus resources be greater than or more than or equal to current goal Pod set target resource demand target Node, work as sieve
It is current goal when the destination number of the target Node selected is no less than the first quantity in current goal Pod set comprising Pod
Each Pod distributes a target Node in Pod set, meanwhile, in order to avoid the same target Node filtered out is distributed to two
A or more than two Pod to be scheduled, the resource for causing the surplus resources of target Node to be unable to satisfy Pod to be scheduled need
The problem of amount of asking, in embodiments of the present invention, each target Node, are only assigned primary for each target Pod set.
Scheduler is according to the target Node distributed for each Pod, by the mark of the target Node distributed for each Pod
Information is written in nodename (NameNode) attribute of Pod, and is recorded in etcd, in kubernetes server cluster
Node gets the corresponding Pod of the Node by kubelet process from etcd, should by the docker operation of the Node
Pod completes the deployment to Pod.
In embodiments of the present invention, the target resource demand that can be gathered according to current goal Pod, uses
Predicates filters out the target Node that surplus resources meet target resource demand, specifically, in the present invention is implemented, sieve
Selecting surplus resources to meet the target Node of target resource demand is the prior art, is not being repeated.
Due to according to the resources requirement of Pod to be scheduled each in current dispatching cycle, will provide in the embodiment of the present invention
Demand identical Pod in source is divided into same Pod set, and each Pod set is successively determined as target Pod set,
Surplus resources meet the destination number of the destination node Node of the target resource demand of target Pod set, the no less than mesh
When marking the first quantity in Pod set comprising Pod, a target Node is distributed for each Pod in target Pod set, is realized
The Parallel Scheduling of Pod identical to multiple resources requirements, avoids that be required to traversal for each Pod primary all
Node selects satisfactory Node by pre-selection strategy, and is that the satisfactory Node selected is carried out by preference policy
The process of marking sequence, avoids and computes repeatedly, saved memory space, improve Pod dispatching efficiency, saved resource.
Embodiment 2:
In order to guarantee each Pod to be scheduled, it can be deployed to the resources requirement that a surplus resources meet the Pod
Node, on the basis of the above embodiments, in embodiments of the present invention, it is described for current goal Pod gather, when residue provide
Source meet the target Pod set target resource demand target Node destination number, the no less than target Pod set in
When the first quantity comprising Pod, distributing a target Node for each Pod in target Pod set includes:
Gather for current goal Pod, judges that current residual resource meets the target resource demand of target Pod set
Target Node the second quantity whether be no less than the target Pod set in include Pod the first quantity;
If so, distributing a target Node for each Pod in target Pod set;If not, by target Pod collection
Each Pod in conjunction is hung up, until the third quantity of target Node is no less than in target Pod set the first number comprising Pod
Amount distributes a target Node for each Pod in target Pod set.
Specifically, the Scheduler in kubernetes server cluster, judge in kubernetes server cluster when
Preceding surplus resources meet the second quantity of the target Node of the target resource demand of target Pod set, if no less than mesh
Mark the first quantity comprising Pod in Pod set;If it is, explanation is currently able to satisfy as each Pod in target Pod set
A different target Node is distributed, distributes a target Node for each Pod in target Pod set;If it is not, then explanation
It is not able to satisfy currently and distributes a different target Node for each Pod in target Pod set, it will be in target Pod set
Each Pod hang up, Scheduler continue identify kubernetes server cluster in is able to satisfy the target Pod set mesh
The third quantity of the target Node of resources requirement is marked, until the third quantity of target Node is no less than in target Pod set
The first quantity comprising Pod distributes a target Node for each Pod in target Pod set.
Embodiment 3:
The effect of networking is carried out to improve kubernetes server cluster according to the IP subnet address of the corresponding Node of Pod
Rate, it is in embodiments of the present invention, described to include: for one target Node of each Pod distribution in target Pod set
According to the unassigned IP subnet address of each target Node, one is distributed for each Pod in target Pod set
The unassigned IP subnet address of target Node.
The IP subnet address that target Node is Pod distribution is labeled as having distributed.
Scheduler in kubernetes server cluster gathers for current goal Pod, passes through kubernetes
Web services component (Flannel) in server cluster obtains the unassigned IP subnet address of each target Node, for this
Each Pod distributes the unassigned IP subnet address of a target Node in target Pod set, wherein for target Pod collection
The unassigned IP subnet address that Pod is distributed in conjunction adheres to different target Node separately, and for each in target Pod set
Pod makees the identification information of the unassigned IP subnet address of the target Node distributed for the Pod, corresponding target Node
For the NameNode attribute of the Pod, the NameNode attribute of the Pod and corresponding IP subnet address are written into etcd, and by mesh
Mark Node is that the IP subnet address of Pod distribution is labeled as having distributed.
It is still combined into P1={ Pod1, Pod2, Pod3 } with target Pod collection to be illustrated, it is raw that Scheduler starts Flannel
At the routing table of all Node in kubernetes server cluster, wherein owning in the kubernetes server cluster generated
The routing table of Node, as shown in table 1:
NodeID | NodeIP | NodeSubNetIP | Flag |
1 | 192.168.1.1 | 10.0.1.10 | 0 |
1 | 192.168.1.1 | 10.0.1.20 | 1 |
2 | 192.168.1.2 | 10.0.1.30 | 0 |
2 | 192.168.1.2 | 10.0.1.40 | 0 |
3 | 192.168.1.3 | 10.0.1.60 | 0 |
4 | 192.168.1.4 | 10.0.1.70 | 1 |
4 | 192.168.1.4 | 10.0.1.80 | 0 |
5 | 192.168.1.5 | 10.0.1.90 | 0 |
5 | 192.168.1.5 | 10.0.1.100 | 0 |
6 | 192.168.1.6 | 10.0.1.110 | 0 |
6 | 192.168.1.6 | 10.0.1.120 | 1 |
7 | 192.168.1.7 | 10.0.1.130 | 0 |
Table 1
As shown in table 1, wherein NodeID indicate the identification information of Node, NodeIP indicate Node IP,
NodeSubNetIP indicates the subnet IP of Node, and wherein Flag is the mark of the subnet IP of Node, and wherein Flag is 1 mark Node
Subnet IP be assigned, Flag be 0 mark Node subnet IP it is unassigned, in table 1 there are Node1, Node2, Node3,
The information whether IP of Node4, Node5, Node6, Node7, corresponding subnet IP and corresponding subnet IP are assigned.
The target resource demand that Scheduler gathers according to current goal Pod filters out surplus resources and meets the target
The Node of resources requirement, wherein the destination number of the Node filtered out be 5, comprising: Node1, Node2, Node5, Node6,
The quantity of Node7, the Node filtered out are greater than the quantity of the Pod in P1 included, generate only comprising the sub- road of the Node filtered out
By table, only the sub-route table of the Node comprising filtering out is as shown in table 2:
NodeID | NodeIP | NodeSubNetIP | Flag |
1 | 192.168.1.1 | 10.0.1.10 | 0 |
1 | 192.168.1.1 | 10.0.1.20 | 1 |
2 | 192.168.1.2 | 10.0.1.30 | 0 |
2 | 192.168.1.2 | 10.0.1.40 | 0 |
5 | 192.168.1.5 | 10.0.1.90 | 0 |
5 | 192.168.1.5 | 10.0.1.100 | 0 |
6 | 192.168.1.6 | 10.0.1.110 | 0 |
6 | 192.168.1.6 | 10.0.1.120 | 1 |
7 | 192.168.1.7 | 10.0.1.130 | 0 |
Table 2
As shown in table 2, relative to table 1, the target resource demand that surplus resources meet target Pod set is only existed in table 2
Whether the information of the Node of amount, IP, subnet IP and subnet IP including Node1, Node2, Node5, Node6, Node7 are assigned
Information.Scheduler can be unassigned according to Node each in table 2 IP subnet address, be each Pod distribution one in P1
Node unassigned IP subnet address in a table 2, wherein being adhered to separately not for the unassigned IP subnet address distributed of Pod in P1
Same Node.Such as: the subnet address 10.0.1.10 for the Node that a NodeID is 1 is distributed for Pod1, distributes one for Pod2
The subnet address 10.0.1.30 for the Node that NodeID is 2 is the subnet address that Pod3 distributes the Node that a NodeID is 7
10.0.1.130。
After distributing a subnet address for Pod each in P1, Scheduler is by the routing of Node all in server cluster
The IP subnet address that target Node is Pod distribution is labeled as having distributed in table.The routing table of updated all Node, such as table
Shown in 3:
Table 3
As shown in table 3, relative to table 1, by the subnet address of the NodeID distributed for Pod1 the Node for being 1 in table 3
10.0.1.10, be Pod2 distribution NodeID be 2 Node subnet address 10.0.1.30, be Pod3 distribution NodeID be
The subnet address 10.0.1.130, corresponding Flag of 7 Node is updated to 1 by 0, indicate IP subnet address 10.0.1.10,
10.0.1.30,10.0.1.130 has been assigned.
Fig. 2 is a kind of resource allocation process schematic diagram provided in an embodiment of the present invention, which includes: to start, step 1,
Scheduler obtains each of generation Pod to be scheduled in current dispatching cycle by inquiry etcd, while starting Flannel;
Step 2: according to the resources requirement of each Pod to be scheduled, the identical Pod of resources requirement being divided into same Pod and is gathered
In, such as multiple Pod set of division is respectively P1, P2, P3 ...;The kubernetes generated after Flannel is started simultaneously
In server cluster in the routing table write-in etcd of each node;Step 3: judging that the corresponding Pod set (Pi) of current period is
No is empty (Null), that is, judges whether also to deposit unassigned Pod set, if it is, otherwise carrying out step 4 then terminates;
Step 4: arbitrarily choosing a Pod set from unassigned Pode set (Pi) and gather as target Pod, and by selection
Target Pod set is deleted from the corresponding Pod set of current period, according to existing pre-selection strategy, is selected surplus resources and is met
Target collection surplus resources demand Node, composition Node set (Ni);Step 5: from the Node for including in reading Ni in etcd
Routing table information, composition routing sublist (Ri);Step 6: from the quantity chosen in Ri with the Pod for including in target Pod set
The IP subnet address of identical Node, wherein the IP subnet address of each Node chosen adheres to different Node separately, it is target Pod
Each Pod distributes the IP subnet address of a different Node in set, and the IP subnet address of assigned Node is existed
Flag in etcd is updated to 1;Step 7: for each Pode in target Pod set, the NameNode attribute of the Pod being added
For the identification information of the corresponding Node of IP subnet address of a Node distributed for the Pod, and after the addition was complete, return step
4。
Fig. 3 is a kind of scheduling of resource effect diagram provided in an embodiment of the present invention;As shown in figure 3, current dispatching cycle
Interior presence is replicated the Pod that (relication) is 3 parts, uses Pod1, Pod2 and Pod3 table respectively because meeting user demand
Show, because Pod1, Pod2 and Pod3 are substantially identical, it is therefore desirable to stock number it is also identical, pass through the scheduling of resource side of the application
Method, Pod1, Pod2 and Pod3 are same because the stock number scheduled device (Scheduler) of needs is divided into same Pod set
Each Pod in Pod set distributes a different Node, is Pod1 distribution Node1, is Pod2 distribution Node2, is Pod3 points
With Node7.Node knows the allocation result of Scheduler by Kuberlet process, runs Pod1, in Node2 fortune in Node1
Row Pod2, it is kept away in Node7 operation Pod3 it follows that will be replicated Pod in the application can be dispensed in different Node
Having exempted from the Pod that will be replicated, all distribution, when the Node breaks down, leads to the Pod being replicated not in a Node
The case where service can be provided.
Embodiment 4:
In order to avoid the quantity of Pod in a Pod set is excessive, scheduling of resource efficiency is influenced, in the above embodiments,
The identical Pod of resources requirement is divided into same Pod set by the resources requirement according to each Pod to be scheduled
Include:
According to the resources requirement of each Pod to be scheduled and corresponding service service object, by resources requirement phase
Together and the identical Pod of corresponding service object is divided into same Pod set.
Fig. 4 is a kind of Pod creation provided in an embodiment of the present invention and scheduling of resource process schematic;As shown in figure 4,
The component for including in kubernetes server cluster includes: command-line tool (kubecfg), apiServer, etcd, management
Control centre (Controller_manager), Scheduler, kubelet, docker, specifically, 1. user (user) to
Kubecfg submits creation service object requests;2. the request for creating service object is sent to by kubecfg
apiServer;3. apiServer creation service object is simultaneously stored in etcd;4. controller_manager is periodical
To apiServer obtain server object;5. after controller_manager obtains the success of server object, to
ApiServer initiates creation Pod request;6. Pod is created after apiServer respond request, for the label of the Pod of creation
(label), label=service attribute is added, and is stored in etcd, wherein the Pod of apiServer creation, as wait adjust
The Pod of degree;7. Scheduler periodically acquires Pod to be scheduled;8. according to the resources requirement of each Pod to be scheduled and
The identical Pod of the identical and corresponding service object of resources requirement is divided into same Pod by corresponding service service object
In set, each Pod set is successively determined as target Pod set, is gathered for current goal Pod, when surplus resources meet
The target Pod set target resource demand destination node Node destination number, the no less than target Pod set in wrap
When the first quantity containing Pod, a target Node is distributed for each Pod in target Pod set;9. and will be each Pod points
The identification information of the target Node matched is filled in into the attribute of the NameNode of Pod;10. apiServer will add for each Pod
NameNode attribute write-in etcd in;Kubelet process periodically check Pods deployment information;Hair
After existing NameNode is itself corresponding Pod, which is deployed in local docker.
Embodiment 5:
Fig. 5 is a kind of resource scheduling device structural schematic diagram provided in an embodiment of the present invention, which includes:
Module 51 is obtained, container group Pod to be scheduled each of is generated in current dispatching cycle for obtaining, according to each
The identical Pod of resources requirement is divided into same Pod set by the resources requirement of Pod to be scheduled, and for each
The resources requirement of any Pod in Pod set is gathered corresponding target resource demand as the Pod by Pod set;
Scheduler module 52, for each Pod set to be successively determined as target Pod set, for current goal Pod collection
Close, when surplus resources meet the target Pod set target resource demand destination node Node destination number, no less than
When including the first quantity of Pod in target Pod set, a target Node is distributed for each Pod in target Pod set,
Wherein the target Node of difference Pod distribution is different;And according to the target Node distributed for each Pod, each Pod is deployed to pair
The target Node answered.
The scheduler module 52 is specifically used for gathering for current goal Pod, judges that current residual resource meets the target
Whether the second quantity of the target Node of the target resource demand of Pod set is no less than in target Pod set comprising Pod
First quantity;If so, distributing a target Node for each Pod in target Pod set;If not, by target Pod collection
Each Pod in conjunction is hung up, until the third quantity of target Node is no less than in target Pod set the first number comprising Pod
Amount distributes a target Node for each Pod in target Pod set.
The scheduler module 52, specifically for the IP subnet address unassigned according to each target Node, for the target
Each Pod distributes the unassigned IP subnet address of a target Node in Pod set.
The scheduler module 52 is also used to be that the IP subnet address that Pod is distributed is labeled as having distributed by target Node.
The acquisition module 51, specifically for according to each Pod to be scheduled resources requirement and corresponding service
The identical Pod of the identical and corresponding service object of resources requirement is divided into same Pod set by service object.
Embodiment 6:
Based on the same inventive concept, a kind of electronic equipment is additionally provided in the embodiment of the present invention, due to above-mentioned electronic equipment
The principle solved the problems, such as is similar to resource regulating method, therefore the implementation of above-mentioned electronic equipment may refer to the implementation of method, weight
Multiple place repeats no more.
As shown in fig. 6, it is the structural schematic diagram of electronic equipment provided in an embodiment of the present invention, wherein in Fig. 6, bus
Framework may include the bus and bridge of any number of interconnection, 61 He of one or more processors for specifically having processor 61 to represent
The various circuits for the memory 62 that memory 62 represents link together.Bus architecture can also will such as peripheral equipment, pressure stabilizing
Various other circuits of device and management circuit or the like link together, and these are all it is known in the art, therefore, this
Text is no longer described further it.Bus interface provides interface.Processor 61 is responsible for management bus architecture and common place
Reason, memory 62 can store the used data when executing operation of processor 61.
In electronic equipment provided in an embodiment of the present invention:
The processor 61 executes following process: obtaining in current dispatching cycle for reading the program in memory 62
Generate each of container group Pod to be scheduled, it is according to the resources requirement of each Pod to be scheduled, resources requirement is identical
Pod be divided into same Pod set, and gather for each Pod, the resources requirement of any Pod in Pod set made
Gather corresponding target resource demand for the Pod;Each Pod set is successively determined as target Pod set, for current mesh
Pod set is marked, when surplus resources meet the number of targets of the destination node Node of the target resource demand of target Pod set
It measures, when including the first quantity of Pod in no less than target Pod set, distributes one for each Pod in target Pod set
Target Node, wherein the target Node of difference Pod distribution is different;It, will be each and according to the target Node distributed for each Pod
Pod is deployed to corresponding target Node.
Preferably, the processor 61 is specifically used for gathering for current goal Pod, judges that current residual resource meets
Whether the second quantity of the target Node of the target resource demand of target Pod set, which is no less than in target Pod set, is wrapped
The first quantity containing Pod;If so, distributing a target Node for each Pod in target Pod set;If not, by the mesh
The each Pod marked in Pod set is hung up, until the third quantity of target Node is no less than in target Pod set comprising Pod
First quantity distributes a target Node for each Pod in target Pod set.
Preferably, the processor 61, specifically for the IP subnet address unassigned according to each target Node, for this
Each Pod distributes the unassigned IP subnet address of a target Node in target Pod set.
Preferably, the processor 61 is also used to be that the IP subnet address that Pod is distributed is labeled as having divided by target Node
Match.
Preferably, the processor 61, specifically for the resources requirement and corresponding clothes according to each Pod to be scheduled
The identical Pod of the identical and corresponding service object of resources requirement is divided into same Pod set by business service object.
Embodiment 7:
On the basis of the various embodiments described above, the embodiment of the invention also provides a kind of electronic equipment, as shown in fig. 7, packet
It includes: processor 71, communication interface 72, memory 73 and communication bus 74, wherein processor 71, communication interface 72, memory 73
Mutual communication is completed by communication bus 74;
It is stored with computer program in the memory 73, when described program is executed by the processor 71, so that institute
It states processor 71 and executes following steps:
Each of generation container group Pod to be scheduled in current dispatching cycle is obtained, according to the money of each Pod to be scheduled
The identical Pod of resources requirement is divided into same Pod set, and gathers for each Pod by source demand, by the Pod collection
The resources requirement of any Pod gathers corresponding target resource demand as the Pod in conjunction;
Each Pod set is successively determined as target Pod set, is gathered for current goal Pod, when surplus resources meet
The target Pod set target resource demand destination node Node destination number, the no less than target Pod set in wrap
When the first quantity containing Pod, a target Node is distributed for each Pod in target Pod set, wherein what difference Pod was distributed
Target Node is different;And according to the target Node distributed for each Pod, each Pod is deployed to corresponding target Node.
Embodiment 8:
On the basis of the various embodiments described above, the embodiment of the invention also provides a kind of computers to store readable storage medium
Matter is stored with the computer program that can be executed by electronic equipment in the computer readable storage medium, when described program is in institute
It states when being run on electronic equipment, so that the electronic equipment realizes following steps when executing:
Each of generation container group Pod to be scheduled in current dispatching cycle is obtained, according to the money of each Pod to be scheduled
The identical Pod of resources requirement is divided into same Pod set, and gathers for each Pod by source demand, by the Pod collection
The resources requirement of any Pod gathers corresponding target resource demand as the Pod in conjunction;
Each Pod set is successively determined as target Pod set, is gathered for current goal Pod, when surplus resources meet
The target Pod set target resource demand destination node Node destination number, the no less than target Pod set in wrap
When the first quantity containing Pod, a target Node is distributed for each Pod in target Pod set, wherein what difference Pod was distributed
Target Node is different;And according to the target Node distributed for each Pod, each Pod is deployed to corresponding target Node.
The embodiment of the invention discloses a kind of resource regulating method, device, electronic equipment, storage medium, the method packets
It includes: each of generation container group Pod to be scheduled in current dispatching cycle is obtained, according to the resource need of each Pod to be scheduled
The identical Pod of resources requirement is divided into same Pod set, and gathers for each Pod by the amount of asking, will be in Pod set
The resources requirement of any Pod gathers corresponding target resource demand as the Pod;Each Pod set is successively determined as
Target Pod set, gathers for current goal Pod, when surplus resources meet the target resource demand of target Pod set
When including the first quantity of Pod in the destination number of destination node Node, the no less than target Pod set, for target Pod collection
Each Pod distributes a target Node in conjunction, wherein the target Node of difference Pod distribution is different;And it is distributed according to for each Pod
Target Node, each Pod is deployed to corresponding target Node.Due in the embodiment of the present invention, according to current dispatching cycle
The identical Pod of resources requirement is divided into same Pod set by the resources requirement of interior each Pod to be scheduled, and will be every
A Pod set is successively determined as target Pod set, meets the target resource demand of target Pod set in surplus resources
When including the first quantity of Pod in the destination number of destination node Node, the no less than target Pod set, for target Pod collection
Each Pod distributes a target Node in conjunction, realizes the Parallel Scheduling of Pod identical to multiple resources requirements, avoids
The primary all Node of traversal are required to for each Pod, satisfactory Node are selected by pre-selection strategy, and by preferred
Strategy is the process that the satisfactory Node selected carries out marking sequence, avoids and computes repeatedly, saved memory space, mentions
High Pod dispatching efficiency, has saved resource.
For systems/devices embodiment, since it is substantially similar to the method embodiment, so the comparison of description is simple
Single, the relevent part can refer to the partial explaination of embodiments of method.
It should be understood by those skilled in the art that, embodiments herein can provide as method, system or computer program
Product.Therefore, the reality in terms of complete hardware embodiment, complete software embodiment or set software and hardware can be used in the application
Apply the form of example.Moreover, it wherein includes the computer of computer usable program code that the application, which can be used in one or more,
The computer program implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) produces
The form of product.
The application is referring to method, the process of equipment (system) and computer program product according to the embodiment of the present application
Figure and/or block diagram describe.It should be understood that every one stream in flowchart and/or the block diagram can be realized by computer program instructions
The set of process and/or box in journey and/or box and flowchart and/or the block diagram.It can provide these computer programs
Instruct the processor of general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce
A raw machine, so that being generated by the instruction that computer or the processor of other programmable data processing devices execute for real
The device for the function of being specified in present one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates,
Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or
The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting
Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or
The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one
The step of function of being specified in a box or multiple boxes.
Although the preferred embodiment of the application has been described, it is created once a person skilled in the art knows basic
Property concept, then additional changes and modifications can be made to these embodiments.So it includes excellent that the following claims are intended to be interpreted as
It selects embodiment and falls into all change and modification of the application range.
Obviously, various changes and modifications can be made to the invention without departing from essence of the invention by those skilled in the art
Mind and range.In this way, if these modifications and changes of the present invention belongs to the range of the claims in the present invention and its equivalent technologies
Within, then the present invention is also intended to include these modifications and variations.
Claims (13)
1. a kind of resource regulating method, which is characterized in that the described method includes:
Each of generation container group Pod to be scheduled in current dispatching cycle is obtained, according to the resource need of each Pod to be scheduled
The identical Pod of resources requirement is divided into same Pod set, and gathers for each Pod by the amount of asking, will be in Pod set
The resources requirement of any Pod gathers corresponding target resource demand as the Pod;
Each Pod set is successively determined as target Pod set, is gathered for current goal Pod, when surplus resources meet the mesh
The destination number of the destination node Node of the target resource demand of Pod set is marked, includes in no less than target Pod set
When the first quantity of Pod, a target Node is distributed for each Pod in target Pod set, wherein the mesh of difference Pod distribution
It is different to mark Node;And according to the target Node distributed for each Pod, each Pod is deployed to corresponding target Node.
2. the method as described in claim 1, which is characterized in that it is described to gather for current goal Pod, when surplus resources meet
The target Pod set target resource demand target Node destination number, the no less than target Pod set in include
When the first quantity of Pod, distributing a target Node for each Pod in target Pod set includes:
Gather for current goal Pod, judges that current residual resource meets the mesh of the target resource demand of target Pod set
Whether the second quantity for marking Node is no less than the first quantity comprising Pod in target Pod set;
If so, distributing a target Node for each Pod in target Pod set;If not, by target Pod set
Each Pod hang up, until target Node third quantity be no less than the target Pod set in include Pod the first quantity, be
Each Pod distributes a target Node in target Pod set.
3. the method as described in claim 1, which is characterized in that described to distribute a mesh for each Pod in target Pod set
Marking Node includes:
According to the unassigned IP subnet address of each target Node, a target is distributed for each Pod in target Pod set
The unassigned IP subnet address of Node.
4. method as claimed in claim 3, which is characterized in that distribute unassigned IP of a target Node for Pod
After net address, the method also includes:
The IP subnet address that target Node is Pod distribution is labeled as having distributed.
5. the method as described in claim 1, which is characterized in that according to the resources requirement of each Pod to be scheduled, by resource
The identical Pod of demand is divided into same Pod set
According to the resources requirement of each Pod to be scheduled and corresponding service service object, by resources requirement it is identical and
The identical Pod of service object is corresponded to be divided into same Pod set.
6. a kind of resource scheduling device, which is characterized in that described device includes:
Module is obtained, container group Pod to be scheduled each of is generated in current dispatching cycle for obtaining, according to each wait dispatch
Pod resources requirement, the identical Pod of resources requirement is divided into same Pod set, and is gathered for each Pod,
The resources requirement of any Pod in Pod set is gathered into corresponding target resource demand as the Pod;
Scheduler module is gathered, when surplus for each Pod set to be successively determined as target Pod set for current goal Pod
Remaining resource meets the destination number of the destination node Node of the target resource demand of target Pod set, the no less than target
When including the first quantity of Pod in Pod set, a target Node is distributed for each Pod in target Pod set, wherein not
It is different with the target Node of Pod distribution;And according to the target Node distributed for each Pod, each Pod is deployed to corresponding mesh
Mark Node.
7. a kind of electronic equipment, which is characterized in that including memory and processor;
The processor executes following process: obtaining the every of the interior generation of current dispatching cycle for reading the program in memory
A container group Pod to be scheduled divides the identical Pod of resources requirement according to the resources requirement of each Pod to be scheduled
Gather into same Pod set, and for each Pod, using the resources requirement of any Pod in Pod set as the Pod collection
Close corresponding target resource demand;Each Pod set is successively determined as target Pod set, for current goal Pod collection
Close, when surplus resources meet the target Pod set target resource demand destination node Node destination number, no less than
When including the first quantity of Pod in target Pod set, a target Node is distributed for each Pod in target Pod set,
Wherein the target Node of difference Pod distribution is different;And according to the target Node distributed for each Pod, each Pod is deployed to pair
The target Node answered.
8. electronic equipment as claimed in claim 7, which is characterized in that the processor is specifically used for being directed to current goal Pod
Set judges that current residual resource meets the second quantity of target Node of the target resource demand of target Pod set and is
It include the first quantity of Pod in no no less than target Pod set;If so, for Pod distribution each in target Pod set
One target Node;If not, each Pod in target Pod set is hung up, until the third quantity of target Node is many
The first quantity comprising Pod in target Pod set distributes a target Node for each Pod in target Pod set.
9. electronic equipment as claimed in claim 7, which is characterized in that the processor is specifically used for according to each target
Node unassigned IP subnet address distributes the unassigned of a target Node for each Pod in target Pod set
IP subnet address.
10. electronic equipment as claimed in claim 9, which is characterized in that the processor is also used to target Node be Pod
The IP subnet address of distribution is labeled as having distributed.
11. electronic equipment as claimed in claim 7, which is characterized in that the processor, specifically for according to each wait dispatch
Pod resources requirement and corresponding service service object, by resources requirement is identical and corresponding service object phase
Same Pod is divided into same Pod set.
12. a kind of electronic equipment characterized by comprising processor, communication interface, memory and communication bus, wherein place
Device, communication interface are managed, memory completes mutual communication by communication bus;
It is stored with computer program in the memory, when described program is executed by the processor, so that the processor
Perform claim requires the step of any one of 1-5 the method.
13. a kind of computer readable storage medium, which is characterized in that it is stored with the computer journey that can be executed by electronic equipment
Sequence, when described program is run on the electronic equipment, so that the electronic equipment perform claim requires described in any one of 1-5
The step of method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810233345.XA CN110300130B (en) | 2018-03-21 | 2018-03-21 | Resource scheduling method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810233345.XA CN110300130B (en) | 2018-03-21 | 2018-03-21 | Resource scheduling method and device, electronic equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110300130A true CN110300130A (en) | 2019-10-01 |
CN110300130B CN110300130B (en) | 2022-04-29 |
Family
ID=68025291
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810233345.XA Active CN110300130B (en) | 2018-03-21 | 2018-03-21 | Resource scheduling method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110300130B (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111008063A (en) * | 2019-11-15 | 2020-04-14 | 苏州浪潮智能科技有限公司 | User binding scheduling method and system based on docker |
CN111737003A (en) * | 2020-06-24 | 2020-10-02 | 重庆紫光华山智安科技有限公司 | Pod balanced scheduling method and device, main node and storage medium |
CN112035123A (en) * | 2020-08-28 | 2020-12-04 | 北京浪潮数据技术有限公司 | Method for realizing no server based on kubernets platform |
CN112559130A (en) * | 2020-12-16 | 2021-03-26 | 恒生电子股份有限公司 | Container distribution method, device, electronic equipment and storage medium |
CN114090220A (en) * | 2022-01-13 | 2022-02-25 | 南京信息工程大学 | Hierarchical CPU and memory resource scheduling method |
CN114374698A (en) * | 2022-03-22 | 2022-04-19 | 环球数科集团有限公司 | Ingress-based automatic NodePort pool switching system |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101562888A (en) * | 2008-04-18 | 2009-10-21 | 中兴通讯股份有限公司 | Resource allocation method |
US8650299B1 (en) * | 2010-02-03 | 2014-02-11 | Citrix Systems, Inc. | Scalable cloud computing |
CN105700948A (en) * | 2014-11-24 | 2016-06-22 | 阿里巴巴集团控股有限公司 | Method and device for scheduling calculation task in cluster |
CN105988864A (en) * | 2015-02-16 | 2016-10-05 | 阿里巴巴集团控股有限公司 | Recourse allocating method and device |
CN106027643A (en) * | 2016-05-18 | 2016-10-12 | 无锡华云数据技术服务有限公司 | Resource scheduling method based on Kubernetes container cluster management system |
CN106576114A (en) * | 2014-08-08 | 2017-04-19 | 甲骨文国际公司 | Policy based resource management and allocation system |
-
2018
- 2018-03-21 CN CN201810233345.XA patent/CN110300130B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101562888A (en) * | 2008-04-18 | 2009-10-21 | 中兴通讯股份有限公司 | Resource allocation method |
US8650299B1 (en) * | 2010-02-03 | 2014-02-11 | Citrix Systems, Inc. | Scalable cloud computing |
CN106576114A (en) * | 2014-08-08 | 2017-04-19 | 甲骨文国际公司 | Policy based resource management and allocation system |
CN105700948A (en) * | 2014-11-24 | 2016-06-22 | 阿里巴巴集团控股有限公司 | Method and device for scheduling calculation task in cluster |
CN105988864A (en) * | 2015-02-16 | 2016-10-05 | 阿里巴巴集团控股有限公司 | Recourse allocating method and device |
CN106027643A (en) * | 2016-05-18 | 2016-10-12 | 无锡华云数据技术服务有限公司 | Resource scheduling method based on Kubernetes container cluster management system |
Non-Patent Citations (1)
Title |
---|
唐瑞: "基于Kubernetes的容器云平台资源调度策略研究", 《中国优秀硕士学位论文全文数据库(电子期刊) 信息科技辑》 * |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111008063A (en) * | 2019-11-15 | 2020-04-14 | 苏州浪潮智能科技有限公司 | User binding scheduling method and system based on docker |
CN111008063B (en) * | 2019-11-15 | 2022-07-19 | 苏州浪潮智能科技有限公司 | User binding scheduling method and system based on docker |
CN111737003A (en) * | 2020-06-24 | 2020-10-02 | 重庆紫光华山智安科技有限公司 | Pod balanced scheduling method and device, main node and storage medium |
CN112035123A (en) * | 2020-08-28 | 2020-12-04 | 北京浪潮数据技术有限公司 | Method for realizing no server based on kubernets platform |
CN112559130A (en) * | 2020-12-16 | 2021-03-26 | 恒生电子股份有限公司 | Container distribution method, device, electronic equipment and storage medium |
CN112559130B (en) * | 2020-12-16 | 2024-01-19 | 恒生电子股份有限公司 | Container distribution method, device, electronic equipment and storage medium |
CN114090220A (en) * | 2022-01-13 | 2022-02-25 | 南京信息工程大学 | Hierarchical CPU and memory resource scheduling method |
CN114090220B (en) * | 2022-01-13 | 2022-04-29 | 南京信息工程大学 | Hierarchical CPU and memory resource scheduling method |
CN114374698A (en) * | 2022-03-22 | 2022-04-19 | 环球数科集团有限公司 | Ingress-based automatic NodePort pool switching system |
CN114374698B (en) * | 2022-03-22 | 2022-05-17 | 环球数科集团有限公司 | Ingress-based automatic NodePort pool switching system |
Also Published As
Publication number | Publication date |
---|---|
CN110300130B (en) | 2022-04-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110300130A (en) | A kind of resource regulating method, device, electronic equipment and storage medium | |
CN110324164B (en) | Network slice deployment method and device | |
CN106301829B (en) | A kind of method and apparatus of network service dilatation | |
CN103827825B (en) | Virtual resource object component | |
EP2710470B1 (en) | Extensible centralized dynamic resource distribution in a clustered data grid | |
CN106055381B (en) | A kind of method and apparatus creating virtual machine | |
CN108463988A (en) | The network file of load balancing accesses | |
CN103607424B (en) | Server connection method and server system | |
CN103403683A (en) | Capabilities based routing of virtual data center service request | |
CN105933137A (en) | Resource management method, device and system | |
US20220156129A1 (en) | Method and apparatus for scaling a custom resource with custom metrics in a containerized application handling system | |
CN116055283B (en) | Multi-platform unified cloud management system supporting global tenant application resource quota setting | |
CN111506404A (en) | Kubernetes-based shared GPU (graphics processing Unit) scheduling method | |
CN108924244A (en) | Distributed system and flow allocation method and device for the system | |
CN108702316A (en) | A kind of resource allocation methods and device of VNF | |
CN103338252A (en) | Distributed database concurrence storage virtual request mechanism | |
CN109964449A (en) | The Licensing Methods and device of network service lifecycle management | |
CN114500523B (en) | Fixed IP application publishing method based on container cloud platform | |
CN111309440B (en) | Method and equipment for managing and scheduling multiple types of GPUs | |
CN111324435A (en) | Distributed task scheduling and registering method, device and distributed task scheduling system | |
CN107590033A (en) | A kind of methods, devices and systems of establishment DOCKER containers | |
CN108885564A (en) | Resource in network virtualization scene places control | |
RU2013140415A (en) | IMPROVED INVENTORY MANAGEMENT SYSTEM AND METHOD FOR ITS IMPLEMENTATION | |
CN109471725A (en) | Resource allocation methods, device and server | |
CN110288104A (en) | O&M flow system, O&M workflow management 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 |