CN111143059A - Improved Kubernetes resource scheduling method - Google Patents

Improved Kubernetes resource scheduling method Download PDF

Info

Publication number
CN111143059A
CN111143059A CN201911305242.0A CN201911305242A CN111143059A CN 111143059 A CN111143059 A CN 111143059A CN 201911305242 A CN201911305242 A CN 201911305242A CN 111143059 A CN111143059 A CN 111143059A
Authority
CN
China
Prior art keywords
node
score
pod
millicpu
memory
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201911305242.0A
Other languages
Chinese (zh)
Other versions
CN111143059B (en
Inventor
杨晋生
熊衍捷
高镇
李�根
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tianjin University
Original Assignee
Tianjin University
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 Tianjin University filed Critical Tianjin University
Priority to CN201911305242.0A priority Critical patent/CN111143059B/en
Publication of CN111143059A publication Critical patent/CN111143059A/en
Application granted granted Critical
Publication of CN111143059B publication Critical patent/CN111143059B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals

Abstract

The invention relates to a Kubernetes (K8s) operation and maintenance technology, which aims to improve the network service quality and ensure the efficient utilization of resources. The technical scheme adopted by the invention is that the improved Kubernetes resource scheduling method comprises the following steps: 1) the problem that the distribution of the QoS classes is not estimated sufficiently by using a QoS (quality of service) optimized scheduling BalancdQoSPriority improvement platform; 2) and weighting the pre-screening of the pre-selection algorithm Predicate and the preferential Priority screening to achieve the comprehensive realization of two optimization targets. The invention is mainly applied to the occasion of reasonably distributing network resources.

Description

Improved Kubernetes resource scheduling method
Technical Field
The invention relates to a Kubernetes (K8s) operation and maintenance technology, in particular to an improved Kubernetes resource scheduling method.
Background
Cloud Computing (Cloud Computing) integrates Computing resources, storage resources, network resources, data resources, and software resources, transmits Computing services over the internet, and provides a provisioning-on-demand mode of operation. Users can lease different types of resources to meet their computing needs, such as Virtual Machine (VM), Container (Container), dedicated hardware or bare machine resources, etc. The container technology is a lightweight virtualization technology, packages codes and all dependency relationships thereof, and can quickly and reliably migrate application programs in different computing environments without starting any virtual machine.
Kubernetes, K8s for short, is an abbreviation used to replace the 8 characters "ubernet" with 8. The system is an open source and is used for managing containerized applications on a plurality of hosts in a cloud platform, and K8s is an open source container arrangement platform developed by Google company, can arrange containers into a cluster and provides containerized application services which are easy to manage and can be used according to requirements for the outside. The K8s adopts a one-Master-multiple-slave cluster architecture, and uses one Master Node (Master) to manage multiple child nodes (nodes), and the Master Node is the central nerve of cluster management and is an access portal for providing cluster control. The Kubernetes Scheduler is a Scheduler running on a main node, and uses Pod (a combination of one or more containers) as a basic unit to be allocated to a proper child node, and default scheduling algorithms can be divided into two types according to the sequence of start-up phases: and (4) a pre-selection algorithm (Predicate) and a preference algorithm (Priority), wherein the pre-selection algorithm is executed at first, and the size of the disk space, whether enough computing resources are provided, whether the label tolerating the Pod is provided and the like are taken as hard standards to form a potential list of the candidate sub-nodes. The optimal algorithm scores and evaluates and dispatches Pod to the child node with the highest score, and the current optimal algorithm provided by default mainly comprises the following steps: LeastRequestDeriority (least request Algorithm), BalanceAllocation (resource equilibria Allocation Algorithm), ImageLocality (node image score), and the like. The leaserequedpriority uses the CPU and the memory (MEM) of the Pod request as input parameters, and the schedulable child nodes are traversed to respectively subtract the calculation percentages of the parameters from the distributable calculation resources and add the calculation percentages to calculate an average value as a total score. BalanceResourceAllocation emphasizes the balance of resource usage, with closer CPU and memory percentages used, higher scores. And the ImageLocality carries out scoring and sequencing according to whether the mirror image required by the Pod exists in the child node or not and the size of the mirror image. In addition to the scheduling algorithm provided by the default platform, a large number of researchers, enterprises, and the like have proposed resource scheduling algorithms such as a preemptive resource scheduling algorithm, a resource scheduling algorithm based on a neural network, an ARIMA (Autoregressive moving Average Model) Model, and a quality of service-oriented balanced qospririority (quality of service optimization scheduling algorithm) resource scheduling algorithm.
Disclosure of Invention
In order to overcome the problems that in the prior art, although a LeastRequestPriority algorithm provided by Kubernetes by default can distribute Pods to Node nodes with the most abundant computing resources and uniformly distribute work units, the Service Quality reduction possibly caused by the Service Quality due to unbalanced QoS (Quality of Service) levels is not considered, and the existing BalanceQoSPriority only considers balanced QoS levels as much as possible but cannot ensure the efficient utilization of resources. Therefore, the technical scheme adopted by the invention is that the improved Kubernetes resource scheduling method comprises the following steps:
1) the problem that the distribution of the QoS classes is not estimated sufficiently by using a QoS (quality of service) optimized scheduling BalancdQoSPriority improvement platform;
2) and weighting the pre-screening of the pre-selection algorithm Predicate and the preferential Priority screening to achieve the comprehensive realization of two optimization targets.
The method comprises the following specific steps:
step 1: reading a pre-screening list of the Predicate, and taking a combined Pod of the child Node and one or more containers to be scheduled as the input of the improved scheduling method;
the Kubernetes resource scheduling algorithm is divided into two flows of Predicate pre-screening and Priority screening, a Node which is potentially schedulable is obtained by reading a pre-screening list of the Predicate, a pre-scheduled Pod is used as the input of an improved resource scheduling method, a QoS type qosClass field of the Pod, a requested processor quantity requested.
Step 2: and scoring and sequencing LeastRequestedpriority to obtain the NodeiCorresponding score Li
Will extract from step 1 the requested. millicpu field, requested. memory field, allocable. millicpu field, allocable. memory field, if allocable. millicpu is greater than requested. millicpu and allocableMemory, using LeastRequestedpriority to sort, to obtain NodeiCorresponding score Li,L=((allocable.MilliCPU-requested.MilliCPU)/allocable.MilliCPU+(allocable.Memory
Memory)/allocable memory)/2, otherwise, ending the scheduling process and returning error information;
and step 3: ranking the BalancedQoSPriority to obtain the NodeiCorresponding score Bi
And 4, step 4: make Scorei=ω1Li2BiIn descending order of score
In order to obtain the final Node score ranking list, the nodes obtained in the step 2 and the step 3 are usediCorresponding score Li、BiWeighted summation is carried out to obtain NodeiCorresponding total Scorei,ω1、ω2Can be decided by a user according to different scenes, but the weight sum is 1, and the invention sets omega1=ω2=0.5;
And 5: the Node with the highest score is used as the optimal destination Node, and the Master executes Binding operation Binding
For the Score obtained in step 4iAnd (4) descending the order, and taking the Node with the highest score as the optimal target Node for Binding.
In step 3, according to the qos class field extracted in step 1, using BalancedQoSPriority to score and sort, and obtaining NodeiCorresponding score BiThe specific score calculation steps are as follows:
step 1.1: extracting the QoS grade of the Pod to be scheduled, and setting the QoS grade as P;
step 1.2: traversing each Node, counting the Pod number of P grade on each Node and Pod number in the Node, and marking as PLAnd PallAnd calculating the ratio
Figure BDA0002322903990000021
Step 1.3: traversing each Node, counting the total number of the P level Pod number in the cluster and the Pod number in the cluster, and dividingIs marked as CLAnd CallAnd calculating the ratio
Figure BDA0002322903990000022
Step 1.4: finally, the fraction of each Node is calculated, B is 10X 1- (P)L+1)/(Pall+1)+(CL+1)/(Call+1) |, where | is an integer symbol.
The invention has the characteristics and beneficial effects that:
the invention provides an improved Kubernets resource scheduling method, which improves the default LeastRequestepriority by comprehensively using LeastRequestepriority and BalancedQoSPriority algorithms. The method not only can meet the efficient utilization of Kubernetes resources, reduce single-point faults, enhance high availability, but also can evenly distribute the Pod with different QoS levels, and improve the service quality of the platform.
Description of the drawings:
FIG. 1 is a CPU/Memory dispersion distribution.
Fig. 2 shows QoS equalization distribution.
Fig. 3 is a comprehensive dispersion distribution.
FIG. 4 is a flow chart of the steps of the present invention.
Detailed Description
In order to overcome the problems that although a LeastRequestPriority algorithm provided by Kubernetes by default can distribute Pods to Node nodes with the most abundant computing resources and evenly distribute work units, the service quality reduction possibly caused by the service quality brought by unbalanced QoS levels is not considered, and the BalancdQoSPriority only considers the balanced QoS levels as much as possible but cannot ensure the efficient utilization of resources in the prior art.
The technical scheme of the invention is as follows:
1) the use of balancedQoSPriority improves the problem of insufficient prediction of the platform for the distribution of QoS classes.
2) The two algorithms are weighted to achieve the comprehensive realization of two optimization targets, so that the high-efficiency utilization of computing resources can be met, and the service quality of the platform can be improved.
Step 1: reading the pre-screening list of the Predicate, and taking the Node and the Pod to be scheduled as the input of the improved scheduling method
The Kubernetes resource scheduling algorithm is divided into two flows of Predicate pre-screening and Priority screening. And reading the pre-screening list of the Predicate to obtain the Node nodes which can be potentially dispatched. Taking the pre-scheduled Pod as the input of an improved resource scheduling method, writing a shell script on a Master host as a self-defined scheduling program, calling api of K8s to obtain resource information, reading a qos class field, a requested. MilliCPU field and a requested. memory field of the pre-scheduled Pod by using a jq tool capable of extracting a specified JSON field, and reading an allocable. MilliCPU field and an allocable. memory field of a schedulable Node;
step 2: and scoring and sequencing LeastRequestedpriority to obtain the NodeiCorresponding score Li
The extracted request.MilliCPU field, request.memory field, allocable.MilliCPU field, allocable.memory field according to step 1, if allocable.MilliCPU is larger than request.MilliCPU and allocable.memory is larger than request.memory, using LeastRequestepriority to sort and obtain NodeiCorresponding score LiAnd if not, ending the scheduling process and returning error information. If the MilliCPU marking number is the core number, multiplying by 1000, otherwise, keeping unchanged;
and step 3: ranking the BalancedQoSPriority to obtain the NodeiCorresponding score Bi
According to the extracted qosClass field in the step 1, using BalancdQoSpriority to score and sort, and obtaining NodeiCorresponding score BiThe specific score calculation steps are as follows:
step 1.1: extracting the QoS grade of the Pod to be scheduled, and setting the QoS grade as P;
step 1.2: traversing each Node, counting the Pod number of P grade on each Node and Pod number in the Node, and marking as PLAnd PallAnd calculating the ratio
Figure BDA0002322903990000041
Step 1.3: traversing each Node, counting the total number of the P level Pod number in the cluster and the Pod number in the cluster, and respectively recording the number as CLAnd CallAnd calculating the ratio
Figure BDA0002322903990000042
Step 1.4: finally, the fraction of each Node is calculated, B is 10X 1- (P)L+1)/(Pall+1)+(CL+1)/(Call+1) |. And | is an integer symbol.
And 4, step 4: make Scorei=ω1Li2BiIn descending order of score
In order to obtain the final Node score ranking list, the nodes obtained in the step 2 and the step 3 are usediCorresponding score Li、BiWeighted summation is carried out to obtain NodeiCorresponding total Scorei,ω1、ω2Can be decided by the user according to different scenes, but the weight sum should be 1 when omega1=1,ω2The algorithm converts to a pure LeastRequestedpriority algorithm when ω is 01=0,ω21-the algorithm is converted into a pure BalancedQoSPriority algorithm, and the invention proposes to set omega1=ω2=0.5;
And 5: the Node with the highest score is used as the best destination Node to carry out Binding (Binding operation executed by Master)
For the Score obtained in step 4iAnd (4) descending the order, and taking the Node with the highest score as the optimal target Node for Binding.
The effectiveness of the invention is verified by simulation as follows:
in the experiment, 1 Master (4 cores and 4GB) and 3 nodes (2 cores and 2GB) are adopted, 40 Pods are deployed, wherein the Pods comprise 10 BestEffort (lowest level), 10 guarded (highest level) and 20 burst (middle level), and CPUs (central processing units) applied by the Pods are not equal to memories.
The CPU dispersion is calculated according to the formulas (1), (2) and (3):
Figure BDA0002322903990000043
Figure BDA0002322903990000044
Figure BDA0002322903990000045
the Memory dispersion is calculated according to the formulas (4), (5) and (6):
Figure BDA0002322903990000046
Figure BDA0002322903990000047
Figure BDA0002322903990000048
the calculation of QoS equilibrium degree adopts the standard deviation of the same QoS level Pod on each Node.
And defining the comprehensive dispersion as the average of the sum of the normalized CPU dispersion and the Memory dispersion and the average of the normalized QoS balance.
Simulation experiment tests show that 4 scheduling methods respectively comprise: default scheduling algorithm (denoted by Default in the figure), an improved kubernets resource scheduling method (denoted by QL in the figure), leaserequedpriority (denoted by lease in the figure), and balancedqosprorinity (denoted by QoS in the figure). The obtained CPU/Memory dispersion is shown in figure 1, the obtained QoS balance is shown in figure 2, the obtained comprehensive dispersion is shown in figure 3, and experimental results show that the improved Kubernets resource scheduling method is smaller in comprehensive dispersion, so that computing resources can be efficiently utilized, and QoS levels can be distributed in a balanced manner.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (3)

1. An improved Kubernetes resource scheduling method is characterized by comprising the following steps:
1) the problem that the distribution of the QoS classes is not estimated sufficiently by using a QoS (quality of service) optimized scheduling BalancdQoSPriority improvement platform;
2) and weighting the pre-screening of the pre-selection algorithm Predicate and the preferential Priority screening to achieve the comprehensive realization of two optimization targets.
2. The improved Kubernetes resource scheduling method of claim 1, wherein the specific steps are as follows:
step 1: reading a pre-screening list of the Predicate, and taking a combined Pod of the child Node and one or more containers to be scheduled as the input of the improved scheduling method;
the Kubernetes resource scheduling algorithm comprises two flows of Predicate pre-screening and Priority pre-screening, a Node which is potentially schedulable is obtained by reading a pre-screening list of the Predicate, a pre-scheduled Pod is used as the input of an improved resource scheduling method, a QoS type qosClass field of the Pod, a requested processor quantity requested.
Step 2: and scoring and sequencing LeastRequestedpriority to obtain the NodeiCorresponding score Li
The extracted request.MilliCPU field, request.memory field, allocable.MilliCPU field, allocable.memory field according to step 1, if allocable.MilliCPU is larger than request.MilliCPU and allocable.memory is larger than request.memory, using LeastRequestepriority to sort and obtain NodeiCorresponding score Li
(MilliCPU-requested. MilliCPU)/MilliCPU + (memory-requested. memory)/Allocable. memory))/2, otherwise, ending the scheduling process and returning error information;
and step 3: ranking the BalancedQoSPriority to obtain the NodeiCorresponding score Bi
And 4, step 4: make Scorei=ω1Li2BiIn descending order of score
In order to obtain the final Node score ranking list, the nodes obtained in the step 2 and the step 3 are usediCorresponding score Li、BiWeighted summation is carried out to obtain NodeiCorresponding total Scorei,ω1、ω2Can be decided by a user according to different scenes, but the weight sum is 1, and the invention sets omega1=ω2=0.5;
And 5: the Node with the highest score is used as the optimal destination Node, and the Master executes Binding operation Binding
For the Score obtained in step 4iAnd (4) descending the order, and taking the Node with the highest score as the optimal target Node for Binding.
3. The improved Kubernetes resource scheduling method of claim 1, wherein in step 3, the nodes are obtained by using BalancdQoSPriority scoring and sorting according to the extracted qosClass field in step 1iCorresponding score BiThe specific score calculation steps are as follows:
step 1.1: extracting the QoS grade of the Pod to be scheduled, and setting the QoS grade as P;
step 1.2: traversing each Node, counting the Pod number of P grade on each Node and Pod number in the Node, and marking as PLAnd PallAnd calculating the ratio
Figure FDA0002322903980000011
Step 1.3: traversing each Node, counting the total number of the P level Pod number in the cluster and the Pod number in the cluster, and respectively recordingIs CLAnd CallAnd calculating the ratio
Figure FDA0002322903980000021
Step 1.4: finally, the fraction of each Node is calculated, B is 10X 1- (P)L+1)/(Pall+1)+(CL+1)/(Call+1) |, where | is an integer symbol.
CN201911305242.0A 2019-12-17 2019-12-17 Improved Kubernetes resource scheduling method Active CN111143059B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911305242.0A CN111143059B (en) 2019-12-17 2019-12-17 Improved Kubernetes resource scheduling method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911305242.0A CN111143059B (en) 2019-12-17 2019-12-17 Improved Kubernetes resource scheduling method

Publications (2)

Publication Number Publication Date
CN111143059A true CN111143059A (en) 2020-05-12
CN111143059B CN111143059B (en) 2023-10-20

Family

ID=70518670

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911305242.0A Active CN111143059B (en) 2019-12-17 2019-12-17 Improved Kubernetes resource scheduling method

Country Status (1)

Country Link
CN (1) CN111143059B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112527486A (en) * 2020-12-17 2021-03-19 航天信息股份有限公司 Scheduling optimization method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106844051A (en) * 2017-01-19 2017-06-13 河海大学 The loading commissions migration algorithm of optimised power consumption in a kind of edge calculations environment
CN109167835A (en) * 2018-09-13 2019-01-08 重庆邮电大学 A kind of physics resource scheduling method and system based on kubernetes
CN109960585A (en) * 2019-02-02 2019-07-02 浙江工业大学 A kind of resource regulating method based on kubernetes
CN110389820A (en) * 2019-06-28 2019-10-29 浙江大学 A kind of private clound method for scheduling task carrying out resources based on v-TGRU model

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106844051A (en) * 2017-01-19 2017-06-13 河海大学 The loading commissions migration algorithm of optimised power consumption in a kind of edge calculations environment
CN109167835A (en) * 2018-09-13 2019-01-08 重庆邮电大学 A kind of physics resource scheduling method and system based on kubernetes
CN109960585A (en) * 2019-02-02 2019-07-02 浙江工业大学 A kind of resource regulating method based on kubernetes
CN110389820A (en) * 2019-06-28 2019-10-29 浙江大学 A kind of private clound method for scheduling task carrying out resources based on v-TGRU model

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
徐正伦 等: "基于Kubernetes调度器的服务质量优化调度算法研究" *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112527486A (en) * 2020-12-17 2021-03-19 航天信息股份有限公司 Scheduling optimization method and device

Also Published As

Publication number Publication date
CN111143059B (en) 2023-10-20

Similar Documents

Publication Publication Date Title
CN103810016B (en) Realize method, device and the group system of virtual machine (vm) migration
CN103870314B (en) Method and system for simultaneously operating different types of virtual machines by single node
CN108667859A (en) A kind of method and device for realizing scheduling of resource
Dhari et al. An efficient load balancing scheme for cloud computing
CN105373432B (en) A kind of cloud computing resource scheduling method based on virtual resource status predication
Mishra et al. Time efficient dynamic threshold-based load balancing technique for Cloud Computing
Rejiba et al. Custom scheduling in kubernetes: A survey on common problems and solution approaches
US11042419B2 (en) Cooperative scheduling method and system for computing resource and network resource of container cloud platform
Ma et al. vLocality: Revisiting data locality for MapReduce in virtualized clouds
TW202034179A (en) Method, equipment and system for resource scheduling and central server thereof
KR101557747B1 (en) System and method for allocating virtual machine for effective use of multi resource in cloud
CN114356543A (en) Kubernetes-based multi-tenant machine learning task resource scheduling method
Liu et al. Runtime‐aware adaptive scheduling in stream processing
Haidri et al. A deadline aware load balancing strategy for cloud computing
Mylavarapu et al. An optimized capacity planning approach for virtual infrastructure exhibiting stochastic workload
Emara et al. Genetic-Based Multi-objective Task Scheduling Algorithm in Cloud Computing Environment.
CN111143059A (en) Improved Kubernetes resource scheduling method
Qaddoum et al. Elastic neural network method for load prediction in cloud computing grid.
Garg et al. Optimal virtual machine scheduling in virtualized cloud environment using VIKOR method
CN111104203A (en) Virtual machine decentralized scheduling method and device, electronic device and storage medium
Awasare et al. Survey and comparative study on resource allocation strategies in cloud computing environment
Dimolitsas et al. AHP4HPA: An AHP-based Autoscaling Framework for Kubernetes Clusters at the Network Edge
Stefano et al. Scheduling communication-intensive applications on mesos
Shiekh et al. A load-balanced hybrid heuristic for allocation of batch of tasks in cloud computing environment
CN109558214B (en) Host machine resource management method and device in heterogeneous environment and storage medium

Legal Events

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