CN111143059B - Improved Kubernetes resource scheduling method - Google Patents

Improved Kubernetes resource scheduling method Download PDF

Info

Publication number
CN111143059B
CN111143059B CN201911305242.0A CN201911305242A CN111143059B CN 111143059 B CN111143059 B CN 111143059B CN 201911305242 A CN201911305242 A CN 201911305242A CN 111143059 B CN111143059 B CN 111143059B
Authority
CN
China
Prior art keywords
node
score
memory
millicpu
pod
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911305242.0A
Other languages
Chinese (zh)
Other versions
CN111143059A (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

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 (K8 s) operation and maintenance technology, which aims to improve network service quality and ensure 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 of insufficient distribution prediction of quality of service QoS class by using a quality of service optimization scheduling BalanceQoSPriority improvement platform; 2) The pre-screening and the preferential Priority pre-screening of the pre-selection algorithm are weighted to achieve the comprehensive realization of the two optimization targets. The invention is mainly applied to the occasion of reasonable distribution of network resources.

Description

Improved Kubernetes resource scheduling method
Technical Field
The invention relates to a Kubernetes (K8 s) 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, and provides an on-demand mode of operation by transmitting Computing services over the internet. The user may rent different types of resources to meet their own computing needs, such as Virtual Machines (VMs), containers (containers), dedicated hardware or bare-metal resources, etc. The container technology is a lightweight virtualization technology, which packages codes and all their dependencies, and can quickly and reliably migrate applications in different computing environments without starting any virtual machine.
Kubernetes, abbreviated as K8s, is an abbreviation that replaces 8 characters "ubennee" with 8. The method is an open source application for managing containerization on a plurality of hosts in the cloud platform, K8s is an open source container arrangement platform developed by Google corporation, and can arrange containers into a cluster, and easily managed and used containerization application services are provided outside. The K8s adopts a Master multi-slave cluster architecture, uses a Master Node (Master) to manage a plurality of child nodes (nodes), and the Master Node is a central nerve for cluster management and is an access entry for providing cluster control. Kubernetes Scheduler is a scheduler running on the master node, with Pod (a combination of one or more containers) as the base unit assigned to the appropriate child node, and default scheduling algorithms can be divided into two categories depending on the order of the startup phase: a pre-selection algorithm (Priority) and a preference algorithm (Priority), wherein the pre-selection algorithm is executed first, and takes the size of the disk space, whether the disk space has enough computing resources, whether the disk space has tags tolerating the Pod and the like as hard standards to form a potential list of alternative child nodes. Scoring evaluation of preferred algorithm the Pod is scheduled to the highest scoring child node, and the preferred algorithm provided by default at present mainly comprises: leastrequestedPriority (minimum request algorithm), balancedResourceAllocation (resource balanced allocation algorithm), imageLocaly (node mirror score), and the like. The leastrequestedPriority takes the CPU and the memory (MEM) of the Pod request as input parameters, and the traversable child nodes respectively subtract the calculated percentages of the parameters from available computing resources and add the calculated percentages to be averaged as a total score. The balance of resource usage is emphasized by the balancedsourceAllocation, the closer the CPU percentage and memory percentage used, the higher the score. ImageLocality is scored according to whether child nodes have mirror images required by Pod or not and the mirror image size. In addition to the scheduling algorithms provided by the platform by default, a large number of researchers, enterprises, etc. have proposed such as preemptive resource scheduling algorithms, neural network-based resource scheduling algorithms, ARIMA (Autoregressive Integrated Moving Average Model, autoregressive moving average model) based models, quality of service oriented balanceqospority resource scheduling algorithms, etc.
Disclosure of Invention
In order to overcome the problem that in the prior art, the leastrequstedPriority algorithm provided by Kubernetes by default can distribute Pod to Node nodes with most abundant computing resources and uniformly distribute working units, but does not consider the problem that the service quality possibly decreases due to the unbalanced QoS (Quality of Service ) level, and the existing barancedQoSpriority only considers the balanced QoS level as much as possible, but cannot guarantee 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 of insufficient distribution prediction of quality of service QoS class by using a quality of service optimization scheduling BalanceQoSPriority improvement platform;
2) The pre-screening and the preferential Priority pre-screening of the pre-selection algorithm are weighted to achieve the comprehensive realization of the two optimization targets.
The method comprises the following specific steps:
step 1: reading a pre-screening list of the pre-guide, and taking a combined Pod of the child Node and one or more containers to be scheduled as an input of an improved scheduling method;
the resource scheduling algorithm of Kubernetes is divided into two flows of pre-screening and Priority screening, a pre-screening list of pre-screening is read to obtain Node nodes which can be potentially scheduled, the pre-scheduled Pod is used as input of an improved resource scheduling method, a QoS class qosClass field of the Pod, a requested processor number request.millicpu field, a requested memory number request.memory field are read, and an allocable processor number allocable.millicpu (field, allocable memory number (field;
step 2: leastrequest degree score ordering to obtain Node i Corresponding score L i
Ordering the requested.MilliCPU field, the requested.memory field, the allowable.MilliCPU field, and the allowable.memory field extracted according to the step 1, and if the allowable.MilliCPU is larger than the requested.MilliCPU and the allowable.memory is larger than the requested.memory, using LeastRequestedPriority scoring to obtain the Node score i Corresponding score L i ,L=((allocable.MilliCPU-requested.MilliCPU)/allocable.MilliCPU+(allocable.Memory
-requested/allowable/memory)/2, otherwise, ending the scheduling procedure and returning an error message;
step 3: balancedQoSPriority scoring order to obtain Node i Corresponding score B i
Step 4: let Score i =ω 1 L i2 B i Arranged in descending order of score
In order to obtain the final Node score ranking list, the Node obtained in step 2 and step 3 are selected i Corresponding score L i 、B i Weighted summation is carried out to obtain Node i Corresponding total Score i ,ω 1 、ω 2 Can be according to nothing by the userThe same scene is decided, but the weight addition should be 1, the invention sets omega 1 =ω 2 =0.5;
Step 5: the Node with the highest score is used as the optimal destination Node, and the Master performs Binding operation Binding
For the Score obtained in step 4 i And (3) arranging in descending order, and taking the Node with the highest score as the optimal destination Node to carry out Binding.
In step 3, node is obtained by using BalanceQoSPriority scoring order according to the qosClass field extracted in step 1 i Corresponding score B i The specific score calculation steps are as follows:
step 1.1: extracting QoS grade of 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 the Pod number in the Node, and respectively marking as P L And P all And calculate the duty ratio
Step 1.3: traversing each Node, counting the total number of P grade Pod numbers in the cluster and Pod numbers in the cluster, and respectively marking as C L And C all And calculate the duty ratio
Step 1.4: finally, the score of each Node is calculated, and B=10×|1- (P) L +1)/(P all +1)+(C L +1)/(C all +1) |, is an integer symbol.
The invention has the characteristics and beneficial effects that:
the invention provides an improved Kubernetes resource scheduling method, which improves default leastrequest priority by comprehensively using leastrequest priority and balanceqosporicity algorithm. The method can not only meet the high-efficiency utilization of the Kubernetes resources and reduce single-point faults to enhance high availability, but also uniformly distribute Pods 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 is a QoS balance 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 in the prior art, the leastrequstedPriority algorithm provided by Kubernetes by default can distribute Pod to Node nodes with most abundant computing resources and uniformly distribute working units, but the service quality possibly caused by the service quality caused by unbalanced QoS level is reduced, and the balancedQoSPority only considers the balanced QoS level as much as possible, but the efficient utilization of resources cannot be ensured.
The technical scheme of the invention is as follows:
1) The problem of insufficient distribution prediction of QoS classes by a platform is improved by using BalanceQoSPriority.
2) The two algorithms are weighted to achieve the comprehensive realization of two optimization targets, thereby not only meeting the efficient utilization of computing resources, but also improving the service quality of the platform.
Step 1: reading a pre-screening list of the pre-indicator, and taking Node and Pod to be scheduled as input of an improved scheduling method
The resource scheduling algorithm of Kubernetes is divided into two flows of pre-screening and Priority screening. And reading the pre-screening list of the pre-guide to obtain the Node nodes which can be potentially scheduled. Writing shell scripts on a Master host as a self-defined scheduling program by taking input of a pre-scheduled Pod as an improved resource scheduling method, acquiring resource information by calling an api of K8s, 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 designated JSON field, and reading an allowable.MilliCPU field and an allowable.memory field of a schedulable Node;
step 2: leastrequest degree score ordering to obtain Node i Corresponding score L i
The requested.MilliCPU extracted according to step 1Fields, requested.memory fields, allowed.MilliCPU fields, allowed.memory fields, if allowed.MilliCPU is greater than requested.MilliCPU and allowed.memory is greater than requested.memory, using LeastRequestedPriority scoring to obtain Node i Corresponding score L i L= ((allowed.millicpu-requested.millicpu)/allowed.millicpu+ (allowed.memory-requested.memory)/allowed.memory))/2, otherwise, the scheduling flow is ended, and error information is returned. Multiplying 1000 if the MilliCPU label number is the number of cores, otherwise, keeping unchanged;
step 3: balancedQoSPriority scoring order to obtain Node i Corresponding score B i
Obtaining Node according to the qosClass field extracted in the step 1 by using BalancedQoSPriority scoring order i Corresponding score B i The specific score calculation steps are as follows:
step 1.1: extracting QoS grade of 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 the Pod number in the Node, and respectively marking as P L And P all And calculate the duty ratio
Step 1.3: traversing each Node, counting the total number of P grade Pod numbers in the cluster and Pod numbers in the cluster, and respectively marking as C L And C all And calculate the duty ratio
Step 1.4: finally, the score of each Node is calculated, and B=10×|1- (P) L +1)/(P all +1)+(C L +1)/(C all +1) |. And I is an integer sign.
Step 4: let Score i =ω 1 L i2 B i Arranged in descending order of score
In order to obtain the final Node score ranking list, the method comprises the steps 2 and 3Node of (2) i Corresponding score L i 、B i Weighted summation is carried out to obtain Node i Corresponding total Score i ,ω 1 、ω 2 Can be determined by the user according to different scenes, but the weight addition should be 1 when ω 1 =1,ω 2 =0 the present algorithm is converted to a pure LeastRequestedPriority algorithm when ω 1 =0,ω 2 =1 the algorithm is converted to a pure balanceqosporicity algorithm, the invention proposes to set ω 1 =ω 2 =0.5;
Step 5: the Node with the highest score is used as the optimal destination Node to carry out Binding (Binding operation executed by Master)
For the Score obtained in step 4 i And (3) arranging in descending order, and taking the Node with the highest score as the optimal destination Node to carry out Binding.
The effectiveness of the invention is verified by simulation as follows:
the experiment adopts 1 Master (4 cores 4 GB), 3 Nodes (2 cores 2 GB), and deploys 40 Pods, wherein the Pods comprise 10 BestEfforts (lowest level), 10 Guaranideds (highest level) and 20 burst tables (medium level), and the CPUs and memories of the Pod applications are unequal.
The calculation of the CPU dispersion is as shown in the formulas (1), (2) and (3):
the Memory dispersion is calculated as shown in formulas (4), (5) and (6):
the QoS balance is calculated using standard deviations of the same QoS level Pod on each Node.
The composite dispersion is defined as the mean of the sum of the normalized CPU dispersion and Memory dispersion and the mean of the normalized QoS equilibrium.
The 4 scheduling methods for the simulation experiment test are respectively as follows: default scheduling algorithm (shown as Default in the figure), a modified Kubernetes resource scheduling method (shown as QL in the figure), leastrequest priority (shown as Least in the figure), and baranceqospority (shown as QoS in the figure). The obtained CPU/Memory dispersion is shown in figure 1, the obtained QoS equilibrium degree is shown in figure 2, the obtained comprehensive dispersion degree is shown in figure 3, and experimental results show that the improved Kubernetes resource scheduling method has smaller comprehensive dispersion degree, so that the computing resources can be efficiently utilized, and the QoS levels can be uniformly distributed.
The foregoing description of the preferred embodiments of the invention is not intended to limit the invention to the precise form disclosed, and any such modifications, equivalents, and alternatives falling within the spirit and scope of the invention are intended to be included within the scope of the invention.

Claims (2)

1. An improved Kubernetes resource scheduling method is characterized by comprising the following steps:
1) The problem of insufficient distribution prediction of quality of service QoS class by using a quality of service optimization scheduling BalanceQoSPriority improvement platform;
2) Weighting pre-screening and preferential Priority pre-screening of a pre-selection algorithm to achieve comprehensive realization of two optimization targets; the method comprises the following specific steps:
step 1: reading a pre-screening list of the pre-guide, and taking a combined Pod of the child Node and one or more containers to be scheduled as an input of an improved scheduling method;
the resource scheduling algorithm of Kubernetes is divided into two flows of pre-screening and Priority screening, a pre-screening list of pre-screening is read to obtain Node nodes which can be potentially scheduled, the pre-scheduled Pod is used as input of an improved resource scheduling method, a QoS class qosClass field of the Pod, a requested processor number request.millicpu field, a requested memory number request.memory field are read, and an allocable processor number allocable.millicpu (field, allocable memory number allocable.memory field) of the Node which can be scheduled is read;
step 2: leastrequest degree score ordering to obtain Node i Corresponding score L i
Ordering the requested.MilliCPU field, the requested.memory field, the allowable.MilliCPU field, and the allowable.memory field extracted according to the step 1, and if the allowable.MilliCPU is larger than the requested.MilliCPU and the allowable.memory is larger than the requested.memory, using LeastRequestedPriority scoring to obtain the Node score i Corresponding score L i
L= ((allowed.millicpu-requested.millicpu)/allowed.millicpu+ (allowed.memory-requested.memory)/allowed.memory))/2, otherwise, the scheduling flow is ended, and error information is returned;
step 3: balancedQoSPriority scoring order to obtain Node i Corresponding score B i
Step 4: let Score i =ω 1 L i2 B i Arranged in descending order of score
In order to obtain the final Node score ranking list, the Node obtained in step 2 and step 3 are selected i Corresponding score L i 、B i Weighted summation is carried out to obtain Node i Corresponding total Score i ,ω 1 、ω 2 Can be determined by a user according to different scenes, but the weight addition should be 1, and omega is set 1 =ω 2 =0.5;
Step 5: the Node with the highest score is used as the optimal destination Node, and the Master performs Binding operation Binding
For the Score obtained in step 4 i And (3) arranging in descending order, and taking the Node with the highest score as the optimal destination Node to carry out Binding.
2. The improved Kubernetes resource scheduling method of claim 1 wherein in step 3, node is obtained using a balancedtosporicity scoring order according to the qosClass field extracted in step 1 i Corresponding score B i The specific score calculation steps are as follows:
step 1.1: extracting QoS grade of 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 the Pod number in the Node, and respectively marking as P L And P all And calculate the duty ratio
Step 1.3: traversing each Node, counting the total number of P grade Pod numbers in the cluster and Pod numbers in the cluster, and respectively marking as C L And C all And calculate the duty ratio
Step 1.4: finally, the score of each Node is calculated, and B=10×|1- (P) L +1)/(P all +1)+(C L +1)/(C all +1) |, 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 CN111143059A (en) 2020-05-12
CN111143059B true 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)

Families Citing this family (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调度器的服务质量优化调度算法研究.软件导刊.2018,第17卷(第10期),第73-76页. *

Also Published As

Publication number Publication date
CN111143059A (en) 2020-05-12

Similar Documents

Publication Publication Date Title
US10701139B2 (en) Life cycle management method and apparatus
Mustafa et al. Resource management in cloud computing: Taxonomy, prospects, and challenges
CN111966500B (en) Resource scheduling method and device, electronic equipment and storage medium
CN108076156B (en) Mixed cloud system based on Chinese cloud product
WO2017080391A1 (en) Network service deployment method and device
Patel et al. Survey on resource allocation strategies in cloud computing
CN110661842B (en) Resource scheduling management method, electronic equipment and storage medium
CN108667859A (en) A kind of method and device for realizing scheduling of resource
Liu et al. Towards a multi-QoS human-centric cloud computing load balance resource allocation method
CN102622264A (en) Multi-virtualization computing platform method in cloud computing
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
US11301284B2 (en) Method for managing VNF instantiation and device
CN103677983B (en) The dispatching method and device of application
Chien et al. An efficient virtual machine migration algorithm based on minimization of migration in cloud computing
CN110198364B (en) Container cloud distributed training data communication method based on designated DNS analysis
CN116089009A (en) GPU resource management method, system, equipment and storage medium
CN111143059B (en) Improved Kubernetes resource scheduling method
Saravanakumar et al. An Efficient On-Demand Virtual Machine Migration in Cloud Using Common Deployment Model.
CN111405072B (en) Hybrid cloud optimization method based on cloud manufacturer cost scheduling
CN116680078A (en) Cloud computing resource scheduling method, device, equipment and computer storage medium
Laha et al. Issues, Challenges and Techniques for Resource Provisioning in Computing Environment
Venkata Subba Reddy et al. A dynamic hierarchical load balancing service architecture for cloud data centre virtual machine migration
Du et al. A combined priority scheduling method for distributed machine learning
CN110300192B (en) Method for updating distributed training task connection parameters according to IP distribution table

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