Method and apparatus for scheduling failure diagnosis

By analyzing the scheduling logs of the k8s scheduling component, we determine the reasons for containerized application scheduling failures and generate optimization tips, which solves the problem of low deployment efficiency caused by scheduling failures and improves the deployment efficiency of containerized applications.

CN118656238AActive Publication Date: 2024-09-17SHANGHAI BIREN TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202410773796.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-14
Publication Date
2024-09-17
Estimated Expiration
2044-06-14

AI Technical Summary

Technical Problem

In the existing technology, the scheduling failure of containerized applications results in low deployment efficiency, requiring repeated optimization and adjustment before successful scheduling.

Method used

By obtaining the scheduling log of the k8s scheduling component when scheduling fails, analyzing the screening events of abandoned nodes, determining the cause of the failure and generating Pod optimization tips, it helps platform users make targeted adjustments.

Benefits of technology

It reduces the number of Pod packaging optimization adjustments and retry scheduling, and improves the deployment efficiency of containerized applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118656238A
    Figure CN118656238A
Patent Text Reader

Abstract

The invention relates to a scheduling failure diagnosis method and device. Based on the application, a k8s scheduling component can generate a scheduling log, and the scheduling log can record a plurality of discarded nodes which are screened out and a screening execution event which causes each discarded node to be screened out. According to the embodiment of the invention, when the scheduling failure occurs, the trigger reason of the screening execution event of the reference node in the plurality of abandoned nodes can be analyzed based on the scheduling log, and the Pod optimization prompt can be generated based on the analyzed trigger reason, so that a platform user of the k8s platform can intuitively understand the failure reason of the scheduling failure of the target Pod. Therefore, when the scheduling of the target Pod fails, a platform user of the k8s platform can make more targeted Pod encapsulation optimization adjustment under the condition of visually knowing the failure reason, so that the number of times of Pod encapsulation optimization adjustment and retry scheduling is reduced, and the deployment efficiency of containerized application programs is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to container technology, and more particularly to a method for scheduling failure diagnosis, a device for scheduling failure diagnosis, an electronic device, a non-transitory computer-readable storage medium, and a computer program product. Background Art

[0002] Container technology can virtualize applications into containers, and containerized applications virtualized into containers can be deployed on appropriate nodes in the cluster for operation. A physical host or a virtual machine in the cluster can be regarded as a node.

[0003] The k8s (Kubernetes) platform is an open source container orchestration platform that is used to schedule containerized applications in the form of Pods to appropriate nodes in the cluster. One or more containerized applications can be encapsulated in a Pod, and for any Pod, a suitable node refers to a node that can meet the resource requirements and constraints of the containerized applications encapsulated in the Pod, so that the containerized applications encapsulated in the Pod can run in the best state on the node.

[0004] If all nodes in the cluster cannot meet the resource requirements and constraints of the Pod, the scheduling of the Pod will fail, resulting in the deployment failure of the containerized application packaged in the Pod. In addition, when the scheduling of the Pod fails, the platform user of the k8s platform can retry the scheduling after optimizing and adjusting the Pod packaging configuration of the containerized application to be deployed.

[0005] However, retry scheduling based on Pod packaging optimization adjustment usually does not succeed in one go, but requires repeated Pod packaging optimization adjustment before retry scheduling succeeds, resulting in low deployment efficiency of containerized applications. Therefore, how to improve the deployment efficiency of containerized applications has become a technical problem to be solved in the prior art. Summary of the invention

[0006] Embodiments of the present application provide a method for scheduling failure diagnosis, an apparatus for scheduling failure diagnosis, an electronic device, a non-transitory computer-readable storage medium, and a computer program product, which help improve the deployment efficiency of containerized applications.

[0007] In one embodiment of the present application, a method for scheduling failure diagnosis is provided, comprising:

[0008] Obtain a scheduling log generated by the k8s scheduling component during the execution of a scheduling process for a target Pod that failed to be scheduled; wherein the scheduling log records a plurality of abandoned nodes that were screened out by the k8s scheduling component during the scheduling process, and the scheduling log also records a screening execution event that caused each of the abandoned nodes to be screened out;

[0009] Based on the scheduling log, determining the failure reason for the failure of scheduling the target Pod; wherein the failure reason includes the triggering reason of the screening execution event of the reference node selected from the multiple abandoned nodes;

[0010] Generate Pod optimization tips based on the failure reasons.

[0011] In some examples, optionally, the scheduling log includes screening statistics and execution event records, the screening statistics include multiple abandoned nodes, and the execution event records include screening execution events that cause each of the abandoned nodes to be screened out; determining the failure cause of the scheduling failure of the target Pod based on the scheduling log includes: selecting the reference node from the multiple abandoned nodes based on the screening statistics; and determining the triggering cause of the screening execution event of the reference node based on the execution event record.

[0012] In some examples, optionally, the scheduling process includes multiple sub-processes executed sequentially, the screening statistical results include stage statistical results corresponding to different sub-processes, and the abandoned nodes screened out by the k8s scheduling component in any one of the sub-processes are recorded in the corresponding stage statistical results; based on the screening statistical results, the reference node is selected from the multiple abandoned nodes, including: searching for the abandoned nodes from the stage statistical results in reverse order of the multiple sub-processes until the number of the abandoned nodes searched reaches a set number; and determining the set number of the abandoned nodes searched as the reference nodes.

[0013] In some examples, optionally, the k8s scheduling component performs screening of the abandoned nodes in the scheduling process by calling multiple scheduling plug-ins, and the execution event record includes plug-in screening records corresponding to different scheduling plug-ins, and the plug-in screening record records a screening execution event in which the corresponding scheduling plug-in performs a screening operation on any one of the abandoned nodes; determining the triggering cause of the screening execution event of the reference node based on the execution event record includes: determining the scheduling plug-in that performs the screening operation on the reference node based on the plug-in screening record; and determining the triggering cause of the screening execution event of the reference node based on the plug-in function of the scheduling plug-in that performs the screening operation on the reference node.

[0014] In some examples, optionally, the multiple scheduling plug-ins include at least one of a first type of scheduling plug-in, a second type of scheduling plug-in, and a third type of scheduling plug-in; the plug-in function of the first type of scheduling plug-in includes detecting whether the node available resources of any node meet the resource requirements of the target Pod, and the triggering cause of the screening execution event determined based on the plug-in function of the first type of scheduling plug-in includes insufficient node available resources; the plug-in function of the second type of scheduling plug-in includes detecting whether the node configuration of any node meets the constraints of the target Pod, and the triggering cause of the screening execution event determined based on the plug-in function of the second type of scheduling plug-in includes the node configuration does not match the constraints of the target Pod; the plug-in function of the third type of scheduling plug-in includes detecting the storage volume binding status of the target Pod and any node, and the triggering cause of the screening execution event determined based on the plug-in function of the third type of scheduling plug-in includes storage volume abnormality.

[0015] In some examples, optionally, generating a Pod optimization hint based on the failure cause includes: generating the Pod optimization hint based on clustering results of triggering causes of screened execution events of a set number of reference nodes; wherein the set number is greater than 1.

[0016] In another embodiment of the present application, a device for scheduling failure diagnosis is also provided, including:

[0017] A log acquisition module is used to obtain a scheduling log generated by a k8s scheduling component during the execution of a scheduling process for a target Pod that failed to be scheduled; wherein the scheduling log records a plurality of abandoned nodes that were screened out by the k8s scheduling component during the scheduling process, and the scheduling log also records a screening execution event that caused each of the abandoned nodes to be screened out;

[0018] A cause analysis module, used to determine the failure cause of the failure of scheduling the target Pod based on the scheduling log; wherein the failure cause includes a triggering cause of a screening execution event of a reference node among the plurality of abandoned nodes;

[0019] The prompt generation module is used to generate a Pod optimization prompt based on the failure cause.

[0020] In some examples, optionally, the scheduling log includes screening statistics and execution event records, the screening statistics include multiple abandoned nodes, and the execution event records include screening execution events that cause each abandoned node to be screened out; the cause analysis module is specifically configured to: determine the reference node among the multiple abandoned nodes based on the screening statistics; and determine the triggering cause of the screening execution event of the reference node based on the execution event record.

[0021] In some examples, optionally, the scheduling process includes multiple sub-processes executed sequentially, the screening statistical results include stage statistical results corresponding to different sub-processes, and the abandoned nodes screened out by the k8s scheduling component in any one of the sub-processes are recorded in the corresponding stage statistical results; the cause analysis module is specifically configured to: search for the abandoned nodes from the stage statistical results in reverse order of the multiple sub-processes until the number of the abandoned nodes searched reaches a set number; and determine the set number of the abandoned nodes searched as the reference nodes.

[0022] In some examples, optionally, the k8s scheduling component performs screening of the abandoned nodes in the scheduling process by calling multiple scheduling plug-ins, and the execution event record includes plug-in screening records corresponding to different scheduling plug-ins, and the plug-in screening record records the screening execution event of the corresponding scheduling plug-in screening any one of the abandoned nodes; the cause analysis module is specifically configured to: determine the scheduling plug-in that performs screening on the reference node based on the plug-in screening record; and determine the triggering cause of the screening execution event of the reference node based on the plug-in function of the scheduling plug-in that performs screening on the reference node.

[0023] In some examples, optionally, the prompt module is specifically configured to generate the Pod optimization prompt based on the clustering results of the triggering causes of the screening execution events of a set number of reference nodes; wherein the set number is greater than 1.

[0024] In another embodiment of the present application, an electronic device is provided, including a processor, wherein the processor is used to execute the method for scheduling failure diagnosis as described in the above embodiment.

[0025] In another embodiment of the present application, a non-transitory computer-readable storage medium is provided. The non-transitory computer-readable storage medium stores instructions. When the instructions are executed by a processor, the processor executes the method for scheduling failure diagnosis as described in the above embodiment.

[0026] In another embodiment of the present application, a computer program product is provided, including computer executable instructions, which, when executed by a processor, implement the method for scheduling failure diagnosis as described in the above embodiment.

[0027] Based on the above-mentioned embodiment of the present application, the k8s scheduling component can generate a scheduling log during the period of executing the scheduling process for the target Pod, and the scheduling log records multiple abandoned nodes screened out by the k8s scheduling component and the screening execution events that cause each abandoned node to be screened out. Therefore, when the scheduling of the target Pod fails, the triggering cause of the screening execution event of the reference node in the multiple abandoned nodes can be analyzed based on the scheduling log, and the Pod optimization prompt can be generated based on the triggering cause obtained by the analysis, so that the platform user of the k8s platform can intuitively understand the failure cause of the scheduling failure of the target Pod. Thus, when the scheduling of the target Pod fails, the platform user of the k8s platform can make more targeted Pod packaging optimization adjustments when intuitively understanding the cause of the failure, which is conducive to reducing the number of Pod packaging optimization adjustments and retry scheduling, so as to improve the deployment efficiency of containerized applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] The following drawings are only used to illustrate and explain the present application, and do not limit the scope of the present application:

[0029] Figure 1 This is a schematic diagram of the system structure based on the k8s platform in the embodiment of the present application;

[0030] Figure 2 A schematic diagram of an example process of generating a scheduling log for the k8s scheduling component in an embodiment of the present application;

[0031] Figure 3 A schematic diagram of an example process in which a scheduling management component in an embodiment of the present application generates a Pod optimization prompt based on a scheduling log;

[0032] Figure 4 This is an exemplary flowchart of a method for scheduling failure diagnosis in an embodiment of the present application;

[0033] Figure 5 This is a schematic diagram of an exemplary structure of an apparatus for scheduling failure diagnosis in an embodiment of the present application. DETAILED DESCRIPTION

[0034] In order to make the objectives, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below with reference to the accompanying drawings and examples.

[0035] Figure 1 This is a schematic diagram of the system structure based on the k8s platform in the embodiment of this application. Figure 1 In an embodiment of the present application, the k8s platform 20 may include a k8s API (Application Programming Interface) service component 21, a k8s scheduling component (Kube-scheduler) 25 and multiple nodes 22.

[0036] In an embodiment of the present application, the k8s API service component 21 can provide the platform user 10 with an API interface for creating, deleting, and updating Pods. The k8s scheduling component 25 can be used to obtain the target Pod created or updated by the platform user 10 from the k8s API service component 21. The k8s scheduling component 25 can also be used to schedule the target Pod to any node 22, and multiple nodes 22 can respectively host multiple different physical hosts or virtual machines.

[0037] In an embodiment of the present application, the k8s scheduling component 25 can screen out abandoned nodes that are not suitable for deploying containerized applications in the target Pod from multiple nodes 22 by executing a scheduling process on the target Pod.

[0038] Exemplarily, the scheduling process executed by the k8s scheduling component 25 on the target Pod may include multiple sub-processes executed sequentially. For example, the scheduling process executed by the k8s scheduling component 25 on the target Pod may include the following sub-processes executed sequentially: pre-enqueue, pre-filter, filter, post-filter, pre-score, score, reserve, permit, pre-bind, and bind.

[0039] The k8s scheduling component 25 can add candidate nodes that can be used to deploy Pods to the candidate node queue in pre_enqueue. The basis for the k8s scheduling component 25 to add candidate nodes to the candidate node queue in pre_enqueue can be the node conditions arbitrarily set by the platform user 10, and the nodes 22 that are not added to the candidate node queue by the k8s scheduling component 25 in pre_enqueue do not belong to the discarded nodes that are screened out.

[0040] The k8s scheduling component 25 can perform filtering operations on the candidate nodes in the candidate node queue in pre_filter, filter and post_filter. The basis for the filtering operation of the k8s scheduling component 25 may include the resource matching result of whether the node available resources of any node 22 meet the resource requirements of the target Pod, and / or whether the node configuration of any node meets the constraints of the target Pod. In addition, the abandoned nodes may also include candidate nodes that are screened out from the candidate node queue by the k8s scheduling component 25 through filtering operations.

[0041] The k8s scheduling component 25 can score the candidate nodes remaining in the candidate node queue after filtering by pre_filter, filter and post_filter in pre_score and score. The basis for the scoring operation can still include the resource matching result of whether the node available resources of any node 22 meet the resource requirements of the target Pod, and / or whether the node configuration of any node meets the constraints of the target Pod, and pre_score and score usually do not screen out abandoned nodes.

[0042] The k8s scheduling component 25 can reserve at least one candidate node with a relatively high score in the reserve based on the scoring results of the candidate nodes remaining in the candidate node queue after being filtered by pre_filter, filter, and post_filter; and the k8s scheduling component 25 can review whether the reserved candidate node is occupied or change the reserved candidate node in the permit sub-process. Accordingly, the abandoned nodes can also include candidate nodes with relatively low scores that have not been reserved through reserve.

[0043] The k8s scheduling component 25 can bind the target Pod to the storage volume in a reserved candidate node through pre_bind, bind and post_bind, wherein, if the binding is successful, the state of the target Pod will be updated to "Running" after being successfully bound to the storage volume of the node; if the binding fails, the abandoned nodes can also be included in the candidate nodes where the storage volume binding fails; if no storage volume of any candidate node can be successfully bound to the target Pod, then it can be considered that the scheduling of the target Pod has failed.

[0044] In addition, the sub-process for the k8s scheduling component 25 to schedule the Pod may also include post-binding (post_bind) or preemption (preempt) after the scheduling fails. Among them, post_bind or preempt can be regarded as the remedial sub-process of the k8s scheduling component 25 after the scheduling fails; post_bind or preempt can be selectively enabled after the scheduling fails through a preset configuration; the k8s scheduling component 25 can terminate the resource occupation of the deployed Pod with a lower priority on the node through post_bind or preempt, so that the target Pod can preempt the node where the deployed Pod is located; the k8s scheduling component 25 can use preempt to make the target Pod preempt the node where any deployed Pod is located, which does not belong to the Pod packaging optimization adjustment performed by the platform user 10.

[0045] In an embodiment of the present application, the function of the k8s scheduling component 25 can be configured by a scheduling plug-in, that is, the function of the k8s scheduling component 25 can be regarded as a collection of plug-in functions of several scheduling plug-ins. Among them, the k8s scheduling component 25 may include multiple scheduling plug-ins for executing the scheduling process for the target Pod, and the k8s scheduling component 25 can use these scheduling plug-ins to filter out the abandoned nodes in all nodes 22 that do not meet the resource requirements and constraints of the target Pod.

[0046] In an embodiment of the present application, the scheduling plug-in used by the k8s scheduling component 25 in pre_enqueue may include a scheduling threshold (SchedulingGates) plug-in, whose plug-in function is used to add candidate nodes to the candidate node queue according to the set conditions of the pre_enqueue platform user 10. In addition, the multiple scheduling plug-ins used by the k8s scheduling component 25 to execute the scheduling process may include at least one of a first-class scheduling plug-in, a second-class scheduling plug-in, and a third-class scheduling plug-in.

[0047] Exemplarily, in an embodiment of the present application, the plug-in function of the first type of scheduling plug-in may include detecting whether the node available resources of any node (for example, any candidate node in the candidate node queue) meet the resource requirements of the target Pod, and the first type of scheduling plug-in can be used in any sub-process in pre_filter, filter, post_filter, pre_score and score.

[0048] For example, the first type of scheduling plugins may include:

[0049] The NodeResourcesFit plug-in has the following functions: detecting the available processing resources and memory resources of any candidate node in the candidate node queue to see whether they match the resource requirements of the target Pod for processing resources and memory resources;

[0050] The NodePorts plug-in has the following plug-in functions: detecting the available port resources of any candidate node in the candidate node queue to see if they match the resource requirements of the target Pod for the port resources;

[0051] The NodeVolumeLimits plug-in may include the following functions: detecting the capacity of the storage volume of any candidate node in the candidate node queue to see whether it matches the resource requirements of the target Pod for storage resources.

[0052] Exemplarily, in an embodiment of the present application, the plug-in function of the second type of scheduling plug-in may include: detecting whether the node configuration of any node (for example, any candidate node in the candidate node queue) meets the constraints of the target Pod, and the second type of scheduling plug-in can be used in any sub-process in pre_filter, filter, post_filter, pre_score and score.

[0053] For example, the second category of scheduling plugins may include:

[0054] InterPodAffinity plug-in, whose plug-in functions may include: detecting the affinity and anti-affinity between the deployed Pod of any candidate node in the candidate node queue and the target Pod. For example, the affinity between the target Pod and the deployed Pod may mean that the target Pod and the deployed Pod should be deployed on the same node, and the anti-affinity between the target Pod and the deployed Pod may mean that the target Pod and the deployed Pod should not be deployed on the same node;

[0055] NodeAffinity plug-in, whose plug-in functions may include: detecting the node attributes of any candidate node in the candidate node queue, the affinity and anti-affinity between the target Pod, for example, the affinity between the target Pod and any candidate node in the candidate node queue may refer to the specific hardware configuration that the target Pod's operating performance depends on, and the anti-affinity between the target Pod and any candidate node in the candidate node queue may refer to the specific hardware configuration that the target Pod's operating performance depends on that the candidate node lacks.

[0056] A TaintToleration plug-in, whose plug-in functions may include: detecting whether the taint of any candidate node in the candidate node queue exceeds the taint tolerance of the target Pod, wherein the target Pod may also include a taint constraint condition for characterizing the taint tolerance of the target Pod;

[0057] A volume restriction plug-in, whose plug-in functions may include: detecting whether the storage volume of any candidate node in the candidate node queue has access properties that are compatible with the target Pod (for example, the storage volume has a file system type and / or access mode supported by the target Pod, etc.);

[0058] The VolumeZone plug-in may include the following plug-in functions: checking whether the storage volume of any candidate node in the candidate node queue has the zone attributes that match the target Pod (for example, the storage volume has a mounted file system, a local file system, or a file system that supports cloud storage that matches the latency and bandwidth requirements of the target Pod).

[0059] In this case, the constraints of the target Pod may include at least one of the following: an affinity constraint for characterizing the affinity and anti-affinity between the target Pod and a deployed Pod, an affinity constraint for characterizing the affinity and anti-affinity between the target Pod and a candidate node, a storage volume constraint for characterizing storage volume access attributes adapted to the target Pod, and a storage volume constraint for characterizing storage volume area attributes adapted to the target Pod.

[0060] Exemplarily, in an embodiment of the present application, the plug-in function of the third type of scheduling plug-in may include: detecting the storage volume binding status of the target Pod and any node (for example, any candidate node in the candidate node queue), and the third type of scheduling plug-in can be used in any sub-process in reserve, pre_bind and bind.

[0061] A volume binding plug-in, whose plug-in functions may include: selecting a storage volume that can be bound to a target Pod from any candidate node in the candidate node queue, wherein the VolumeBinding plug-in is preferably used by the k8s scheduling component in at least one of reserve and pre_bind;

[0062] The default binding (DefaultBinder) plug-in, whose plug-in functions may include: performing a binding operation on the target Pod on the selected candidate node, wherein the VolumeBinding plug-in is preferably used by the k8s scheduling component in bind.

[0063] In an embodiment of the present application, in addition to the above-mentioned scheduling plug-in, the k8s scheduling component 25 may also include a log plug-in for generating a scheduling log. That is, based on an embodiment of the present application, the k8s scheduling component 25 can generate a scheduling log during the period of executing the scheduling process on the target Pod, and the scheduling log generated by the k8s scheduling component 25 executing the scheduling process with different Pods as the target Pod may include the unique identifier of the Pod. Among them, in the scheduling log generated by the k8s scheduling component 25 during the period of executing the scheduling process on the target Pod, multiple abandoned nodes screened out by the k8s scheduling component and the screening execution event that caused each abandoned node to be screened out may be recorded.

[0064] Exemplarily, in an embodiment of the present application, the scheduling log generated by the k8s scheduling component 25 may include screening statistics and execution event records. Among them, the screening statistics include multiple abandoned nodes screened out by the k8s scheduling component, and the execution event record includes a screening execution event that causes each abandoned node to be screened out.

[0065] Figure 2 This is a schematic diagram of an example process of generating a scheduling log for the k8s scheduling component in an embodiment of the present application. Figure 2 , taking the scheduling process executed by the k8s scheduling component 25 including multiple scheduling sub-processes, and the k8s scheduling component 25 performing the screening of abandoned nodes by calling multiple scheduling plug-ins in the scheduling process as an example:

[0066] In an embodiment of the present application, the k8s scheduling component 25 can record the corresponding stage statistical results Sp1~Sp6 in each sub-process where the abandoned nodes are screened out, that is, the abandoned nodes screened out by the k8s scheduling component in any sub-process can be recorded in the stage statistical results corresponding to the sub-process, so that the screening statistical results Rc_nodes in the scheduling log can include the stage statistical results Sp1~Sp6 corresponding to different sub-processes respectively;

[0067] In an embodiment of the present application, the k8s scheduling component 25 can record the screening execution events of different scheduling plug-ins performing screening operations on abandoned nodes at the granularity of scheduling plug-ins. In this case, the execution event record Event_plugins in the scheduling log may include plug-in screening records Ev1~EvN corresponding to different scheduling plug-ins, where N can be the total number of scheduling plug-ins that can perform screening operations used by the k8s scheduling component 25, and the plug-in screening record Evi records the screening execution events of the corresponding scheduling plug-in (i.e., the i-th scheduling plug-in that can perform screening operations) screening out any abandoned node, where i is a positive integer greater than or equal to 1 and less than or equal to N.

[0068] Please look back Figure 1 In an embodiment of the present application, a system based on the k8s platform may further include a cloud management platform 30, which may include a log database 31 and a schedule management component (Schedule-manager) 35. The log database 31 may be used to store the scheduling logs generated by the k8s scheduling component 25. For example, the k8s scheduling component 25 may push the generated scheduling logs to the cloud management platform 30 and store them in the log database 31; the scheduling management component 35 may be used to generate a Pod optimization prompt for assisting the platform user 10 in optimizing and adjusting the target Pod when the k8s scheduling component 25 fails to schedule the target Pod.

[0069] In an embodiment of the present application, the scheduling management component 35 may be specifically used for:

[0070] Obtain a scheduling log generated by the k8s scheduling component 25 during the execution of the scheduling process for the target Pod that failed to be scheduled; wherein the scheduling log records a plurality of abandoned nodes that were screened out by the k8s scheduling component during the execution of the scheduling process for the target Pod, and the scheduling log also records a screening execution event that caused each of the abandoned nodes to be screened out;

[0071] Based on the scheduling log generated by the k8s scheduling component 25 during the execution of the scheduling process for the target Pod, determine the failure reason for the failure of scheduling the target Pod; wherein the failure reason for the failure of scheduling the target Pod includes the triggering reason of the screening execution event of the reference node selected from the multiple abandoned nodes;

[0072] Based on the failure reason of scheduling failure of the target Pod, a Pod optimization hint is generated; for example, the semantic content of the Pod optimization hint is associated with a triggering reason of a screening execution event of a reference node among multiple deprecated nodes.

[0073] Exemplarily, in an embodiment of the present application, if the scheduling log generated by the k8s scheduling component 25 may include screening statistics and execution event records, the scheduling management component 35 may determine the failure cause of the scheduling failure of the target Pod in the following manner:

[0074] Based on the screening statistics in the scheduling log generated by the k8s scheduling component 25, a reference node is selected from a plurality of abandoned nodes, for example, a set number of reference nodes is selected from a plurality of abandoned nodes, and the set number may be determined by the platform user 10;

[0075] Based on the execution event records in the scheduling log generated by the k8s scheduling component 25, determine the triggering cause of the screening execution event of the reference node, for example, determine the triggering cause of the screening execution event of a set number of reference nodes.

[0076] Figure 3 This is a schematic diagram of an example process in which the scheduling management component in the embodiment of the present application generates Pod optimization tips based on the scheduling log. Figure 3 Taking the scheduling process executed by the k8s scheduling component 25 as an example, in which the scheduling process includes multiple scheduling sub-processes, and the k8s scheduling component 25 performs the screening of abandoned nodes by calling multiple scheduling plug-ins in the scheduling process, the scheduling management component 35 obtains the scheduling log of the target Pod by the k8s scheduling component 25 (for example, using the unique identifier of the target Pod to query the corresponding scheduling log in the log database 31), and then:

[0077] As shown in S351, abandoned nodes are searched from the stage statistical results S6 to S1 in reverse order of multiple sub-processes until the number of abandoned nodes searched reaches a set number M, and the searched set number M abandoned nodes are determined as reference nodes, so that a set number M of reference nodes can be selected from multiple abandoned nodes based on the screening statistical results in the scheduling log generated by the k8s scheduling component 25;

[0078] As shown in S352, based on the plug-in screening records Ev1 to EvN, a scheduling plug-in for performing screening on a set number of M reference nodes is determined, that is, a screening execution event with a set number of M reference nodes as screening objects is queried in the plug-in screening records Ev1 to EvN, and the scheduling plug-in corresponding to the plug-in screening record to which the screening execution event hit by the query belongs can be determined as the scheduling plug-in for performing screening on the set number of M reference nodes;

[0079] As shown in S353, based on the plug-in function of the scheduling plug-in that performs screening on a set number M of reference nodes, a triggering cause of the reference node screening execution event is determined.

[0080] As can be seen above, based on the embodiment of the present application, when the scheduling of the target Pod fails, the scheduling management component 35 can analyze the triggering reason of the screening execution event of the reference node among the multiple abandoned nodes based on the scheduling log generated by the k8s scheduling component 25 during the execution of the scheduling process for the target Pod, and the scheduling management component 35 can also generate a Pod optimization prompt based on the analyzed triggering reason, so that the platform user 10 of the k8s platform can intuitively understand the failure reason of the scheduling failure of the target Pod. Thus, when the scheduling of the target Pod fails, the platform user 10 of the k8s platform can make more targeted Pod packaging optimization adjustments when intuitively understanding the failure reason, and then, compared with the exhaustive optimization adjustment made when the failure reason is unknown, the implementation of targeted optimization adjustment of the Pod packaging based on the Pod optimization prompt can help reduce the number of Pod packaging optimization adjustments and retry scheduling, so as to improve the deployment efficiency of containerized applications.

[0081] Exemplarily, in an embodiment of the present application, if the scheduling plug-in that performs screening on any reference node is the first type of scheduling plug-in mentioned above, then, since the plug-in function of the first type of scheduling plug-in includes detecting whether the node available resources of any node meet the resource requirements of the target Pod, the triggering cause of the screening execution event determined based on the plug-in function of the first type of scheduling plug-in (such as the NodeResourcesFit plug-in) that performs screening on the reference node may include "insufficient node resources", and the semantic content of the Pod optimization prompt may include the first type of semantic content used to characterize that resource requirements need to be reduced. For example, assuming that the resource requirements of the target Pod for processing resources include 11 CPU cores, and the maximum available CPU cores in the candidate node are 10, in this case, the first semantic content of the Pod optimization prompt may represent the modification of the number of CPU cores of the target Pod's resource requirements for processing resources. Thus, platform users can refer to the semantic content of the Pod optimization prompt to achieve Pod optimization by lowering the resource requirements of the target Pod for processing resources, or by creating a new Pod with lower resource requirements than the target Pod to replace the target Pod to achieve Pod optimization.

[0082] Exemplarily, in an embodiment of the present application, if the scheduling plug-in that performs screening on any reference node is the second type of scheduling plug-in mentioned above, then, since the plug-in function of the second type of scheduling plug-in includes detecting whether the node configuration of any node meets the constraints of the target Pod, the triggering cause of the screening execution event determined based on the plug-in function of the second type of scheduling plug-in (e.g., VolumeRestrictions plug-in) that performs screening on the reference node includes "the node configuration does not match the constraints of the target Pod", and the semantic content of the Pod optimization prompt may include the second type of semantic content for describing the constraints that failed to match. For example, assuming that there is no candidate node with storage volume access attributes and the target Pod, in this case, the second type of semantic content of the Pod optimization prompt can indicate that the storage volume access attributes do not match. Thus, platform users can refer to the semantic content of the Pod optimization prompt and achieve Pod optimization by modifying the file system type and / or access mode supported by the target Pod.

[0083] Exemplarily, in an embodiment of the present application, if the scheduling plug-in that performs screening on any reference node is the third type of scheduling plug-in described above, then, since the plug-in function of the third type of scheduling plug-in includes detecting the storage volume binding status of the target Pod and any node, the triggering cause of the screening execution event determined based on the plug-in function of the third type of scheduling plug-in (e.g., VolumeBinding plug-in) that performs screening on the reference node includes storage volume abnormality, and the semantic content of the Pod optimization prompt may include the third type of semantic content for describing the storage volume abnormality. Thus, platform users can refer to the semantic content of the Pod optimization prompt, specifically check the specific reasons that cause the target Pod to be unable to bind to the storage volume, and implement targeted adjustments for Pod optimization on the target Pod based on the specific reasons checked.

[0084] Exemplarily, in an embodiment of the present application, if the set number M is greater than 1, then the screening execution events of the set number M reference nodes may be repeated. In this case, the scheduling management component 35 can be specifically configured to generate a Pod optimization prompt based on the clustering results of the triggering reasons of the screening execution events of the set number M reference nodes.

[0085] Figure 4 This is an exemplary flow chart of the method for scheduling failure diagnosis in an embodiment of the present application. Figure 4 , an embodiment of the present application provides a method for scheduling failure diagnosis, which may include:

[0086] S410: Obtain a scheduling log generated by the k8s scheduling component during the execution of the scheduling process for the target Pod that failed to be scheduled; wherein the scheduling log records a plurality of abandoned nodes that were screened out by the k8s scheduling component during the execution of the scheduling process for the target Pod, and the scheduling log also records a screening execution event that caused each of the abandoned nodes to be screened out;

[0087] S430: Determine the failure reason for the failure of scheduling the target Pod based on the scheduling log generated by the k8s scheduling component during the execution of the scheduling process for the target Pod; wherein the failure reason for the failure of scheduling the target Pod includes the triggering reason of the screening execution event of the reference node selected from the multiple abandoned nodes;

[0088] S450: Generate a Pod optimization prompt based on the failure reason for the scheduling failure of the target Pod.

[0089] For example, the semantic content of the Pod optimization hint generated by S450 may be associated with a triggering cause of a screening execution event of a reference node among the plurality of deprecated nodes.

[0090] Based on the above process, when the scheduling of the target Pod fails, the method for scheduling failure diagnosis in the embodiment of the present application can be based on the scheduling log generated by the k8s scheduling component during the execution of the scheduling process for the target Pod, and the triggering reason of the reference node's screening execution event among multiple abandoned nodes can be analyzed. In addition, the method for scheduling failure diagnosis in the embodiment of the present application can also generate Pod optimization prompts based on the analyzed triggering reasons, so that the platform users of the k8s platform can intuitively understand the failure reasons for the failure of scheduling the target Pod. Thus, when the scheduling of the target Pod fails, the platform users of the k8s platform can make more targeted Pod packaging optimization adjustments with an intuitive understanding of the failure reasons, which is conducive to reducing the number of Pod packaging optimization adjustments and retry scheduling to improve the deployment efficiency of containerized applications.

[0091] Exemplarily, in an embodiment of the present application, if the scheduling log generated by the k8s scheduling component may include screening statistics and execution event records, then S430 of the method for scheduling failure diagnosis in an embodiment of the present application may specifically include:

[0092] Based on the screening statistics results in the scheduling log generated by the k8s scheduling component, a reference node is selected from multiple abandoned nodes. For example, a set number of reference nodes is selected from multiple abandoned nodes, and the set number may be determined by a platform user;

[0093] Based on the execution event records in the scheduling log generated by the k8s scheduling component, determine the triggering cause of the screening execution event of the reference node, for example, determine the triggering cause of the screening execution event of a set number of reference nodes.

[0094] For example, if the scheduling process executed by the k8s scheduling component on the target Pod includes multiple sub-processes executed sequentially, the screening statistical results include stage statistical results corresponding to different sub-processes, and the abandoned nodes screened out by the k8s scheduling component in any sub-process are recorded in the corresponding stage statistical results, then, S430 The process of selecting a reference node from multiple enabled nodes based on the screening statistical results can specifically include: searching for abandoned nodes from the stage statistical results in reverse order of the multiple sub-processes until the number of abandoned nodes searched reaches a set number, and determining the set number of abandoned nodes searched as reference nodes.

[0095] For another example, if the k8s scheduling component performs the screening of abandoned nodes by calling multiple scheduling plug-ins in the scheduling process, the execution event record includes plug-in screening records corresponding to different scheduling plug-ins, and the plug-in screening record records the screening execution event of the corresponding scheduling plug-in screening any abandoned node, then, S430 determines the triggering cause of the screening execution event of the reference node based on the execution event record. The process may specifically include:

[0096] Based on the plug-in screening records included in the execution event records in the scheduling log generated by the k8s scheduling component, determine the scheduling plug-in that performs screening on a set number of reference nodes, that is, query the plug-in screening record for screening execution events with a set number of reference nodes as screening objects, and the scheduling plug-in corresponding to the plug-in screening record to which the hit screening execution event belongs can be determined as the scheduling plug-in that performs screening on the set number of reference nodes; and,

[0097] Based on the plug-in function of the scheduling plug-in that performs screening on a set number of reference nodes, a triggering cause of a screening execution event of the set number of reference nodes is determined.

[0098] For example, in the Pod optimization prompt generated by S450 of the method for scheduling failure diagnosis in the embodiment of the present application, examples of semantic content associated with the triggering reasons for screening out execution events of different types of scheduling plug-ins can be found in the previous text and will not be repeated here.

[0099] Exemplarily, in an embodiment of the present application, if the set number of reference nodes is greater than 1, then the screening execution events of the set number of reference nodes may be repeated. In this case, S450 of the method for scheduling failure diagnosis in the embodiment of the present application may specifically include: generating Pod optimization prompts based on the clustering results of the triggering causes of the screening execution events of the set number of reference nodes.

[0100] Figure 5 Schematic diagram of an exemplary structure of a device for scheduling failure diagnosis in an embodiment of the present application. Figure 5 , an embodiment of the present application provides a device for scheduling failure diagnosis, which may include:

[0101] The log acquisition module 510 is used to: obtain the scheduling log generated by the k8s scheduling component during the period of executing the scheduling process for the target Pod that failed to be scheduled; wherein the scheduling log records multiple abandoned nodes that were screened out by the k8s scheduling component during the period of executing the scheduling process for the target Pod, and the scheduling log also records the screening execution event that caused each abandoned node to be screened out;

[0102] The cause analysis module 530 is used to: determine the failure cause of the failure of scheduling the target Pod based on the scheduling log generated by the k8s scheduling component during the execution of the scheduling process for the target Pod; wherein the failure cause of the failure of scheduling the target Pod includes the triggering cause of the screening execution event of the reference node selected from the multiple abandoned nodes;

[0103] The prompt generation module 550 is used to generate a Pod optimization prompt based on the failure reason of scheduling failure of the target Pod. For example, the semantic content of the Pod optimization prompt generated by the prompt generation module 55 can be associated with the triggering reason of the screening execution event of the reference node in the multiple abandoned nodes.

[0104] As can be seen above, when the scheduling of the target Pod fails, the device for scheduling failure diagnosis in the embodiment of the present application can be based on the scheduling log generated by the k8s scheduling component during the execution of the scheduling process for the target Pod, and the triggering cause of the reference node's screening execution event in multiple abandoned nodes can be analyzed, and the device for scheduling failure diagnosis in the embodiment of the present application can also generate Pod optimization prompts based on the analyzed triggering cause, so that the platform user of the k8s platform can intuitively understand the failure cause of the scheduling failure of the target Pod. Thus, when the scheduling of the target Pod fails, the platform user of the k8s platform can make more targeted Pod packaging optimization adjustments when intuitively understanding the cause of the failure, which is conducive to reducing the number of Pod packaging optimization adjustments and retry scheduling to improve the deployment efficiency of containerized applications.

[0105] Exemplarily, in an embodiment of the present application, if the scheduling log generated by the k8s scheduling component may include screening statistics and execution event records, then the cause analysis module 530 of the apparatus for scheduling failure diagnosis in an embodiment of the present application may be specifically configured as follows:

[0106] Based on the screening statistics results in the scheduling log generated by the k8s scheduling component, a reference node is selected from multiple abandoned nodes. For example, a set number of reference nodes is selected from multiple abandoned nodes, and the set number may be determined by a platform user;

[0107] Based on the execution event records in the scheduling log generated by the k8s scheduling component, determine the triggering cause of the screening execution event of the reference node, for example, determine the triggering cause of the screening execution event of a set number of reference nodes.

[0108] For example, if the scheduling process executed by the k8s scheduling component on the target Pod includes multiple sub-processes executed sequentially, the screening statistical results include stage statistical results corresponding to different sub-processes, and the abandoned nodes screened out by the k8s scheduling component in any sub-process are recorded in the corresponding stage statistical results, then the cause analysis module 530 determines the reference node from multiple enabled nodes based on the screening statistical results. The process can specifically include: searching for abandoned nodes from the stage statistical results in reverse order of the multiple sub-processes until the number of abandoned nodes searched reaches a set number, and determining the set number of abandoned nodes searched as reference nodes.

[0109] For another example, if the k8s scheduling component performs the screening of abandoned nodes by calling multiple scheduling plug-ins in the scheduling process, the execution event record includes plug-in screening records corresponding to different scheduling plug-ins, and the plug-in screening record records the screening execution event of the corresponding scheduling plug-in screening any abandoned node. Then, the process of the cause analysis module 530 determining the triggering cause of the screening execution event of the reference node based on the execution event record can specifically include:

[0110] Based on the plug-in screening records included in the execution event records in the scheduling log generated by the k8s scheduling component, determine the scheduling plug-in that performs screening on a set number of reference nodes, that is, query the plug-in screening record for screening execution events with a set number of reference nodes as screening objects, and the scheduling plug-in corresponding to the plug-in screening record to which the hit screening execution event belongs can be determined as the scheduling plug-in that performs screening on the set number of reference nodes; and,

[0111] Based on the plug-in function of the scheduling plug-in that performs screening on a set number of reference nodes, a triggering cause of a screening execution event of the set number of reference nodes is determined.

[0112] Exemplarily, in an embodiment of the present application, in the Pod optimization prompt generated by the prompt generation module 550 of the device for scheduling failure diagnosis in the embodiment of the present application, examples of semantic content associated with the triggering reasons for the screening execution events of different types of scheduling plug-ins can be found in the previous text and will not be repeated here.

[0113] Exemplarily, in an embodiment of the present application, if the set number of reference nodes is greater than 1, then the screening execution events of the set number of reference nodes may be repeated. In this case, the prompt generation module 550 of the device for scheduling failure diagnosis in the embodiment of the present application can be specifically configured to generate a Pod optimization prompt based on the clustering results of the triggering causes of the screening execution events of the set number of reference nodes.

[0114] In an embodiment of the present application, an electronic device is further provided, including a processor, which is used to execute the method for scheduling failure diagnosis as described in the above embodiment, or it can also be considered that the scheduling control component described above is running in the processor.

[0115] In an embodiment of the present application, a non-transitory computer-readable storage medium is further provided. The non-transitory computer-readable storage medium stores instructions. When the instructions are executed by a processor, the processor executes the method for scheduling failure diagnosis as described in the above embodiment.

[0116] In an embodiment of the present application, a computer program product is further provided, comprising computer executable instructions, which, when executed by a processor, implement the method for scheduling failure diagnosis as described in the aforementioned embodiment.

[0117] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.

Claims

1. A method for scheduling failure diagnosis, It is characterized in that include: Obtain a scheduling log generated by the k8s scheduling component during the execution of a scheduling process for a target Pod that failed to be scheduled; wherein the scheduling log records a plurality of abandoned nodes that were screened out by the k8s scheduling component during the scheduling process, and the scheduling log also records a screening execution event that caused each of the abandoned nodes to be screened out; Based on the scheduling log, determining the failure reason for the failure of scheduling the target Pod; wherein the failure reason includes the triggering reason of the screening execution event of the reference node selected from the multiple abandoned nodes; Generate Pod optimization tips based on the failure reasons.

2. The method according to claim 1, It is characterized in that The scheduling log includes a screening statistical result and an execution event record, wherein the screening statistical result includes a plurality of the abandoned nodes, and the execution event record includes a screening execution event that causes each of the abandoned nodes to be screened out; The determining, based on the scheduling log, a failure reason for the failure in scheduling the target Pod includes: Based on the screening statistical result, selecting the reference node from the plurality of abandoned nodes; Based on the execution event record, a triggering reason for the screening execution event of the reference node is determined.

3. The method according to claim 2, It is characterized in that The scheduling process includes multiple sub-processes executed sequentially, the screening statistical results include stage statistical results corresponding to different sub-processes, and the abandoned nodes screened out by the k8s scheduling component in any of the sub-processes are recorded in the corresponding stage statistical results; The selecting the reference node from the plurality of abandoned nodes based on the screening statistical result comprises: searching for the abandoned nodes from the stage statistical results in reverse order of the plurality of sub-processes until the number of the abandoned nodes searched reaches a set number; And, the set number of abandoned nodes searched out are determined as the reference nodes.

4. The method according to claim 2, It is characterized in that The k8s scheduling component performs screening of the abandoned nodes by calling multiple scheduling plug-ins in the scheduling process, and the execution event record includes plug-in screening records corresponding to different scheduling plug-ins, and the plug-in screening record records the screening execution event of the corresponding scheduling plug-in performing the screening operation on any one of the abandoned nodes; The determining, based on the execution event record, a triggering reason for the reference node's screening execution event includes: determining, based on the plug-in screening record, the scheduling plug-in that performs a screening operation on the reference node; And, based on the plug-in function of the scheduling plug-in that performs the screening operation on the reference node, a triggering cause of the screening execution event of the reference node is determined.

5. The method according to claim 4, It is characterized in that The plurality of scheduling plug-ins include at least one of a first type of scheduling plug-in, a second type of scheduling plug-in, and a third type of scheduling plug-in; The plug-in function of the first type of scheduling plug-in includes detecting whether the node available resources of any node meet the resource requirements of the target Pod, and the triggering reason for screening out the execution event determined based on the plug-in function of the first type of scheduling plug-in includes insufficient node available resources; The plug-in function of the second type of scheduling plug-in includes detecting whether the node configuration of any node meets the constraint condition of the target Pod, and the triggering reason for screening out the execution event determined based on the plug-in function of the second type of scheduling plug-in includes that the node configuration does not match the constraint condition of the target Pod; The plug-in function of the third type scheduling plug-in includes detecting the storage volume binding status of the target Pod and any node, and the triggering reason for screening out the execution event determined based on the plug-in function of the third type scheduling plug-in includes storage volume abnormality.

6. The method according to claim 1, It is characterized in that The generating of Pod optimization tips based on the failure cause includes: The Pod optimization prompt is generated based on the clustering results of the triggering causes of the screening execution events of a set number of the reference nodes; wherein the set number is greater than 1.

7. A device for scheduling failure diagnosis, It is characterized in that include: A log acquisition module is used to obtain a scheduling log generated by a k8s scheduling component during the execution of a scheduling process for a target Pod that failed to be scheduled; wherein the scheduling log records a plurality of abandoned nodes that were screened out by the k8s scheduling component during the scheduling process, and the scheduling log also records a screening execution event that caused each of the abandoned nodes to be screened out; A cause analysis module, used to determine the failure cause of the failure of scheduling the target Pod based on the scheduling log; wherein the failure cause includes a triggering cause of a screening execution event of a reference node selected from the plurality of abandoned nodes; The prompt generation module is used to generate a Pod optimization prompt based on the failure cause.

8. An electronic device, It is characterized in that The method comprises a processor configured to execute the method as claimed in any one of claims 1 to 6.

9. A non-transitory computer-readable storage medium, It is characterized in that The non-transitory computer-readable storage medium stores instructions which, when executed by a processor, cause the processor to perform the method of any one of claims 1 to 6.

10. A computer program product, It is characterized in that The method comprises computer executable instructions which, when executed by a processor, implement the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Scheduling optimization method and device

    CN112527486A

  • Cluster node processing method and system, equipment and medium

    CN114064229A

  • Node scheduling method and device based on Kubernetes cluster, electronic equipment and medium

    CN114296936A

  • Resource scheduling method for adjusting different resource calculation weights based on Kubernetes cluster characteristics

    CN115292027A

  • Map production abnormity positioning and processing method, system, medium and equipment

    CN116089243A