A node scheduling method, device and storage medium

By introducing user-configured scheduling strategies and node screening and scoring mechanisms in cloud native technology, the problem of insufficient flexibility in container group scheduling in the existing technology is solved, and more flexible and adaptable container group scheduling is achieved.

CN119324924BActive Publication Date: 2025-04-25ZHEJIANG DAHUA TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411867918.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-18
Publication Date
2025-04-25
Estimated Expiration
2044-12-18

AI Technical Summary

Technical Problem

In the field of cloud-native technology, existing node scheduling methods have poor scheduling flexibility for different container groups, making it difficult to adapt to multiple business scenarios.

Method used

Provide a node scheduling method, by obtaining the scheduling policy configured by the user, selecting appropriate candidate nodes based on the node filtering conditions and scoring policies in the policy, and scheduling the target container group to the target node.

Benefits of technology

Improve the flexibility of container group scheduling, so that different container groups can be flexibly scheduled according to their specific scheduling strategies and adapted to more business scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119324924B_ABST
    Figure CN119324924B_ABST
Patent Text Reader

Abstract

The present application discloses a node scheduling method, device and storage medium, the method comprising: obtaining a scheduling strategy corresponding to a target container group, wherein the scheduling strategy is configured by a user; selecting a number of candidate nodes from a cluster based on the node screening conditions in the scheduling strategy; obtaining a scheduling score for each of the candidate nodes based on the scoring strategy in the scheduling strategy; selecting a target node from the candidate nodes using the scheduling score, and scheduling the target container group to the target node. Through the above method, the present application can improve the flexibility of container group scheduling.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of cloud native technology, and in particular to a node scheduling method, device, and storage medium. Background Art

[0002] In the field of cloud native technology, the Kubernetes (container orchestration) native scheduling framework supports scheduling container groups in a cluster to specified nodes. However, the general node scheduling method is to schedule the target container groups in all projects according to the same scheduling strategy. In this process, the flexibility of node scheduling for different container groups is poor. Summary of the invention

[0003] The main technical problem solved by the present application is to provide a node scheduling method, device and storage medium, which can improve the flexibility of container group scheduling.

[0004] To solve the above technical problems, a technical solution adopted in the present application is: to provide a node scheduling method, the method comprising: obtaining a scheduling policy corresponding to a target container group, wherein the scheduling policy is configured by a user; selecting a number of candidate nodes from a cluster based on a node screening condition in the scheduling policy; obtaining a scheduling score for each candidate node based on a scoring strategy in the scheduling policy; selecting a target node from a number of candidate nodes using the scheduling score, and scheduling the target container group to the target node.

[0005] In order to solve the above technical problems, another technical solution adopted by the present application is: to provide an electronic device, the electronic device includes a memory and a processor, the memory stores program instructions, and the processor is used to execute the program instructions to implement the above node scheduling method.

[0006] In order to solve the above technical problems, another technical solution adopted by the present application is: providing a computer-readable storage medium, which is used to store program instructions, and the program instructions can be executed to implement the above node scheduling method.

[0007] The above scheme obtains the scheduling policy corresponding to the target container group, wherein the scheduling policy is obtained through user configuration. Based on the node screening conditions in the scheduling policy, several candidate nodes are selected from the cluster. Based on the scoring strategy in the scheduling policy, the scheduling score of each candidate node is obtained. Using the scheduling score, a target node is selected from several candidate nodes, and the target container group is scheduled to the target node. Compared with the use of a preset unified scheduling policy to schedule all container groups, the present application scheme allows users to configure corresponding scheduling policies for different target container groups, and schedule different target container groups based on the corresponding scheduling policies, thereby achieving more flexible scheduling of different container groups and being able to adapt to more business scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] Figure 1 It is a flowchart of an embodiment of a node scheduling method provided by the present application;

[0009] Figure 2 It is a schematic diagram of the structure of the node scheduling method provided by this application;

[0010] Figure 3 This is a partial flow diagram of a node scheduling method and a scheduling strategy provided by this application;

[0011] Figure 4 This is a partial flow chart of another embodiment of the node scheduling method provided by the present application;

[0012] Figure 5 It is a flowchart of an embodiment of a node scheduling device of the present application;

[0013] Figure 6 It is a schematic diagram of the framework of an embodiment of the electronic device of the present application;

[0014] Figure 7 It is a schematic diagram of a framework of an embodiment of a computer-readable storage medium of the present application. DETAILED DESCRIPTION

[0015] In order to make the purpose, technical solution and effect of the present application clearer and more specific, the present application is further described in detail below with reference to the accompanying drawings and examples.

[0016] It should be noted that the term "several" in this article means at least one, and the terms "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. The term "and / or" is only a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the previous and subsequent associated objects are in an "or" relationship. In addition, the term "at least one" in this article means any combination of at least two of any one or more of a plurality of types. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C.

[0017] See also Figure 1 , Figure 1 is a flowchart of an embodiment of a node scheduling method provided by the present application. It should be noted that if there are substantially the same results, this embodiment is not based on Figure 1 The process sequence shown is limited. Figure 1 As shown, this embodiment includes:

[0018] Step S11: Obtain the scheduling policy corresponding to the target container group, wherein the scheduling policy is configured by the user.

[0019] The scheduling strategy in this article refers to the strategy for assigning the target container group to the appropriate node. Each project can contain multiple namespaces to achieve effective isolation between different users. Each project or namespace will follow the corresponding scheduling strategy to assign the target container group to the appropriate node. Among them, the user can configure the scheduling strategy in the configuration file. In one embodiment, the scheduling strategy can be formulated for different projects or namespaces. That is, the user can customize the scheduling strategy at the project level or namespace dimension.

[0020] Each project contains several target container groups, and the scheduling policies of these target container groups follow the scheduling policies configured for the project. In other words, each target container group within the project will be allocated to a suitable target node according to the scheduling policy of the project. In one embodiment, the scheduling policy corresponding to the target container group comes from the configuration file of the project associated with the target container group, wherein the configuration files of different projects are different, and the configuration files are configured by the user.

[0021] Among them, the corresponding configuration file can be called through the scheduling plug-in, environment variable configuration or configuration file path configuration, and the corresponding scheduling strategy can be obtained from the configuration file. In one embodiment, the scheduling plug-in can maintain a configuration file independently for each project, and the user can customize the scheduling strategy by adjusting the configuration file.

[0022] The configuration file can be maintained in a unified management manner. In one embodiment, the configuration file is in the form of ConfigMap. The naming of the configuration file includes the name of the target project, and is stored in the preset namespace corresponding to the container orchestration and management platform. The preset namespace is used to store objects created by the container orchestration and management platform. In a specific embodiment, the configuration file is maintained in the form of ConfigMap, and the naming format of the configuration file is "topologyorder-project name". For example, if the name of the target project is a, then the name of the configuration file corresponding to the target project is "topologyorder-a", and the target file is stored in the kube-system namespace. Among them, the kube-system namespace is used to store the preset namespace corresponding to the container orchestration and management platform, and the configuration file corresponding to each project can be stored as an object in the preset namespace.

[0023] Different scheduling strategies can be configured in the configuration file, and the target container group can select the above different scheduling strategies as needed. In one embodiment, the scheduling strategy is selected from a specific scheduling strategy and a default scheduling strategy, and the specific scheduling strategy has a higher priority than the default scheduling strategy.

[0024] In a specific implementation, a configuration file of a target project associated with the target container group is obtained, and the configuration file includes a specific part and a default part. In response to the target container group meeting the first container group screening condition in the specific part, a specific scheduling policy in the specific part is obtained as the scheduling policy corresponding to the target container group. In response to the target container group not meeting the first container group screening condition, a default scheduling policy in the default part is obtained as the scheduling policy corresponding to the target container group. Alternatively, in response to the target container group not meeting the first container group screening condition, if the default part includes a second container group screening condition, in response to the target container group meeting the second container group screening condition, a default scheduling policy in the default part is obtained as the scheduling policy corresponding to the target container group.

[0025] The target container group's representation information, resource status, resource quota and limit, container group configuration, or dependency between container groups may be used to match the first container screening condition or the second container screening condition, thereby determining the scheduling strategy corresponding to the target container group. In a specific implementation, whether the target container group meets the first container group screening condition or the second container group screening condition is determined by matching the target container group's representation information with the first container group screening condition or the second container group screening condition, and the representation information includes at least one of the following: a label, a label expression, and an annotation.

[0026] Combination Figure 2 To illustrate with an example, Figure 2 It is a structural schematic diagram of the node scheduling method provided in this application. When the target container group is scheduled, the scheduling plug-in will give priority to calling the relevant configuration in the specific scheduling policy. When the target container group does not meet the first container filtering condition of the container selector in the specific scheduling policy, the scheduling plug-in will fall back to the default scheduling policy and call the relevant configuration in the default scheduling policy. In the default scheduling policy, the container selector is configured with a second container filtering condition, and the target container group matches the second container filtering condition, the scheduling plug-in will select the default scheduling policy as the scheduling policy corresponding to the target container group. In the default scheduling policy, when the container selector is not configured with any filtering conditions, the scheduling plug-in will select the default scheduling policy as the scheduling policy corresponding to the target container group.

[0027] Step S12: Based on the node screening conditions in the scheduling strategy, select several candidate nodes from the cluster.

[0028] The cluster in this article refers to a group of physical or virtual computing resources (such as servers, virtual machines, etc.) connected through a network to form a logically unified whole that can jointly provide services to the outside world. The cluster includes a node pool, that is, several candidate nodes can be selected from the node pool of the cluster.

[0029] As mentioned above, the scheduling strategy in the configuration file can be configured by the user. In one embodiment, the node screening condition includes the hard affinity of the node. Taking the hard affinity of the node as an example, the user can adjust the hard affinity of the node by adjusting the relevant configuration in the topology selector. For example, the user can configure hard affinity attributes for the node, and these attributes will serve as the basis for node screening. At the same time, in the topology selector, the user can set the corresponding node screening conditions. When performing node screening, the hard affinity attributes of each node in the node pool will be matched with the node screening conditions set in the topology selector to determine the candidate nodes that meet the node screening conditions.

[0030] In another embodiment, before selecting several candidate nodes from the cluster based on the node screening conditions in the scheduling strategy, it also includes: performing preliminary screening of the nodes in the cluster through a node selector. That is, the node selector is used to preliminarily screen out several matching nodes in the cluster, and based on the node screening conditions in the scheduling strategy, the several matching nodes in the cluster are screened again to determine the corresponding candidate nodes. For example, the node's characterization information, resource constraints or stains and tolerances can be used to match the node selector to determine several preliminarily matching nodes in the cluster. In a specific embodiment, whether the nodes in the cluster meet the screening conditions in the node selector can be obtained by matching the node's characterization information with the screening conditions in the node selector, and the characterization information includes at least one of the following: labels, label expressions, and annotations.

[0031] Continue to combine Figure 2 For example, when the scheduling strategy is a specific scheduling strategy, the node selector is used to preliminarily screen out several matching nodes. In the scheduler rule, the topology selector can configure the hard affinity of the node, and determine several candidate nodes from the several matching nodes preliminarily screened out in the cluster through the node screening conditions in the topology selector. When the scheduling strategy is the default scheduling strategy, the node selector is used to preliminarily screen out several matching nodes, and several candidate nodes are determined from the several matching nodes preliminarily screened out according to the node screening conditions in the scheduler rule.

[0032] Step S13: Based on the scoring strategy in the scheduling strategy, the scheduling score of each candidate node is obtained.

[0033] The scoring strategy in this article can directly score each candidate node or perform weighted scoring on each candidate node to obtain the scheduling score of each candidate node. In one embodiment, based on the scoring strategy in the scheduling strategy, the scheduling score of each candidate node is obtained, including: sorting each candidate node according to the node sorting requirements in the scoring strategy. Score each sorted candidate node to obtain the scheduling score of each candidate node. Among them, the scheduling score is a value obtained after comprehensive consideration of the characteristics of each candidate node. For example, weighted scoring can be performed according to the node sorting requirements of each candidate node configured by the user, and the corresponding weighted score can be obtained, and the weighted score can be used as the corresponding scheduling score.

[0034] In a specific implementation, the scoring strategy includes node sorting requirements and scoring rules configured by the user, each candidate node is sorted according to the node sorting requirements, and different weights are assigned based on the sorting order of each candidate node. Combined with the weight and scoring rules corresponding to each candidate node, each candidate node is scored to obtain the scheduling score corresponding to each candidate node.

[0035] In another specific implementation, a basic score of each candidate node may be obtained based on a scoring rule, and the basic score may be combined with a corresponding weight to obtain a scheduling score corresponding to each candidate node.

[0036] Continue to combine Figure 2 For example, when the scheduling strategy corresponding to the target container group is a specific scheduling strategy, each candidate node is sorted according to the node sorting requirements configured by the user, and different weights are assigned based on the sorting order, where the node order represents the priority order of the nodes. For example, when the candidate nodes are A, B, and C, and the user-defined node sorting requirements are B, A, and C, the candidate nodes are sorted in the order of B, A, and C, and different weights are assigned to the above candidate nodes, for example, the weight assigned to B is higher than the weight assigned to A. Combined with the weights and scoring rules corresponding to each candidate node, score each candidate node to obtain the scheduling score corresponding to each candidate node. For example, the weight of candidate node A is 0.8, and the basic score is 90, then the scheduling score is 72 (the product of the weight and the basic score). The rest of the candidate nodes are analogous. The means of combining the basic score with the corresponding weight can be modified according to specific needs, and there is no restriction here.

[0037] Step S14: using the scheduling score, selecting a target node from a number of candidate nodes, and scheduling the target container group to the target node.

[0038] The target node is determined by the comprehensive scheduling score and ranking. In one embodiment, the scheduling scores of the candidate nodes may be ranked. When the candidate node with the highest scheduling score is unique, the candidate node is selected as the corresponding target node. When the candidate node with the highest scheduling score is not unique, a candidate node is randomly selected as the corresponding target node. A candidate node may be randomly selected as the corresponding target node by a random number generator, a hash function, a weighted random selection, or the like.

[0039] In one embodiment, before selecting a target node from a plurality of candidate nodes using the scheduling score, the method further includes: for each candidate node, based on the container group relationship condition in the scheduling strategy, searching for an associated container group having a preset container group relationship with the target container group from each container group on the candidate node. Based on the number of associated container groups of each candidate node, the scheduling score corresponding to each candidate node is modified.

[0040] The scheduling score may be modified using the affinity relationship of the node, the priority and preemption of the target container group, a custom scheduler, and resource requests and restrictions. In one embodiment, the preset container group relationship includes a soft affinity relationship, the associated container group includes a first associated container group having a soft affinity relationship with the target container group, and the score correction value of the candidate node is positively correlated with the number of the first associated container groups.

[0041] In another embodiment, an anti-soft affinity relationship between target container groups may also be considered. For example, the preset container group relationship includes an anti-soft affinity relationship, the associated container group includes a second associated container group having an anti-soft affinity relationship with the target container group, and the score correction value of the candidate node is negatively correlated with the number of the second associated container groups.

[0042] For example, the preset container group relationship includes an affinity relationship and an anti-soft affinity relationship, and the associated container group includes a first associated container group and a second associated container group. Among them, the number of first associated container groups is three, and the number of second associated container groups is two. In the case where the scheduling score of the candidate node is 90, based on the fact that the number of first associated container groups is three and the number of second associated container groups is two, the scheduling score can be corrected and increased by one point (there are three positively correlated first associated container groups and two negatively correlated second associated container groups), and the final scheduling score is 91 points. The above-mentioned specific means of correcting the scheduling score according to the number of associated container groups can be modified as needed and is not limited here.

[0043] When the scheduling score is corrected, the corrected scheduling score and ranking are combined to determine the corresponding target node. For specific instructions, please refer to the relevant instructions for determining the corresponding target node by combining the scheduling score and ranking.

[0044] In this embodiment, the above method can be applied to a cloud native platform, a big data processing framework, or a container orchestration. For example, it can be applied to Kubernetes (container orchestration). In the container cloud business scenario, the target container group is mainly scheduled to the target node by the scheduler. Specifically, the scheduling policy corresponding to the target container group can be configured by using the scheduling plug-in in the scheduler, and the target container group can be scheduled to the target node by the scheduling policy.

[0045] In one embodiment, the step of obtaining the scheduling strategy corresponding to the target container group is performed in the pre-filtering stage, the step of selecting several candidate nodes from the cluster based on the node screening conditions in the scheduling strategy is performed in the filtering stage, the step of obtaining the scheduling score of each candidate node based on the scoring strategy in the scheduling strategy to the number of associated container groups based on each candidate node, and respectively correcting the scheduling score corresponding to each candidate node is performed in the scoring stage, the step of selecting the target node from several candidate nodes using the scheduling score is performed in the resource reservation stage, and the step of scheduling the target container group to the target node is performed in the binding stage. In a specific embodiment, before selecting the target node from several candidate nodes using the scheduling score, it also includes: in the normalized scoring stage, the corrected scheduling scores of each candidate node are unified to a preset value range.

[0046] Combination Figure 3 To illustrate with an example, Figure 3 It is a partial flow chart of the node scheduling method-scheduling strategy provided by the present application. Step S31: Pre-filtering stage, obtain the scheduling strategy corresponding to the target container group. Step S32: Filtering stage, based on the node screening conditions in the scheduling strategy, select several candidate nodes from the cluster. Step S33: Pre-scoring stage, pre-process the target container group and several candidate nodes. Step S34: Scoring stage, based on the scoring strategy in the scheduling strategy, obtain the scheduling score of each candidate node to the number of associated container groups based on each candidate node, and correct the scheduling score corresponding to each candidate node respectively. Step S35: Standard scoring stage, unify the corrected scheduling score of each candidate node to within the preset numerical range. Step S36: Permission stage, allow the target container group to be bound to the target node. Step S37: Binding stage, schedule the target container group to the target node.

[0047] The method of this embodiment obtains the scheduling policy corresponding to the target container group, wherein the scheduling policy is obtained through user configuration. Based on the node screening conditions in the scheduling policy, several candidate nodes are selected from the cluster. Based on the scoring strategy in the scheduling policy, the scheduling score of each candidate node is obtained. Using the scheduling score, a target node is selected from several candidate nodes, and the target container group is scheduled to the target node. Compared with the use of a preset unified scheduling policy to schedule all container groups, the present application scheme allows users to configure corresponding scheduling policies for different target container groups, and schedule different target container groups based on the corresponding scheduling policies, thereby achieving more flexible scheduling of different container groups and being able to adapt to more business scenarios.

[0048] See also Figure 4 , Figure 4 This is a partial flow chart of another embodiment of the node scheduling method provided by the present application.

[0049] Step S41, determine whether the target container group matches the first container group screening condition of the container group selector in the specific scheduling policy. If the target container group matches the first container group screening condition, execute step S42, and use the matching scheduling policy as the scheduling policy corresponding to the target container group. If the target container group does not match the first container group screening condition, execute step S43, determine whether the target container group matches the second container group screening condition of the container group selector in the default scheduling policy. If the target container group matches the second container group screening condition, execute step S42, and use the matching scheduling policy as the scheduling policy corresponding to the target container group. After executing step S42, execute step S44, select several candidate nodes from the cluster based on the node screening condition in the scheduling policy. Execute step S45, and score each candidate node in order from top to bottom according to the configured node sorting requirements. Execute step S46, determine whether each candidate node has a matching associated container group. If there is a matching associated container group, execute step S47, and modify the scheduling score corresponding to each candidate node based on the number of associated container groups of each candidate node. Step S48 is executed to output the scheduling score finally corresponding to each candidate node. If the target container group does not match the second container group screening condition or there is no matching associated container group, step S48 is executed.

[0050] See also Figure 5 , Figure 5It is a flow chart of an embodiment of a node scheduling device of the present application. The node scheduling device 500 includes a scheduling strategy acquisition module 510, a candidate node acquisition module 520, a scheduling score acquisition module 530, and a target node determination module 540. The scheduling strategy acquisition module 510 is used to obtain the scheduling strategy corresponding to the target container group, wherein the scheduling strategy is configured by the user. The candidate node acquisition module 520 is used to select a number of candidate nodes from the cluster based on the node screening conditions in the scheduling strategy. The scheduling score acquisition module 530 is used to obtain the scheduling score of each candidate node based on the scoring strategy in the scheduling strategy. The target node determination module 540 is used to select a target node from a number of candidate nodes using the scheduling score, and schedule the target container group to the target node.

[0051] In some embodiments, the scheduling policy is selected from a specific scheduling policy and a default scheduling policy, and the priority of the specific scheduling policy is higher than the default scheduling policy.

[0052] In some embodiments, the scheduling policy comes from a configuration file of a target project associated with the target container group, wherein the configuration files of different projects are different and the configuration files are configured by a user.

[0053] In some embodiments, the scheduling policy acquisition module 510 performs the acquisition of the scheduling policy corresponding to the target container group, specifically including: acquiring a configuration file of the target project associated with the target container group, the configuration file including a specific part and a default part; in response to the target container group meeting a first container group screening condition in the specific part, acquiring a specific scheduling policy in the specific part as the scheduling policy corresponding to the target container group; in response to the target container group not meeting the first container group screening condition, acquiring a default scheduling policy in the default part as the scheduling policy corresponding to the target container group; or, in response to the target container group not meeting the first container group screening condition, when the default part includes a second container group screening condition, in response to the target container group meeting the second container group screening condition, acquiring a default scheduling policy in the default part as the scheduling policy corresponding to the target container group.

[0054] In some embodiments, whether the target container group meets the first container group screening condition or the second container group screening condition is obtained by matching the representation information of the target container group with the first container group screening condition or the second container group screening condition, where the representation information includes at least one of the following: a label, a label expression, and an annotation.

[0055] In some embodiments, the configuration file is in the form of ConfigMap; the name of the configuration file includes the name of the target project, and is stored in a preset namespace corresponding to the container orchestration and management platform, and the preset namespace is used to store objects created by the container orchestration and management platform.

[0056] In some embodiments, the node scheduling device 500 further includes a scheduling score correction module. Before the scheduling score acquisition module 530 executes the selection of a target node from a number of candidate nodes using the scheduling score, the scheduling score correction module is used to find, for each candidate node, an associated container group that has a preset container group relationship with the target container group from each container group on the candidate node based on the container group relationship condition in the scheduling strategy; and to correct the scheduling score corresponding to each candidate node based on the number of associated container groups of each candidate node.

[0057] In some embodiments, the preset container group relationship includes a soft affinity relationship, the associated container group includes a first associated container group having a soft affinity relationship with the target container group, and the score correction value of the candidate node is positively correlated with the number of the first associated container groups.

[0058] In some embodiments, the preset container group relationship includes an anti-soft affinity relationship, the associated container group includes a second associated container group having an anti-soft affinity relationship with the target container group, and the score correction value of the candidate node is negatively correlated with the number of the second associated container groups.

[0059] In some embodiments, the step of obtaining a scheduling policy corresponding to the target container group is performed in the pre-filtering stage, the step of selecting a number of candidate nodes from the cluster based on the node screening conditions in the scheduling policy is performed in the filtering stage, the step of obtaining a scheduling score of each candidate node based on the scoring strategy in the scheduling policy to the number of associated container groups based on each candidate node, and correcting the scheduling score corresponding to each candidate node is performed in the scoring stage, the step of selecting a target node from a number of candidate nodes using the scheduling score is performed in the resource reservation stage, and the step of scheduling the target container group to the target node is performed in the binding stage; before the scheduling score acquisition module 530 executes the step of selecting a target node from a number of candidate nodes using the scheduling score, it also includes: in the normalized scoring stage, the corrected scheduling scores of each candidate node are unified within a preset numerical range.

[0060] In some embodiments, the node screening conditions include hard affinity of the node;

[0061] In some embodiments, the scheduling score acquisition module 530 executes a scoring strategy based on the scheduling strategy to obtain the scheduling score of each candidate node, including: sorting each candidate node according to the node sorting requirements in the scoring strategy; scoring each sorted candidate node to obtain the scheduling score of each candidate node; wherein the target node is determined by the comprehensive scheduling score and sorting.

[0062] In some embodiments, the method is applied to Kubernetes.

[0063] In some embodiments, the method is implemented by a scheduling plug-in.

[0064] See also Figure 6 , Figure 6 : is a schematic diagram of a framework of an embodiment of an electronic device of the present application. The electronic device 60 includes a memory 61 and a processor 62 coupled to each other, and the processor 62 is used to execute program instructions stored in the memory 61 to implement the steps in any of the above node scheduling method embodiments. In a specific implementation scenario, the electronic device 60 may include but is not limited to: a microcomputer, a server, and in addition, the electronic device 60 may also include a mobile device such as a laptop computer and a tablet computer, which is not limited here.

[0065] Specifically, the processor 62 is used to control itself and the memory 61 to implement the steps in any of the above-mentioned node scheduling method embodiments. The processor 62 can also be called a CPU (Central Processing Unit). The processor 62 may be an integrated circuit chip with signal processing capabilities. The processor 62 can also be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 62 can be implemented by an integrated circuit chip.

[0066] See also Figure 7 , Figure 7 The computer-readable storage medium 70 stores program instructions 71 that can be executed by a processor, and the program instructions 71 are used to implement the steps in any of the above node scheduling method embodiments.

[0067] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.

[0068] The above description of various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, they will not be repeated herein.

[0069] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0070] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0071] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.

Claims

1. A node scheduling method, characterized in that: The method comprises: Obtain a configuration file of a target project associated with the target container group, wherein the configuration file includes a specific part and a default part; In response to the target container group meeting the first container group screening condition in the specific part, obtaining a specific scheduling policy in the specific part as the scheduling policy corresponding to the target container group, wherein the scheduling policy is configured by a user; In response to the target container group not meeting the first container group screening condition, obtaining a default scheduling policy in the default part as the scheduling policy corresponding to the target container group; or, in response to the target container group not meeting the first container group screening condition, when the default part includes a second container group screening condition, in response to the target container group meeting the second container group screening condition, obtaining a default scheduling policy in the default part as the scheduling policy corresponding to the target container group; Based on the node screening condition in the scheduling strategy, select several candidate nodes from the cluster; Based on the scoring strategy in the scheduling strategy, obtaining the scheduling score of each of the candidate nodes; A target node is selected from the plurality of candidate nodes using the scheduling score, and the target container group is scheduled to the target node.

2. The method according to claim 1, characterized in that The scheduling strategy is obtained by selecting one of a specific scheduling strategy and a default scheduling strategy, and the priority of the specific scheduling strategy is higher than that of the default scheduling strategy; The scheduling strategy comes from a configuration file of a target project associated with the target container group, wherein different projects have different configuration files, and the configuration files are configured by a user.

3. The method according to claim 1, characterized in that Whether the target container group meets the first container group screening condition or the second container group screening condition is obtained by matching the representation information of the target container group with the first container group screening condition or the second container group screening condition, wherein the representation information includes at least one of the following: a label, a label expression, and an annotation.

4. The method according to any one of claims 1 to 3, characterized in that: The configuration file is in the form of ConfigMap; The configuration file is named including the name of the target project and is stored in a preset namespace corresponding to the container orchestration and management platform. The preset namespace is used to store objects created by the container orchestration and management platform.

5. The method according to claim 1, characterized in that Before selecting a target node from the plurality of candidate nodes by using the scheduling score, the method further includes: For each of the candidate nodes, based on the container group relationship condition in the scheduling policy, searching, from the container groups on the candidate nodes, for an associated container group that has a preset container group relationship with the target container group; Based on the number of container groups associated with each candidate node, the scheduling score corresponding to each candidate node is modified respectively.

6. The method according to claim 5, characterized in that The preset container group relationship includes a soft affinity relationship, the associated container group includes a first associated container group having the soft affinity relationship with the target container group, and the score correction value of the candidate node is positively correlated with the number of the first associated container groups.

7. The method according to claim 5, characterized in that The preset container group relationship includes an anti-soft affinity relationship, the associated container group includes a second associated container group having the anti-soft affinity relationship with the target container group, and the score correction value of the candidate node is negatively correlated with the number of the second associated container groups.

8. The method according to claim 5, characterized in that The step of obtaining the scheduling policy corresponding to the target container group is performed in the pre-filtering stage, the step of selecting several candidate nodes from the cluster based on the node screening condition in the scheduling policy is performed in the filtering stage, the step of obtaining the scheduling score of each candidate node based on the scoring policy to the number of associated container groups based on each candidate node, and respectively correcting the scheduling score corresponding to each candidate node is performed in the scoring stage, the step of selecting the target node from the several candidate nodes using the scheduling score is performed in the resource reservation stage, and the step of scheduling the target container group to the target node is performed in the binding stage; Before selecting a target node from the plurality of candidate nodes by using the scheduling score, the method further includes: In the normalized scoring stage, the revised scheduling scores of the candidate nodes are unified into a preset value range.

9. The method according to claim 1, characterized in that: The node screening condition includes the hard affinity of the node.

10. The method according to claim 1, characterized in that The obtaining, based on the scoring strategy in the scheduling strategy, a scheduling score of each candidate node includes: Sorting the candidate nodes according to the node sorting requirements in the scoring strategy; Scoring each of the ranked candidate nodes to obtain the scheduling score of each of the candidate nodes; wherein the target node is determined by comprehensively considering the scheduling score and the ranking.

11. The method according to claim 1, characterized in that: The described approach is applied to Kubernetes.

12. The method according to claim 1, characterized in that The method is implemented by a scheduling plug-in.

13. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores program instructions, and the processor is used to execute the program instructions to implement the node scheduling method according to any one of claims 1-12.

14. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store program instructions, and the program instructions can be executed to implement the node scheduling method according to any one of claims 1-12.

Citation Information

Patent Citations

  • Container group scheduling method, electronic equipment and storage medium

    CN112035248A