Scheduling method and system for hybrid architecture container cloud
By filtering unmatched working nodes and sorting based on hardware performance in K8S cluster scheduling, the problem of architecture mismatch and performance inconsistency in K8S cluster scheduling under hybrid architecture is solved, and better application scheduling results are achieved.
Patent Information
- Application Number
- CN202111502893.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-09
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2041-12-09
AI Technical Summary
In a mixed architecture scenario, it is difficult for the traditional K8S cluster scheduling algorithm to achieve performance consistency of application copies, and the mismatch between the mirror and working node architecture leads to scheduling failure, large performance differences, and insufficient dispersion of multi-copy scheduling.
During the scheduling process, the pre-filtering phase filters out working nodes that do not match the application image architecture. The scoring phase sorts K8S working nodes based on hardware performance and margin. The sorting results are adjusted in the planning phase to ensure that the application is scheduled to match the architecture and architecture. Nodes with matching performance.
It solves the problem of startup failure caused by the mismatch between mirror and worker node architecture in a hybrid architecture, improves the performance consistency and scheduling dispersion of multi-copy applications, and avoids performance differences when solely relying on CPU and memory margins to determine scheduling priorities.
Smart Images

Figure CN114201295B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of node scheduling technology, and in particular to a scheduling method and system suitable for a hybrid architecture container cloud. Background Art
[0002] Traditional K8S cluster multi-copy application orchestration has weak control over copies. In a hybrid architecture scenario, the K8S cluster working nodes have different architectures and performance. According to the current scheduling algorithm, it is difficult to achieve relatively consistent performance for each copy of the application.
[0003] Patent document CN108108245B (application number: CN201711364950.2) discloses a hybrid scheduling method and system for cloud platform wide node scientific workflow. The method includes: when each scheduling stage is initialized, the task is constructed into a task multi-layer clustering tree structure using the bond energy algorithm transformation; in the global initialization stage, the scheduling resources are constructed into a cloud resource multi-layer tree structure using the bond energy algorithm transformation and basic binary multi-layer partitioning; according to the mapping deadline of the task group and the resource distribution of each dimension of the scheduling resources, the nodes of the task subtree in the task multi-layer clustering tree structure are mapped with the nodes in the cloud resource multi-layer tree structure; at the end of the stage scheduling, it is determined whether the number of tasks that have completed the mapping operation exceeds the set threshold; if so, the unmapped tasks are returned to the next scheduling stage, and the deadlines of the remaining tasks are reallocated.
[0004] However, most current images only support a single architecture, but the scheduling algorithm does not identify the image architecture. In a hybrid architecture scenario, there is a high probability that the image and the working node architecture will not match. Summary of the invention
[0005] In view of the defects in the prior art, the object of the present invention is to provide a scheduling method and system suitable for a hybrid architecture container cloud.
[0006] The scheduling method applicable to a hybrid architecture container cloud provided by the present invention includes:
[0007] Step 1: In the pre-filtering stage of scheduling, filter out the working nodes that do not match the application image architecture;
[0008] Step 2: In the scoring stage of scheduling, K8S working nodes are scored and sorted according to hardware performance and margin;
[0009] Step 3: During the planning and scoring phase, adjust the scoring and sorting results based on the K8S work node information that has been scheduled for the application to obtain the optimal application scheduling result.
[0010] Preferably, the step 1 comprises:
[0011] Step 1.1: Get the image address from the application orchestration file, access the image address to obtain detailed information about the image, and parse out the operating system and hardware architecture supported by the image;
[0012] Step 1.2: Traverse the candidate K8S work nodes, obtain the operating system and image architecture supported by the K8S work nodes, and if they are different from the operating system and hardware architecture supported by the application image, remove them from the candidate K8S work nodes;
[0013] Step 1.3: After the traversal is completed, keep the K8S working nodes that match the application image architecture.
[0014] Preferably, the step 2 comprises:
[0015] Step 2.1: Get the CPU main frequency and memory main frequency of the K8S working node, calculate the hardware performance by weighting the CPU main frequency and memory main frequency of the K8S working node, and score the K8S working node based on the hardware performance;
[0016] Step 2.2: Get the CPU and unallocated memory of the K8S working node, weight the CPU and unallocated memory to get the resource margin of the K8S working node, and score the K8S working node based on the resource margin;
[0017] Step 2.3: Weight the K8S worker node scoring results of step 2.1 and step 2.2, and sort the K8S worker nodes according to the results;
[0018] Step 2.4: Schedule the working nodes according to the sorting results.
[0019] Preferably, step 2.4 includes: obtaining the working node where the existing copy of the application is running, and when it does not exist, scheduling the Pod to the K8S working node with the best ranking in step 2.3; when it exists, identifying its CPU model and memory model, and preferentially scheduling the Pod to the K8S working node with the same hardware; when there is no working node with the same hardware, identifying the CPU main frequency and memory main frequency of the working node where the existing copy is running, calculating the hardware performance through weighted calculation, and comparing it with the K8S working node performance obtained in step 2.1, according to the principle of performance proximity, preferentially scheduling the Pod to the K8S working node with the closest performance.
[0020] Preferably, step 3 includes: obtaining the distribution of K8S working nodes where scheduled copies of multi-copy applications are located; when there are no scheduled copies, the K8S working node ranking is not adjusted in the scoring stage, and the K8S working node with the highest score in the scoring stage is used as the scheduling node; when there are scheduled copies, the score of the scheduled K8S working node is reduced according to the proportion of the number of scheduled copies, thereby adjusting the K8S working node ranking obtained in the scoring stage.
[0021] The scheduling system for a hybrid architecture container cloud provided by the present invention includes:
[0022] Module M1: In the pre-filtering stage of scheduling, it filters out the working nodes that do not match the application image architecture;
[0023] Module M2: In the scoring stage of scheduling, K8S working nodes are scored and sorted according to hardware performance and margin;
[0024] Module M3: In the planning and scoring stage, the scoring and sorting results are adjusted according to the information of the K8S working nodes that have been scheduled by the application to obtain the optimal application scheduling result.
[0025] Preferably, the module M1 comprises:
[0026] Module M1.1: Get the image address from the application orchestration file, access the image address to obtain detailed information about the image, and parse the operating system and hardware architecture supported by the image;
[0027] Module M1.2: Traverse the candidate K8S working nodes, obtain the operating system and image architecture supported by the K8S working nodes, and if they are different from the operating system and hardware architecture supported by the application image, remove them from the candidate K8S working nodes;
[0028] Module M1.3: After the traversal is completed, the K8S working nodes that match the application image architecture are retained.
[0029] Preferably, the module M2 comprises:
[0030] Module M2.1: Get the CPU main frequency and memory main frequency of the K8S working node, calculate the hardware performance by weighting the CPU main frequency and memory main frequency of the K8S working node, and score the K8S working node based on the hardware performance;
[0031] Module M2.2: Get the CPU and unallocated memory of the K8S working node, weight the unallocated CPU and memory to get the resource margin of the K8S working node, and score the K8S working node based on the resource margin;
[0032] Module M2.3: Weight the K8S working node scoring results of modules M2.1 and M2.2, and sort the K8S working nodes according to the results;
[0033] Module M2.4: Schedule working nodes according to the sorting results.
[0034] Preferably, the module M2.4 includes: obtaining the working node where the existing copy of the application is running, and when it does not exist, scheduling the Pod to the K8S working node with the best ranking in module M2.3; when it exists, identifying its CPU model and memory model, and preferentially scheduling the Pod to the K8S working node with the same hardware; when there is no working node with the same hardware, identifying the CPU main frequency and memory main frequency of the working node where the existing copy is running, calculating the hardware performance through weighted calculation, and comparing it with the K8S working node performance obtained in module M2.1, and according to the principle of performance proximity, preferentially scheduling the Pod to the K8S working node with the closest performance.
[0035] Preferably, the module M3 includes: obtaining the distribution of K8S working nodes where scheduled copies of multi-copy applications are located; when there are no scheduled copies, the sorting of K8S working nodes in the scoring stage is not adjusted, and the K8S working node with the highest score in the scoring stage is used as the scheduling node; when there are scheduled copies, the score of the scheduled K8S working node is reduced according to the proportion of the number of scheduled copies, thereby adjusting the sorting of the K8S working nodes obtained in the scoring stage.
[0036] Compared with the prior art, the present invention has the following beneficial effects:
[0037] (1) The present invention filters out K8S working nodes that do not conform to the application image architecture through the Pre-filter filter, ensuring that the application is scheduled to the K8S working node that matches its image architecture, and solves the problem of startup failure caused by the application being scheduled to the working node that does not match the architecture in the hybrid architecture scenario;
[0038] (2) The present invention solves the problem of large performance differences among multiple copies of applications caused by determining the priority of the scheduled working node only based on the CPU and memory margin of the working node in a hybrid architecture scenario;
[0039] (3) The present invention solves the problem that the K8S working nodes scheduled by applying multiple copies are not dispersed enough by reducing the scores of the scheduled working nodes. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:
[0041] Figure 1The figure is a flow chart of the method of the present invention. DETAILED DESCRIPTION
[0042] The present invention is described in detail below in conjunction with specific embodiments. The following embodiments will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, for those of ordinary skill in the art, several changes and improvements can also be made without departing from the concept of the present invention. These all belong to the protection scope of the present invention.
[0043] Example:
[0044] The present invention provides a scheduling method for a hybrid architecture container cloud, which identifies the architecture supported by the image and the K8S working node architecture before scheduling, selects a matching working node according to the architecture supported by the image, and at the same time, for multiple copies of the same application, preferentially schedules them to working nodes with the same CPU model and memory to ensure relatively consistent performance, specifically including:
[0045] 1. Expand the Pre-filter extension point of the K8S scheduling framework, add a custom K8S worker node architecture filter, identify the CPU architecture and operating system type supported by the application image in the early stage of application scheduling, and filter out the K8S worker nodes that do not conform to the application image architecture through the Pre-filter filter to ensure that the application is scheduled to the K8S worker node that matches its image architecture, and solve the problem of startup failure caused by the application being scheduled to the worker node that does not match the architecture in the hybrid architecture scenario;
[0046] 2. Expand the Scoring extension point of the K8S scheduling framework. In the K8S worker node scoring stage, introduce a worker node hardware performance evaluation mechanism. At the same time, determine the priority of the scheduled worker node based on hardware performance and margin. Prioritize scheduling multiple copies of the same application to worker nodes with equivalent performance. This solves the problem of large performance differences among multiple copies of applications in hybrid architecture scenarios when the priority of the scheduled worker node is determined only based on the CPU and memory margin of the worker node.
[0047] 3. Expand the Normalize Scoring extension point of the K8S scheduling framework to obtain the statistical information of the working nodes that have been scheduled by the current multi-copy application. By reducing the scores of the scheduled working nodes, the problem of insufficient dispersion of the K8S working nodes to which the application multi-copy is scheduled is solved.
[0048] (I) Main process design:
[0049] like Figure 1 According to the scheduling method of the hybrid architecture container cloud provided by the present invention, the following steps are included:
[0050] Step 1: In the Pre-filter stage of scheduling, filter out the working nodes that do not match the application image architecture;
[0051] Step 2: In the Scoring phase of scheduling, K8S working nodes are scored and sorted based on hardware performance and margin;
[0052] Step 3: In the Normalize Scoring stage, adjust the sorting results in step 2 according to the information of the K8S working nodes that the application has been scheduled on to obtain the optimal application scheduling result.
[0053] The step 1 comprises the following steps:
[0054] Step 1.1: Get the image address from the application orchestration file, access the image address to obtain detailed information about the image, and parse out the operating system and hardware architecture supported by the image;
[0055] Step 1.2: Traverse the candidate K8S work nodes, obtain the operating system and image architecture supported by the K8S work nodes, and if they are different from the operating system and hardware architecture supported by the application image, remove them from the candidate K8S work nodes;
[0056] Step 1.3: After the traversal is completed, only the K8S working nodes that match the application image architecture are retained.
[0057] The step 2 comprises the following steps:
[0058] Step 2.1: Get the CPU main frequency and memory main frequency of the K8S working node, calculate the hardware performance by weighting the CPU main frequency and memory main frequency of the K8S working node, and score the K8S working node based on the hardware performance;
[0059] Step 2.2: Get the CPU and unallocated memory of the K8S working node, weight the CPU and unallocated memory to get the resource margin of the K8S working node, and score the K8S working node based on the resource margin;
[0060] Step 2.3: Weight the K8S worker node scoring results of step 2.1 and step 2.2, and sort the K8S worker nodes according to the results;
[0061] Step 2.4: Get the working node where the existing copy of the application is running. If it does not exist, schedule the Pod to the K8S working node with the best ranking in step 2.3; if it exists, identify its CPU model and memory model, and prioritize scheduling the Pod to the K8S working node with the same hardware; if there is no working node with the same hardware, identify the CPU main frequency and memory main frequency of the working node where the existing copy is running, and calculate the hardware performance through weighted calculation. Compare it with the K8S working node performance obtained in step 2.1, and according to the principle of performance proximity, prioritize scheduling the Pod to the K8S working node with the closest performance.
[0062] The step 3 comprises the following steps:
[0063] Step 3.1: Get the distribution of K8S working nodes where the scheduled copies of multi-copy applications are located;
[0064] Step 3.2: When there is no scheduled replica, the order of the K8S worker nodes in the Scoring phase is not adjusted, and the K8S worker node with the highest score in the Scoring phase is the scheduling node;
[0065] Step 3.3: When there are scheduled replicas, reduce the scores of the scheduled K8S work nodes according to the proportion of the scheduled replicas, thereby adjusting the ranking of the K8S work nodes obtained in the Scoring phase to solve the problem that the K8S work nodes scheduled by the application with multiple replicas are not dispersed enough.
[0066] (II) Main component design
[0067] 1. Scheduling Pre-filter extension points
[0068] Add a Pre-filter extension point to the K8S cluster scheduling framework. After executing the default Pre-filter scheduling algorithm, execute the extended Pre-filter algorithm designed in this solution to eliminate the K8S working nodes that do not meet the application image architecture;
[0069] 2. Scheduling Scoring Extension Points
[0070] Add a Scoring extension point to the K8S cluster scheduling framework. After executing the default Scoring scheduling algorithm, execute the extended Scoring algorithm designed in this solution, and score the K8S working nodes according to hardware performance and resource margin;
[0071] 2. Scheduling the Normalize Scoring extension point
[0072] Add the Normalize Scoring extension point to the K8S cluster scheduling framework. After executing the default NormalizeScoring scheduling algorithm, execute the extended Normalize Scoring algorithm designed in this solution to adjust the distribution of K8S working nodes to which multi-copy applications are scheduled.
[0073] The scheduling system suitable for hybrid architecture container cloud provided by the present invention includes: module M1: in the pre-filtering stage of scheduling, filtering out working nodes that do not match the application image architecture; module M2: in the scoring stage of scheduling, scoring and sorting the K8S working nodes according to hardware performance and margin; module M3: in the planning and scoring stage, adjusting the scoring and sorting results according to the information of the K8S working nodes that have been scheduled by the application, and obtaining the optimal application scheduling result.
[0074] The module M1 includes: Module M1.1: Obtain the image address from the application orchestration file, access the image address to obtain detailed information of the image and parse the operating system and hardware architecture supported by the image; Module M1.2: Traverse the alternative K8S working nodes, obtain the operating system and image architecture supported by the K8S working nodes, if they are different from the operating system and hardware architecture supported by the application image, they will be removed from the alternative K8S working nodes; Module M1.3: After the traversal is completed, retain the K8S working nodes that match the application image architecture. The module M2 includes: module M2.1: obtaining the CPU main frequency and memory main frequency of the K8S working node, obtaining the hardware performance by weighting the CPU main frequency and memory main frequency of the K8S working node, and scoring the K8S working node according to the hardware performance; module M2.2: obtaining the CPU and memory unallocated amount of the K8S working node, obtaining the resource margin of the K8S working node according to the weighted CPU and memory unallocated amounts, and scoring the K8S working node according to the resource margin; module M2.3: weighting the K8S working node scoring results of module M2.1 and module M2.2, and sorting the K8S working nodes according to the results; module M2.3: scheduling the working nodes according to the sorting results. Get the working node where the existing copy of the application is running. If it does not exist, schedule the Pod to the K8S working node with the best ranking in module M2.3; if it exists, identify its CPU model and memory model, and give priority to scheduling the Pod to the K8S working node with the same hardware; when there is no working node with the same hardware, identify the CPU main frequency and memory main frequency of the working node where the existing copy is running, calculate the hardware performance by weighted calculation, and compare it with the K8S working node performance obtained in module M2.1. According to the principle of performance proximity, give priority to scheduling the Pod to the K8S working node with the closest performance. The module M3 includes: obtaining the distribution of K8S working nodes where the scheduled copies of multi-copy applications are located; when there are no scheduled copies, do not adjust the ranking of K8S working nodes in the scoring stage, and use the K8S working node with the highest score in the scoring stage as the scheduling node; when there are scheduled copies, reduce the score of the scheduled K8S working node according to the proportion of the number of scheduled copies, thereby adjusting the ranking of the K8S working nodes obtained in the scoring stage.
[0075] Those skilled in the art know that, in addition to implementing the system, device and its various modules provided by the present invention in a purely computer-readable program code, it is entirely possible to implement the same program in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers and embedded microcontrollers by logically programming the method steps. Therefore, the system, device and its various modules provided by the present invention can be considered as a hardware component, and the modules included therein for implementing various programs can also be considered as structures within the hardware component; the modules for implementing various functions can also be considered as both software programs for implementing the method and structures within the hardware component.
[0076] The above describes the specific embodiments of the present invention. It should be understood that the present invention is not limited to the above specific embodiments, and those skilled in the art can make various changes or modifications within the scope of the claims, which does not affect the essence of the present invention. In the absence of conflict, the embodiments of the present application and the features in the embodiments can be combined with each other arbitrarily.
Claims
1. A scheduling method suitable for a hybrid architecture container cloud, characterized in that: include: Step 1: In the pre-filtering stage of scheduling, filter out the working nodes that do not match the application image architecture; Step 2: In the scoring stage of scheduling, the K8S working nodes are scored and sorted according to the hardware performance and the resource margin of the K8S working nodes; Step 3: In the planning and scoring stage, adjust the scoring and sorting results according to the information of the K8S working nodes that have been scheduled by the application to obtain the optimal application scheduling result; The step 3 includes: obtaining the distribution of K8S working nodes where the scheduled copies of the multi-copy application are located; When there are no scheduled replicas, the K8S work node ranking obtained in the scoring stage will not be adjusted, and the K8S work node with the highest score in the scoring stage will be used as the scheduling node; when there are scheduled replicas, the score of the scheduled K8S work node will be reduced according to the proportion of the scheduled replicas, thereby adjusting the K8S work node ranking obtained in the scoring stage.
2. The scheduling method applicable to a hybrid architecture container cloud according to claim 1, characterized in that: The step 1 comprises: Step 1.1: Get the image address from the application orchestration file, access the image address to obtain detailed information about the image, and parse out the operating system and hardware architecture supported by the image; Step 1.2: Traverse the candidate K8S work nodes, obtain the operating system and image architecture supported by the K8S work nodes, and if they are different from the operating system and hardware architecture supported by the application image, remove them from the candidate K8S work nodes; Step 1.3: After the traversal is completed, keep the K8S working nodes that match the application image architecture.
3. The scheduling method applicable to a hybrid architecture container cloud according to claim 1, characterized in that: The step 2 comprises: Step 2.1: Get the CPU main frequency and memory main frequency of the K8S working node, calculate the hardware performance by weighting the CPU main frequency and memory main frequency of the K8S working node, and score the K8S working node based on the hardware performance; Step 2.2: Get the CPU and unallocated memory of the K8S working node, weight the unallocated CPU and memory to get the K8S working node resource margin, and score the K8S working node based on the K8S working node resource margin; Step 2.3: Weight the K8S worker node scoring results of step 2.1 and step 2.2, and sort the K8S worker nodes according to the results; Step 2.4: Schedule the working nodes according to the sorting results.
4. The scheduling method applicable to a hybrid architecture container cloud according to claim 3, characterized in that: The step 2.4 includes: obtaining the working node where the existing copy of the application is running, and when it does not exist, scheduling the Pod to the K8S working node with the best ranking in step 2.3; when it exists, identifying its CPU model and memory model, and preferentially scheduling the Pod to the K8S working node with the same hardware; when there is no working node with the same hardware, identifying the CPU main frequency and memory main frequency of the working node where the existing copy is running, calculating the hardware performance through weighted calculation, and comparing it with the K8S working node performance obtained in step 2.1, according to the principle of performance proximity, preferentially scheduling the Pod to the K8S working node with the closest performance.
5. A scheduling system suitable for a hybrid architecture container cloud, characterized in that: include: Module M1: In the pre-filtering stage of scheduling, it filters out the working nodes that do not match the application image architecture; Module M2: In the scoring stage of scheduling, K8S working nodes are scored and sorted according to hardware performance and K8S working node resource margin; Module M3: In the planning and scoring stage, the scoring and sorting results are adjusted according to the information of the K8S working nodes that have been scheduled by the application to obtain the optimal application scheduling result; The module M3 includes: obtaining the distribution of K8S working nodes where the scheduled copies of the multi-copy application are located; When there are no scheduled replicas, the K8S work node ranking obtained in the scoring stage will not be adjusted, and the K8S work node with the highest score in the scoring stage will be used as the scheduling node; when there are scheduled replicas, the score of the scheduled K8S work node will be reduced according to the proportion of the scheduled replicas, thereby adjusting the K8S work node ranking obtained in the scoring stage.
6. The scheduling system for hybrid architecture container cloud according to claim 5, characterized in that: The module M1 comprises: Module M1.1: Get the image address from the application orchestration file, access the image address to obtain detailed information about the image, and parse the operating system and hardware architecture supported by the image; Module M1.2: Traverse the candidate K8S working nodes, obtain the operating system and image architecture supported by the K8S working nodes, and if they are different from the operating system and hardware architecture supported by the application image, remove them from the candidate K8S working nodes; Module M1.3: After the traversal is completed, the K8S working nodes that match the application image architecture are retained.
7. The scheduling system for hybrid architecture container cloud according to claim 5, characterized in that: The module M2 comprises: Module M2.1: Get the CPU main frequency and memory main frequency of the K8S working node, calculate the hardware performance by weighting the CPU main frequency and memory main frequency of the K8S working node, and score the K8S working node based on the hardware performance; Module M2.2: Get the CPU and unallocated memory of the K8S working node, weight the unallocated CPU and memory to get the K8S working node resource margin, and score the K8S working node based on the K8S working node resource margin; Module M2.3: Weight the K8S working node scoring results of modules M2.1 and M2.2, and sort the K8S working nodes according to the results; Module M2.4: Schedule working nodes according to the sorting results.
8. The scheduling system for hybrid architecture container cloud according to claim 7, characterized in that: The module M2.4 includes: obtaining the working node where the existing copy of the application is running, and when it does not exist, scheduling the Pod to the K8S working node with the best ranking in module M2.3; when it exists, identifying its CPU model and memory model, and preferentially scheduling the Pod to the K8S working node with the same hardware; when there is no working node with the same hardware, identifying the CPU main frequency and memory main frequency of the working node where the existing copy is running, calculating the hardware performance through weighted calculation, and comparing it with the K8S working node performance obtained in module M2.1, according to the principle of performance proximity, preferentially scheduling the Pod to the K8S working node with the closest performance.
