Pod scheduling method and device
By sorting and adjusting the Pods in the Kubernetes scheduling queue, the problems of low resource utilization and performance bottlenecks in the multi-GPU cluster environment in the prior art are solved, and more efficient resource utilization and scheduling performance are achieved.
Patent Information
- Application Number
- CN202411912861.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-03-07
AI Technical Summary
The default scheduling mechanism of existing Kubernetes lacks the perception of GPU topology in multi-GPU cluster environments, resulting in low resource utilization, performance bottlenecks and limited scalability.
By sorting and adjusting the Pods in the scheduling queue, ensuring that the pods of the same group are arranged continuously, determining whether the current resource meets the minimum number of replicas required for the normal operation of the group to which the Pod belongs. If it is not met, put the Pod in a waiting state and determine the processing method based on the user's custom conditions.
It improves the utilization efficiency and scheduling performance of cluster resources, ensures the normal scheduling of other packets, releases resources in a timely manner, and avoids resource waste.
Smart Images

Figure CN119576502A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a Pod scheduling method and device. Background Art
[0002] With the widespread use of Kubernetes in public clouds and enterprise IT systems, more and more developers are trying to use Kubernetes to run and manage workloads other than web applications and microservices. These typical scenarios include machine learning and deep learning training tasks, high-performance computing jobs, genetic computing workflows, and even traditional big data processing tasks. Developers hope to be able to use these heterogeneous devices in a Kubernetes cluster as simply as using CPU and memory.
[0003] To achieve this goal, building a unified container service platform around Kubernetes to manage various new computing resources, flexibly run various types of applications, and deliver services on demand to various operating environments (such as public clouds, data centers, edge nodes and even terminal devices) has become a development trend of cloud native technology.
[0004] In the prior art, the solution most similar to the present invention mainly relies on the default scheduling mechanism of Kubernetes. The default scheduling mechanism of Kubernetes mainly relies on resource demand and load balancing for scheduling. However, this method has obvious shortcomings in a multi-graphics processing unit (GPU) cluster environment, mainly manifested in the lack of perception of the GPU topology. This deficiency leads to the following problems:
[0005] 1. Low resource utilization: Due to the failure to fully consider the topological relationship between GPUs, task scheduling may cause some GPUs to be overloaded while other GPUs are idle, resulting in uneven resource utilization.
[0006] 2. Performance bottleneck: In tasks involving multiple GPUs working together, failure to optimize the data transmission path between GPUs may lead to increased communication delays, thereby affecting the overall computing performance.
[0007] 3. Limited scalability: With the diversification of heterogeneous computing resources, the existing scheduling mechanism is difficult to flexibly adapt to the scheduling requirements of different types of accelerators, which limits the application of Kubernetes in diversified computing environments. Summary of the invention
[0008] In view of this, the present application provides a Pod scheduling method and device to effectively improve the utilization efficiency and scheduling performance of cluster resources.
[0009] The first aspect of the present application provides a Pod scheduling method, including:
[0010] Sort all Pods in the scheduling queue according to the priority of the Pod to obtain the first scheduling queue;
[0011] If there are Pods with the same priority in the first scheduling queue, the order of the Pods with the same priority is adjusted according to the type of the Pod to obtain a second scheduling queue;
[0012] When the Pod in the second scheduling queue enters the scheduling phase, it is determined whether the current resources meet the minimum number of replicas required for the normal operation of the group to which the Pod belongs. Among them, Pods with the same label will be classified into the same group. The Pods in each group maintain the same priority.
[0013] If it is determined that the current resources do not meet the minimum number of replicas required for the normal operation of the group to which the Pod belongs, the Pod is placed in a waiting state;
[0014] For each Pod in the waiting state, determine the processing method of the Pod in the waiting state according to the custom conditions preset by the user;
[0015] If a Pod in a waiting state has not determined the processing method within the timeout period, the Pod in the waiting state and all Pods in the group to which the Pod in the waiting state belongs will be rejected for scheduling.
[0016] Optionally, when the Pod enters the scheduling phase, before determining whether the current resources meet the minimum number of copies required for the normal operation of the group of the Pod, the method further includes:
[0017] Get the total number of Pods in the group to which the Pod belongs;
[0018] If the total number of Pods in the group to which the Pod belongs is less than the minimum number of replicas required for the normal operation of the group to which the Pod belongs, the Pod is refused to enter the scheduling stage.
[0019] Optionally, the types of the Pods are divided into common Pods and grouped Pods. If there are Pods with the same priority in the first scheduling queue, the order of the Pods with the same priority is adjusted according to the types of the Pods to obtain the second scheduling queue, including:
[0020] If there are Pods of the same priority in the first scheduling queue, all common Pods and grouped Pods are sorted according to the creation time of the common Pods in the Pods of the same priority and the creation time of the group to which the grouped Pods belong;
[0021] If the creation time of common Pods is the same, they are sorted according to their IDs;
[0022] If the creation time of the groups to which the grouped Pods belong is the same, the grouped Pods are sorted according to the ID of the group to which they belong.
[0023] Optionally, the Pod scheduling method further includes:
[0024] Monitor the current resources in real time. If the current resources meet the minimum number of replicas required for the normal operation of the group to which the Pod belongs, all Pods in the group to which the Pod belongs will be scheduled uniformly.
[0025] Optionally, the Pod scheduling method further includes:
[0026] Monitor the current resources in real time. If the current resources meet the scheduling requirements of all Pods in the waiting state, all Pods in the waiting state will be uniformly scheduled and bound.
[0027] A second aspect of the present application provides a Pod scheduling device, including:
[0028] A first sorting unit is used to sort all Pods in the scheduling queue according to the priority of the Pod to obtain a first scheduling queue;
[0029] An adjusting unit, configured to adjust the order of the Pods with the same priority according to the type of the Pods if there are Pods with the same priority in the first scheduling queue, so as to obtain a second scheduling queue;
[0030] A judgment unit is used to judge whether the current resources meet the minimum number of replicas required for the normal operation of the group to which the Pod belongs when the Pod in the second scheduling queue enters the scheduling stage; wherein, Pods with the same label will be classified into the same group; and the Pods in each group maintain the same priority;
[0031] A setting unit, configured to place the Pod in a waiting state if the judging unit judges that the current resources do not meet the minimum number of copies required for the normal operation of the group to which the Pod belongs;
[0032] A determination unit is used to determine, for each Pod in the waiting state, a processing method for the Pod in the waiting state according to a custom condition preset by a user;
[0033] The scheduling unit is used to refuse to schedule the Pod in the waiting state and all Pods in the group to which the Pod in the waiting state belongs if the processing method of the Pod in the waiting state is not determined within a timeout period.
[0034] Optionally, the Pod scheduling device further includes:
[0035] The acquisition unit is used to obtain the total number of Pods in the group to which the Pod belongs;
[0036] The scheduling unit is further configured to refuse the Pod from entering the scheduling phase if the total number of Pods in the group to which the Pod belongs is less than the minimum number of replicas required for the normal operation of the group to which the Pod belongs.
[0037] Optionally, the adjustment unit includes:
[0038] A second sorting unit is used to sort all common Pods and grouped Pods according to the creation time of common Pods in the Pods with the same priority and the creation time of the group to which the grouped Pods belong if there are Pods with the same priority in the first scheduling queue;
[0039] The second sorting unit is further configured to sort the common Pods according to their IDs if the creation time of the common Pods is the same;
[0040] The second sorting unit is further configured to sort the Pods according to the IDs of the groups to which the Pods belong if the creation times of the groups to which the grouped Pods belong are the same.
[0041] Optionally, the Pod scheduling device further includes:
[0042] The scheduling unit is also used to monitor the current resources in real time. If the current resources meet the minimum number of copies required for the normal operation of the group to which the Pod belongs, all Pods in the group to which the Pod belongs are uniformly scheduled.
[0043] Optionally, the Pod scheduling device further includes:
[0044] The scheduling unit is also used to monitor the current resources in real time. If the current resources meet the scheduling of all Pods in the waiting state, all Pods in the waiting state are uniformly scheduled and bound.
[0045] A third aspect of the present application provides an electronic device, including:
[0046] one or more processors;
[0047] a storage device having one or more programs stored thereon;
[0048] When the one or more programs are executed by the one or more processors, the one or more processors implement the Pod scheduling method as described in any one of the first aspects.
[0049] A fourth aspect of the present application provides a computer storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the Pod scheduling method as described in any one of the first aspects is implemented.
[0050] As can be seen from the above scheme, the present application provides a Pod scheduling method and device, by adjusting the Pods in the scheduling queue, ensuring that the Pods of the same group are arranged continuously in the scheduling queue, and obtaining a second scheduling queue; when the Pods in the second scheduling queue enter the scheduling stage, if the current resources do not meet the minimum number of copies required for the normal operation of the group to which the Pod belongs, the Pod is placed in a waiting state; for each Pod in the waiting state, the processing method of the Pod in the waiting state is determined according to the user-preset custom conditions; if the processing method of the Pod in the waiting state is not determined within the timeout period, the Pod in the waiting state and all the Pods in the group to which the Pod in the waiting state belong are refused to be scheduled. By releasing resources in a timely manner, the resource utilization efficiency of the cluster is improved, and the normal scheduling of other groups is ensured. Effectively improve the utilization efficiency and scheduling performance of cluster resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0052] Figure 1 A specific flow chart of a Pod scheduling method provided in an embodiment of the present application;
[0053] Figure 2 A flowchart of a method for adjusting the order of Pods of the same priority according to the type of Pod provided in another embodiment of the present application;
[0054] Figure 3 A schematic diagram of a Pod scheduling device provided in another embodiment of the present application;
[0055] Figure 4 A schematic diagram of an electronic device for implementing a Pod scheduling method provided in another embodiment of the present application. DETAILED DESCRIPTION
[0056] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0057] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0058] It should be noted that the information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0059] It should be noted that the concepts such as "first" and "second" mentioned in this application are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0060] It should be noted that the modifications of "one" and "plurality" mentioned in the present application are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0061] First, the technical terms appearing in this application are explained:
[0062] Kubernetes, or K8s for short, is an abbreviation that uses the number 8 to replace the eight characters in the middle of the name, "ubernete". It is an open source platform for managing containerized applications on multiple hosts in a cloud platform. The goal of Kubernetes is to make the deployment of containerized applications simple and powerful. Kubernetes provides a mechanism for application deployment, planning, updating, and maintenance.
[0063] Pod is the smallest unit that can be created and managed in the K8s system. It is the smallest resource object model created or deployed by the user in the resource object model. It is also the resource object for running containerized applications on K8s. Other resource objects are used to support or extend the functions of Pod objects.
[0064] In the Prefilter stage, the role of Prefilter is to calculate some node information and filter out some nodes that obviously do not meet the requirements for the subsequent filter stage.
[0065] The present application embodiment provides a Pod scheduling method, such as Figure 1 As shown, the specific steps include:
[0066] S101. Sort all Pods in the scheduling queue according to the priority of the Pod to obtain a first scheduling queue.
[0067] Since the default scheduler cannot perceive the problem of Pod grouping, the present application ensures that Pods of the same group are arranged continuously in the scheduling queue through steps S101 and S102.
[0068] Optionally, in another embodiment of the present application, in the Prefilter stage, the present application adds a filtering condition to reduce invalid scheduling operations and improve scheduling performance. Before all Pods in the scheduling queue are sorted according to the priority of the Pod and the first scheduling queue is obtained, an implementation method of the Pod scheduling method further includes:
[0069] Get the total number of Pods in the group to which the Pod belongs; if the total number of Pods in the group to which the Pod belongs is less than the minimum number of replicas required for the normal operation of the group to which the Pod belongs, the Pod is refused to enter the scheduling stage.
[0070] The total number of Pods in the group to which the Pod belongs is obtained, including the currently running Pods.
[0071] It should be noted that in the actual application of this application, the name of each Pod Group and the minimum number of replicas required for normal operation are pre-set and are not limited here.
[0072] By refusing the Pod from entering the scheduling phase when the total number of Pods in the group to which the Pod belongs is less than the minimum number of replicas required for the normal operation of the group to which the Pod belongs, it effectively reduces unnecessary scheduling attempts and improves scheduling efficiency and performance.
[0073] S102: If there are Pods with the same priority in the first scheduling queue, the order of the Pods with the same priority is adjusted according to the type of the Pod to obtain a second scheduling queue.
[0074] It is understandable that in the specific implementation process of this application, a node will be reserved for each Pod.
[0075] Optionally, in another embodiment of the present application, an implementation of step S102 is as follows: Figure 2 As shown, including:
[0076] S201. If there are Pods of the same priority in the first scheduling queue, all ordinary Pods and grouped Pods are sorted according to the creation time of the ordinary Pods in the Pods of the same priority and the creation time of the group to which the grouped Pods belong.
[0077] S202. If the creation time of the common Pods is the same, the common Pods are sorted according to their IDs.
[0078] S203. If the creation time of the groups to which the grouped Pods belong is the same, the grouped Pods are sorted according to the IDs of the groups to which the grouped Pods belong.
[0079] It should be noted that steps S201 to S203 are only used as examples for illustration. In actual application, step S202 may be performed first, then step S203, and finally step S201. This is not limited here.
[0080] For example: For two Pods of the same priority in the first scheduling queue, if both Pods are ordinary Pods, they are sorted by creation time, and the one created first takes priority. If one Pod is an ordinary Pod and the other is a Pod in the same group, the creation time of the ordinary Pod and the creation time of the Pod in the same group are compared, and the one created first takes priority. If both Pods are grouped Pods, they are sorted by the creation time of the group. If the creation time is the same, they are distinguished by the auto-increment ID, and the one with the smaller ID takes priority.
[0081] The above sorting strategy ensures that Pods in the same group are arranged in order in the queue, avoiding the risk of scheduling deadlock.
[0082] S103: When the Pod in the second scheduling queue enters the scheduling phase, it is determined whether the current resources meet the minimum number of copies required for the normal operation of the group to which the Pod belongs.
[0083] Pods with the same label will be grouped together; Pods in each group will have the same priority. Labels can use the built-in Pod labels in K8s to determine whether Pods have the same mechanism, which is not limited here.
[0084] It is understandable that if there is no Pod with the same priority in the first scheduling queue, step S103 can be directly executed, that is, when the Pod in the first scheduling queue enters the scheduling stage, it is determined whether the current resources meet the minimum number of copies required for the normal operation of the group to which the Pod belongs.
[0085] The above label mechanism ensures that Pods in the same group (Pod Group) must maintain the same priority. This design ensures orderly scheduling and efficient use of resources.
[0086] Specifically, if it is determined that the current resources do not meet the minimum number of replicas required for the normal operation of the group to which the Pod belongs, step S104 is executed.
[0087] S104. Put the Pod in a waiting state.
[0088] S105: For each Pod in the waiting state, determine a processing method for the Pod in the waiting state according to a custom condition preset by the user.
[0089] The user-preset custom conditions include, but are not limited to, resource limit checks, Pod affinity / anti-affinity, custom business logic, security policy checks, waiting for other resources to be ready, load balancing policies, etc., which are not limited here.
[0090] Resource limit checks ensure that sufficient resources (such as CPU, memory) are available on the target node. Example: If the CPU usage of a node exceeds 80%, the Pod is rejected from being scheduled to that node.
[0091] Pod affinity / anti-affinity, by checking whether the Pod satisfies the node's affinity or anti-affinity rules. Example: ensuring that the Pod can only be scheduled to nodes with specific labels.
[0092] Customize business logic and define complex scheduling logic according to business needs. Example: Restrict specific types of Pods to be scheduled to certain nodes within a certain time period.
[0093] Security policy checks are used to ensure that Pods meet security policy requirements. Example: Refuse to schedule Pods without specific security labels to sensitive nodes.
[0094] Waiting for other resources to be ready, putting the Pod into a waiting state until certain conditions are met. Example: Waiting for dependent services to start before allowing Pod scheduling.
[0095] Load balancing strategy ensures load balancing between nodes. Example: If the number of Pods on a node exceeds the threshold, new Pods will be rejected from being scheduled to the node.
[0096] This application uses a delayed binding mechanism to allow users to customize conditions to determine the scheduling status of the Pod when the Pod enters the scheduling phase. By customizing conditions, it is determined whether the Pod is passed, rejected, or continues to wait. And by setting a timeout, the Permit plug-in can uniformly schedule all Pods in the group when resource conditions are met.
[0097] S106. If a processing method is not determined for a Pod in a waiting state within a timeout period, the Pod in the waiting state and all Pods in the group to which the Pod in the waiting state belongs are rejected for scheduling.
[0098] When a Pod in a waiting state has not determined the processing method within the timeout period, the Pod in the waiting state and all Pods in the group to which the Pod in the waiting state belongs will be refused to be scheduled, avoiding long-term invalid waiting and effectively avoiding the waste of resources. By releasing resources in time, the resource utilization efficiency of the cluster is improved, ensuring the normal scheduling of other groups.
[0099] Optionally, in the actual application process of the present application, an implementation of the Pod scheduling method further includes:
[0100] Monitor the current resources in real time. If the current resources meet the scheduling of all Pods in the waiting state, all Pods in the waiting state will be uniformly scheduled and bound to ensure the normal operation of the group.
[0101] In the actual application process of this application, the NVML interface of NVIDIA can be used, but not limited to, to automatically collect and analyze the physical and logical topology information of the GPU. Provide real-time GPU communication bandwidth and latency data to provide basic support for scheduling decisions. Then, combine the GPU topology structure and task requirements, and use a heuristic algorithm to generate the optimal task scheduling strategy. Dynamically adjust the scheduling strategy to adapt to changes in cluster resources and improve the responsiveness of the system. This application is optimized based on actual hardware configuration and communication performance, rather than relying on a preset static model. Compared with the prior art, the present invention can more effectively identify and utilize high-bandwidth connections between GPUs and reduce communication delays in task execution.
[0102] This application can be, but is not limited to, a custom scheduler interface based on Kubernetes to ensure that tasks can be accurately assigned to appropriate GPU nodes according to scheduling strategies. It also supports multi-task parallel scheduling and optimizes resource allocation and utilization.
[0103] This application ensures the efficiency and reliability of the scheduling process through a closed-loop process from topology information collection to task execution. This application not only provides a complete scheduling mechanism, but also provides a corresponding feedback mechanism to ensure the stable operation of the system in a dynamic environment.
[0104] As can be seen from the above scheme, the present application provides a scheduling method for Pods, by adjusting the Pods in the scheduling queue to ensure that the Pods of the same group are arranged continuously in the scheduling queue to obtain a second scheduling queue; when the Pods in the second scheduling queue enter the scheduling stage, if the current resources do not meet the minimum number of copies required for the normal operation of the group to which the Pod belongs, the Pod is placed in a waiting state; for each Pod in a waiting state, the processing method of the Pod in a waiting state is determined according to the user-preset custom conditions; if a Pod in a waiting state does not determine the processing method within the timeout period, the Pod in a waiting state and all Pods in the group to which the Pod in a waiting state belong are refused to be scheduled. By releasing resources in a timely manner, the resource utilization efficiency of the cluster is improved, ensuring the normal scheduling of other groups. Effectively improve the utilization efficiency and scheduling performance of cluster resources.
[0105] The present application embodiment provides a Pod scheduling device, such as Figure 3 As shown, specifically including:
[0106] The first sorting unit 301 is used to sort all Pods in the scheduling queue according to the priority of the Pod to obtain a first scheduling queue.
[0107] The adjusting unit 302 is used to adjust the order of the Pods with the same priority according to the type of the Pods if there are Pods with the same priority in the first scheduling queue, so as to obtain a second scheduling queue.
[0108] The judging unit 303 is used to judge whether the current resources meet the minimum number of copies required for the normal operation of the group to which the Pod belongs when the Pod in the second scheduling queue enters the scheduling stage.
[0109] Pods with the same label are grouped together, and Pods in each group maintain the same priority.
[0110] The setting unit 304 is used to put the Pod into a waiting state if the judging unit 303 judges that the current resources do not meet the minimum number of copies required for the normal operation of the group to which the Pod belongs.
[0111] The determination unit 305 is used to determine, for each Pod in the waiting state, a processing method for the Pod in the waiting state according to a user-defined condition preset by the user.
[0112] The scheduling unit 306 is used to refuse to schedule the Pod in the waiting state and all Pods in the group to which the Pod in the waiting state belongs if the processing method of the Pod in the waiting state is not determined within the timeout period.
[0113] For the specific working process of the units disclosed in the above embodiments of the present application, please refer to the corresponding method embodiments, such as Figure 1 As shown, no further description is given here.
[0114] Optionally, in another embodiment of the present application, an implementation of the Pod scheduling device further includes:
[0115] The acquisition unit is used to obtain the total number of Pods in the group to which the Pod belongs.
[0116] The scheduling unit is also used to refuse the Pod from entering the scheduling stage if the total number of Pods in the group to which the Pod belongs is less than the minimum number of replicas required for the normal operation of the group to which the Pod belongs.
[0117] The specific working process of the units disclosed in the above embodiments of the present application can be found in the corresponding method embodiments, which will not be repeated here.
[0118] Optionally, in another embodiment of the present application, an implementation of the adjustment unit 302 specifically includes:
[0119] The second sorting unit is used to sort all ordinary Pods and grouped Pods according to the creation time of the ordinary Pods in the Pods with the same priority and the creation time of the group to which the grouped Pods belong if there are Pods with the same priority in the first scheduling queue.
[0120] The second sorting unit is further used to sort the common Pods according to their IDs if the creation time of the common Pods is the same.
[0121] The second sorting unit is further configured to sort the grouped Pods according to the ID of the group to which the grouped Pods belong if the creation time of the groups to which the grouped Pods belong is the same.
[0122] For the specific working process of the units disclosed in the above embodiments of the present application, please refer to the corresponding method embodiments, such as Figure 2 As shown, no further description is given here.
[0123] Optionally, in another embodiment of the present application, an implementation of the Pod scheduling device further includes:
[0124] The scheduling unit is also used to monitor the current resources in real time. If the current resources meet the minimum number of copies required for the normal operation of the group to which the Pod belongs, all Pods in the group to which the Pod belongs will be scheduled uniformly.
[0125] The specific working process of the units disclosed in the above embodiments of the present application can be found in the corresponding method embodiments, which will not be repeated here.
[0126] Optionally, in another embodiment of the present application, an implementation of the Pod scheduling device further includes:
[0127] The scheduling unit is also used to monitor the current resources in real time. If the current resources meet the scheduling of all Pods in the waiting state, all Pods in the waiting state will be uniformly scheduled and bound.
[0128] The specific working process of the units disclosed in the above embodiments of the present application can be found in the corresponding method embodiments, which will not be repeated here.
[0129] As can be seen from the above scheme, the present application provides a scheduling device for Pods, which adjusts the Pods in the scheduling queue to ensure that the Pods of the same group are arranged continuously in the scheduling queue to obtain a second scheduling queue; when the Pods in the second scheduling queue enter the scheduling stage, if the current resources do not meet the minimum number of copies required for the normal operation of the group to which the Pod belongs, the Pod is placed in a waiting state; for each Pod in the waiting state, the processing method of the Pod in the waiting state is determined according to the user-preset custom conditions; if the processing method of the Pod in the waiting state is not determined within the timeout period, the Pod in the waiting state and all the Pods in the group to which the Pod in the waiting state belong are refused to be scheduled. By releasing resources in a timely manner, the resource utilization efficiency of the cluster is improved, ensuring the normal scheduling of other groups. Effectively improve the utilization efficiency and scheduling performance of cluster resources.
[0130] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0131] Another embodiment of the present application provides an electronic device, such as Figure 4 As shown, including:
[0132] One or more processors 401 .
[0133] The storage device 402 stores one or more programs.
[0134] When the one or more programs are executed by the one or more processors 401, the one or more processors 401 implement the Pod scheduling method as described in any one of the above embodiments.
[0135] Another embodiment of the present application provides a computer storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the Pod scheduling method as described in any one of the above embodiments is implemented.
[0136] In the context of the present application, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0137] It should be noted that the computer-readable medium mentioned above in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than computer readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0138] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0139] Another embodiment of the present application provides a computer program product, which, when executed, is used to execute the above-mentioned Pod scheduling method.
[0140] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via a communication device, or installed from a storage device, or installed from a ROM. When the computer program is executed by a processing device, the above-mentioned functions defined in the method of the embodiment of the present application are executed.
[0141] Although the subject matter has been described in language specific to structural features and / or method logic actions, it should be understood that the subject matter defined in this application is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing this application.
[0142] Although several specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present application. Certain features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination.
[0143] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of application involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above application concept. For example, the above features are replaced with (but not limited to) technical features with similar functions applied in the present application.
Claims
1. A Pod scheduling method, characterized in that: include: Sort all Pods in the scheduling queue according to the priority of the Pod to obtain the first scheduling queue; If there are Pods with the same priority in the first scheduling queue, the order of the Pods with the same priority is adjusted according to the type of the Pod to obtain a second scheduling queue; When the Pod in the second scheduling queue enters the scheduling phase, it is determined whether the current resources meet the minimum number of replicas required for the normal operation of the group to which the Pod belongs. Among them, Pods with the same label will be classified into the same group. The Pods in each group maintain the same priority. If it is determined that the current resources do not meet the minimum number of replicas required for the normal operation of the group to which the Pod belongs, the Pod is placed in a waiting state; For each Pod in the waiting state, determine the processing method of the Pod in the waiting state according to the custom conditions preset by the user; If a Pod in a waiting state has not determined the processing method within the timeout period, the Pod in the waiting state and all Pods in the group to which the Pod in the waiting state belongs will be refused to be scheduled.
2. The Pod scheduling method according to claim 1, characterized in that: When the Pod enters the scheduling phase, before determining whether the current resources meet the minimum number of copies required for the normal operation of the group of the Pod, it also includes: Get the total number of Pods in the group to which the Pod belongs; If the total number of Pods in the group to which the Pod belongs is less than the minimum number of replicas required for the normal operation of the group to which the Pod belongs, the Pod is refused to enter the scheduling stage.
3. The Pod scheduling method according to claim 1, characterized in that: The types of the Pods are divided into common Pods and grouped Pods. If there are Pods with the same priority in the first scheduling queue, the order of the Pods with the same priority is adjusted according to the types of the Pods to obtain a second scheduling queue, including: If there are Pods of the same priority in the first scheduling queue, all common Pods and grouped Pods are sorted according to the creation time of the common Pods in the Pods of the same priority and the creation time of the group to which the grouped Pods belong; If the creation time of common Pods is the same, they are sorted according to their IDs; If the creation time of the groups to which the grouped Pods belong is the same, the grouped Pods are sorted according to the ID of the group to which they belong.
4. The Pod scheduling method according to claim 1, characterized in that: Also includes: Monitor the current resources in real time. If the current resources meet the minimum number of replicas required for the normal operation of the group to which the Pod belongs, all Pods in the group to which the Pod belongs will be scheduled uniformly.
5. The Pod scheduling method according to claim 1, characterized in that: Also includes: Monitor the current resources in real time. If the current resources meet the scheduling requirements of all Pods in the waiting state, all Pods in the waiting state will be uniformly scheduled and bound.
6. A Pod scheduling device, characterized in that: include: A first sorting unit is used to sort all Pods in the scheduling queue according to the priority of the Pod to obtain a first scheduling queue; An adjusting unit, configured to adjust the order of the Pods with the same priority according to the type of the Pods if there are Pods with the same priority in the first scheduling queue, so as to obtain a second scheduling queue; A judgment unit is used to judge whether the current resources meet the minimum number of replicas required for the normal operation of the group to which the Pod belongs when the Pod in the second scheduling queue enters the scheduling stage; wherein, Pods with the same label will be classified into the same group; and the Pods in each group maintain the same priority; A setting unit, configured to place the Pod in a waiting state if the judging unit judges that the current resources do not meet the minimum number of copies required for the normal operation of the group to which the Pod belongs; A determination unit is used to determine, for each Pod in the waiting state, a processing method for the Pod in the waiting state according to a custom condition preset by a user; The scheduling unit is used to refuse to schedule the Pod in the waiting state and all Pods in the group to which the Pod in the waiting state belongs if the processing method of the Pod in the waiting state is not determined within a timeout period.
7. The Pod scheduling device according to claim 6, characterized in that: Also includes: The acquisition unit is used to obtain the total number of Pods in the group to which the Pod belongs; The scheduling unit is further configured to refuse the Pod from entering the scheduling phase if the total number of Pods in the group to which the Pod belongs is less than the minimum number of replicas required for the normal operation of the group to which the Pod belongs.
8. The Pod scheduling device according to claim 6, characterized in that: The adjustment unit comprises: A second sorting unit is used to sort all common Pods and grouped Pods according to the creation time of common Pods in the Pods with the same priority and the creation time of the group to which the grouped Pods belong if there are Pods with the same priority in the first scheduling queue; The second sorting unit is further configured to sort the common Pods according to their IDs if the creation time of the common Pods is the same; The second sorting unit is further configured to sort the Pods according to their IDs if the creation times of the groups to which the grouped Pods belong are the same.
9. The Pod scheduling device according to claim 6, characterized in that: Also includes: The scheduling unit is also used to monitor the current resources in real time. If the current resources meet the minimum number of copies required for the normal operation of the group to which the Pod belongs, all Pods in the group to which the Pod belongs are uniformly scheduled.
10. The Pod scheduling device according to claim 6, characterized in that: Also includes: The scheduling unit is also used to monitor the current resources in real time. If the current resources meet the scheduling of all Pods in the waiting state, all Pods in the waiting state are uniformly scheduled and bound.