Container group expulsion method, device, node device and storage medium

By determining the multi-copy container group in the container cluster and judging its schedulability, the problem of the container group being unable to run stably after being evicted is solved and the stability of the cluster system is improved.

CN112540829BActive Publication Date: 2024-10-18HUNDSUN TECH
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202011486963.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-16
Publication Date
2024-10-18
Estimated Expiration
2040-12-16

AI Technical Summary

Technical Problem

In a container cluster, the evicted container group may not be scheduled to other node devices, resulting in repeated evictions and affecting system stability.

Method used

By identifying the multi-copy container group as the target in the container eviction list, it is determined whether it can be scheduled to other available node devices. If so, it is determined as a container group to be evicted to ensure that it can run stably without being repeatedly evicted.

Benefits of technology

It improves the stability of the container cluster, avoids the problem of repeated eviction of the container group due to insufficient resources, and ensures that it can be smoothly scheduled to run on other nodes after eviction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112540829B_ABST
    Figure CN112540829B_ABST
Patent Text Reader

Abstract

The present application proposes a container group expulsion method, apparatus, node device and storage medium, which relate to the field of container technology. A target container group is determined from multiple container groups that can be expelled, and when it is determined that the target container group can be scheduled to other available node devices except the target node device where the target container group is located, the target container group is determined as a container group to be expelled; in this way, even after the target container group is expelled, it can be ensured that the target container group can be scheduled to other available node devices for operation, and will not be repeatedly expelled, thereby improving the stability of the cluster system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of container technology, and in particular to a container group expulsion method, apparatus, node device and storage medium. Background Art

[0002] In a container cluster such as Kubernetes, a container group (pod) can be created by each node device (node) in the container cluster, so that each service can be deployed and run in the pod to achieve the purpose of rapid deployment of services.

[0003] Among them, since the pod deployed on the node device needs to consume resources on the node device, such as memory, disk, process PID (Process Identification), etc., and the resources of a single node device are generally limited; therefore, when the remaining resources of a node device in the container cluster are insufficient, at least part of the pods of the node device can be expelled, so that the node device can free up enough resources for the stable operation of the pod.

[0004] However, since the evicted pod may not necessarily be scheduled to other node devices in the container cluster for stable operation, the pod may be evicted repeatedly, resulting in the evicted pod being unable to be scheduled. Summary of the invention

[0005] The purpose of the present application is to provide a container group expulsion method, apparatus, node device and storage medium, which can improve the stability of the cluster system.

[0006] In order to achieve the above purpose, the technical solution adopted in this application is as follows:

[0007] In a first aspect, the present application provides a container group expulsion method, the method comprising:

[0008] According to the eviction priority order corresponding to each container group, traverse the multiple evictable container groups recorded in the container eviction list in turn, and determine the target container group in the container eviction list; wherein the target container group is a multiple replica container group among the multiple evictable container groups;

[0009] Determine whether the target container group can be scheduled to other available node devices in the container cluster except the target node device; wherein the container cluster includes multiple node devices, the target node device is a node device running the target container group among the multiple node devices, and the available node device is a node device capable of running the target container group among the multiple node devices;

[0010] When the target container group can be scheduled to other available node devices, the target container group is determined as the container group to be evicted.

[0011] In a second aspect, the present application provides a container group expelling device, the device comprising:

[0012] A processing module, configured to sequentially traverse a plurality of container groups that can be evicted recorded in a container eviction list according to an eviction priority order corresponding to each container group, and determine a target container group in the container eviction list; wherein the target container group is a multiple replica container group among the plurality of container groups that can be evicted;

[0013] A judgment module, used to judge whether the target container group can be scheduled to other available node devices in the container cluster except the target node device; wherein the container cluster includes multiple node devices, the target node device is a node device running the target container group among the multiple node devices, and the available node device is a node device capable of running the target container group among the multiple node devices;

[0014] The processing module is further configured to, when the target container group can be scheduled to other available node devices, determine the target container group as a container group to be evicted.

[0015] In a third aspect, the present application provides a node device, which includes a memory for storing one or more programs; a processor; when the one or more programs are executed by the processor, the above-mentioned container group eviction method is implemented.

[0016] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the above-mentioned container group expulsion method when executed by a processor.

[0017] The present application provides a container group expulsion method, apparatus, node device, and storage medium. A target container group is determined from multiple container groups that can be expelled, and when it is determined that the target container group can be scheduled to other available node devices except the target node device where the target container group is located, the target container group is determined as the container group to be expelled. In this way, even after the target container group is expelled, it is ensured that the target container group can be scheduled to other available node devices for operation, and will not be repeatedly expelled, thereby improving the stability of the cluster system.

[0018] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0020] Figure 1 A schematic diagram showing the architecture of a Kubernetes cluster.

[0021] Figure 2 A schematic structural block diagram of a node device provided in the present application is shown.

[0022] Figure 3 A schematic flow chart of the container group expulsion method provided by the present application is shown.

[0023] Figure 4 A schematic flow chart of the container group expelling device provided by the present application is shown.

[0024] In the figure: 100 - node device; 101 - memory; 102 - processor; 103 - communication interface; 300 - container group expulsion device; 301 - processing module; 302 - judgment module. DETAILED DESCRIPTION

[0025] In order to make the purpose, technical solutions and advantages of the present application clearer, the technical solutions in the present application will be clearly and completely described below in conjunction with the drawings in some embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Generally, the components of the present application described and shown in the drawings here can be arranged and designed in various different configurations.

[0026] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents some selected embodiments of the present application. All other embodiments obtained by ordinary technicians in the field without creative work based on some embodiments in the present application are within the scope of protection of the present application.

[0027] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0028] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0029] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0030] See also Figure 1 , Figure 1 An architectural diagram of a Kubernetes cluster is shown. The Kubernetes cluster may include a cluster master node (master) and multiple node devices. The cluster master node may receive a creation request sent by a user through a client, create a new pod, and schedule the new pod to run on one of the multiple node devices.

[0031] Understandably, Figure 1 For illustration only, the Kubernetes cluster includes three node devices. In some other possible implementations of the present application, the Kubernetes cluster may also include more or fewer node devices. The present application does not limit the number of node devices included in the Kubernetes cluster.

[0032] Among them, when the pod is running in the node device, it needs to use the hardware resources provided by the node device, such as memory, disk, process PID, etc., and the hardware resources owned by a single node device are generally limited; therefore, when the cluster master node schedules the newly created pod to the node device, it can combine the resource usage of each node device in the kubernetes cluster at the current moment and reasonably schedule the newly created pod to the node device with surplus hardware resources in the kubernetes cluster.

[0033] However, the hardware resources used by pods generally change dynamically. As the amount of service interaction data running in the pod increases, the amount of hardware resources occupied by each pod may also increase, causing the remaining hardware resources of the node device where the pod is located to be insufficient and unable to provide enough hardware resources for the pod to use, resulting in abnormal operation or even crash of the pod or node device.

[0034] Therefore, in order to maintain the stable operation of node devices and pods, a pod eviction mechanism is provided in the relevant technology. In a scenario such as a kubernetes cluster, the Kubelet service running on the node device can enable a control unit named EvictionManager, which is responsible for monitoring the usage of hardware resources such as memory, disk, process PID, etc. on the node device. When the usage of hardware resources on the node device exceeds a set threshold, EvictionManager can evict some pods running on the node device to release some hardware resources on the node device, thereby ensuring that the remaining pods and node devices that have not been evicted can maintain stable operation.

[0035] Among them, when determining the pods that need to be evicted, EvictionManager generally sorts them according to their respective eviction priorities and evicts the pods with the highest eviction priority first.

[0036] For example, in some possible scenarios, the EvictionManager can sort all pods based on the following two dimensions:

[0037] (1) Whether the pod to be evicted is a key pod such as a management pod or a static pod;

[0038] (2) Whether the pod to be evicted occupies relatively more reclaimable resources compared to other pods on the node device.

[0039] That is, when EvictionManager sorts all pods running on the node device, it first excludes all critical pods running on the node device and sorts only non-critical pods; then, for all non-critical pods, it sorts them according to the hardware resources occupied by each pod, such as memory, disk space, etc., and gives priority to evicting pods that occupy relatively more hardware resources.

[0040] In this way, according to the eviction policy in the above example, EvictionManager only needs to evict a small number of pods, which can release a large amount of hardware resources and ensure that other devices running on the node device can run stably.

[0041] Among them, for the evicted pod, the cluster master node can enable the scheduler to schedule the pod to other node devices to run in order to continuously provide services.

[0042] However, when the scheduler is scheduling the evicted pod to other node devices, other node devices may not be able to provide sufficient hardware resources for the evicted pod to run, and the evicted pod can only be rescheduled to the node device that was running first; and when the pod is still evicted according to the above strategy, the pod may be evicted again, resulting in the same pod being repeatedly evicted from the same node device, which in turn causes the evicted pod to be unable to be scheduled.

[0043] For example, Figure 1 In the scenario shown, when the EvictionManager running in node device 1 determines that the hardware resource usage on node device 1 exceeds a set threshold, the EvictionManager can evict some pods in node device 1, such as evict pod1 running in node device 1; however, the evicted pod1 may not be scheduled to node device 2 or node device 3 due to the large number of node resources required. After pod1 is evicted by the EvictionManager of node device 1, it may be rescheduled to node device 1 by the cluster master node; and according to the above-mentioned eviction strategy, pod1 may be evicted by the EvictionManager of node device 1; this cycle causes pod1 to be repeatedly evicted by the EvictionManager of node device 1.

[0044] Therefore, in order to solve at least some of the defects of the above strategy, some possible implementation methods provided by the present application are as follows: by determining a target container group from multiple container groups that can be evicted, and when it is determined that the target container group can be scheduled to other available node devices except the target node device where the target container group is located, the target container group is determined as the container group to be evicted; in this way, it can be ensured that the evicted target container group can be scheduled to other node devices for operation, and will not be repeatedly evicted.

[0045] See also Figure 2 , Figure 2A schematic structural block diagram of a node device 100 provided by the present application is shown. In some embodiments, the node device 100 may include a memory 101, a processor 102, and a communication interface 103. The memory 101, the processor 102, and the communication interface 103 are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these components may be electrically connected to each other via one or more communication buses or signal lines.

[0046] The memory 101 can be used to store software programs and modules, such as program instructions / modules corresponding to the container group expulsion device provided in the present application, and the processor 102 executes various functional applications and data processing by executing the software programs and modules stored in the memory 101, thereby executing the steps of the container group expulsion method provided in the present application. The communication interface 103 can be used to communicate signaling or data with other node devices.

[0047] Among them, the memory 101 can be, but is not limited to, random access memory (Random Access Memory, RAM), read only memory (Read Only Memory, ROM), programmable read-only memory (Programmable Read-Only Memory, PROM), erasable programmable read-only memory (Erasable Programmable Read-Only Memory, EPROM), electrically erasable programmable read-only memory (Electric Erasable Programmable Read-Only Memory, EEPROM), etc.

[0048] The processor 102 may be an integrated circuit chip with signal processing capability. The processor 102 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0049] Understandably, Figure 2 The structure shown is for illustration only. The node device 100 may also include Figure 2 More or fewer components as shown, or with Figure 2 Different configurations are shown. Figure 2 Each component shown in the figure can be implemented by hardware, software or a combination thereof.

[0050] Below Figure 2 The node device shown is used as an illustrative execution subject to exemplarily illustrate the container group expulsion method provided in the present application.

[0051] See also Figure 3 , Figure 3 A schematic flow chart of a container group expulsion method provided by the present application is shown. In some possible implementations, the container group expulsion method may include the following steps:

[0052] Step 201 , according to the eviction priority order corresponding to each container group, a plurality of container groups that can be evicted recorded in the container eviction list are traversed in sequence, and a target container group is determined in the container eviction list.

[0053] Step 203 , determine whether the target container group can be scheduled to other available node devices in the container cluster except the target node device; if yes, execute step 205 ; if no, execute step 201 .

[0054] Step 205: determine the target container group as the container group to be evicted.

[0055] In scenarios such as a kubernetes cluster, the CRD (Custom Resource Definition) function provided by the kubernetes cluster can be used to create a pre-eviction controller (PreEvictionController) service in advance in a node device in the kubernetes cluster. The node device can execute the program instructions or function modules corresponding to the pre-eviction controller service to perform the steps of the container group eviction method provided in the present application, and determine the pod to be evicted among all pods running in the kubernetes cluster.

[0056] It can be understood that, in some embodiments, for a Kubernetes cluster, the above-mentioned pre-eviction controller can be created only on one of the node devices in the Kubernetes cluster, and the created pre-eviction controller can be used to maintain all pods running in the Kubernetes cluster; or, for a Kubernetes cluster, a pre-eviction controller can be created for all the node devices in the Kubernetes cluster, and the pre-eviction controller running on each node device is responsible for maintaining all the pods running on each node device; or, the pre-eviction controller can be run on a node device outside the Kubernetes cluster, and by establishing communication between the pre-eviction controller and each node device in the Kubernetes cluster, the pre-eviction controller can maintain all the pods running in the Kubernetes cluster; the present application does not limit the implementation method of the pre-eviction controller.

[0057] Among them, during the process of executing the container group eviction method provided by the present application, the pre-eviction controller can receive the container eviction list sent by the Kubelet EvictionManager. The container eviction list can be generated by the EvictionManager and records all non-critical pods running on the node device, as well as each non-critical pod's corresponding replica status, eviction priority and other information.

[0058] In the process of executing step 201, in order to avoid the situation that the application running in the pod cannot continue to run after the single-replica pod is evicted, the pre-eviction controller can traverse the multiple evictable pods recorded in the container eviction list in sequence according to the eviction priority order corresponding to each pod in the container eviction list, and determine the multiple replica pods among the multiple evictable pods recorded in the container eviction list as the target pod.

[0059] That is to say, in the solution provided in the present application, it can be specified that single-replica pods are not evicted, but only multi-replica pods are evicted.

[0060] Next, for multiple node devices included in the container cluster, the pre-eviction controller may use the node device running the target pod among the multiple node devices as the target node device, and determine whether the target pod can be scheduled to other available node devices in the container cluster except the target node device by obtaining the remaining resource status of each node device. The available node device may be a node device that can run the target pod among the multiple node devices included in the container cluster; that is, the pre-eviction controller may first determine whether there is a node other than the target node device and whether it can run the target pod based on the remaining resource status of each node device in the container cluster.

[0061] Among them, when the pre-eviction controller determines that the target pod can be scheduled to other available node devices in the container cluster except the target node device, the pre-eviction controller can determine the target pod as the pod to be evicted, and then the EvictionManger evicts the pod to be evicted; otherwise, when the pre-eviction controller determines that the target pod cannot be scheduled to other available node devices in the container cluster except the target node device, the pre-eviction controller can return to execute step 201, take the next multi-replica pod as the target pod, and continue to execute the container group eviction method provided by the present application until all multi-replica pods recorded in the container eviction list are traversed.

[0062] For example, in the scenario of the above example, assuming that both pod1 and pod2 are multi-replica pods, and the node resources required by pod2 are less than the resources required by pod1, pod2 can run stably in node device 2, while pod1 cannot run stably in node device 2; then according to the relevant eviction scheme of the above example, pod1 will be evicted, which may cause pod1 to be repeatedly evicted; and according to the above eviction scheme provided in the present application, pod2 can be evicted from node device 1, and pod2 can be stably scheduled to run in node device 2, thereby avoiding repeated evictions.

[0063] It can be seen that the above solution provided by the present application determines a target container group from multiple container groups that can be evicted, and when it is determined that the target container group can be scheduled to other available node devices except the target node device where the target container group is located, the target container group is determined as the container group to be evicted; in this way, even after the target container group is evicted, it can be ensured that the target container group can be scheduled to other available node devices for operation, and will not be repeatedly evicted, thereby improving the stability of the cluster system.

[0064] It should be noted that, in some possible implementations, the pre-eviction controller may determine the eviction priority order corresponding to each pod according to the resource usage of each running pod during the execution of step 201; for example, for hardware resources of a set dimension, a pod that uses a larger amount of the hardware resources has a higher corresponding eviction priority.

[0065] In addition, in order to ensure the reliability of scheduling the target pod to other available node devices after being evicted, the pre-eviction controller may first search for all available node devices except the target node device in the container cluster during the execution of step 203 .

[0066] For example, in some embodiments, in order to flexibly find out the number of available node devices, the pre-eviction controller may create a node search strategy corresponding to the target pod according to the resource situation required by the target pod; illustratively, the pre-eviction controller may use the resource situation required by the target pod as the node search strategy; or, the pre-eviction controller may generate the node search strategy by adding a preset container resource amount based on the resource required by the target pod.

[0067] Then, the pre-eviction controller may determine, based on the node search policy, a node device in the container cluster that matches the node search policy as an available node device.

[0068] Exemplarily, the pre-eviction controller may compare the resource conditions in the node search strategy with the remaining resource conditions of other node devices in the container cluster, and determine all node devices whose remaining resource conditions satisfy the node search strategy as available node devices.

[0069] Alternatively, the pre-eviction controller may send the node search policy to the cluster master node and send a matching request to the cluster master node. The cluster master node may respond to the matching request, create a virtual image pod corresponding to the node search policy according to the resource demand request indicated by the node search policy, and enable the scheduler to attempt to schedule the virtual image pod to all node devices other than the target node device, thereby determining all node devices that can stably run the virtual image pod as available node devices.

[0070] Of course, it is understandable that after all available node devices are determined, all virtual image pods can be deleted.

[0071] Next, the pre-eviction controller may compare the number of available node devices with a pre-set first threshold based on the first threshold; wherein, when the number of available node devices reaches the first threshold, the pre-eviction controller may determine that the target pod can be scheduled to other available node devices; conversely, when the number of available node devices does not reach the first threshold, the pre-eviction controller may determine that the target pod cannot be scheduled to other available node devices.

[0072] For example, assuming that the first threshold is 3, when the pre-eviction controller determines that the container cluster includes at least 3 available node devices other than the target node device that can run the target pod, the pre-eviction controller can determine that the target pod can be scheduled to other available node devices; conversely, when the pre-eviction controller determines that the container cluster includes less than 3 available node devices other than the target node device that can run the target pod, the pre-eviction controller can determine that the target pod cannot be scheduled to other available node devices.

[0073] In addition, in the implementation manner described above, for example, in the process of determining available node devices using the created node search strategy, the pre-eviction controller may traverse all node devices in the container cluster one by one based on the node search strategy.

[0074] Among them, in some possible scenarios, there may be some node devices without idle node resources in the container cluster, that is, there may be node devices in the container cluster that cannot provide idle node devices for the target pod to run.

[0075] Therefore, in order to improve the search speed of available node devices and avoid invalid search processes, before matching available node devices based on the node search strategy, the pre-eviction controller can also first determine all node devices that currently have idle node resources in the container cluster.

[0076] For example, in some possible scenarios, assuming that a node device requests to evict a pod, it means that the node device currently has no surplus node resources to provide to the new pod; therefore, before finding out the available node devices, the pre-eviction controller can, based on the node device currently requesting to evict the pod, determine other node devices in the container cluster except the node device currently requesting to evict the pod as all the node devices currently having idle node resources.

[0077] Based on this, in the process of matching available node devices based on the node search strategy, the pre-eviction controller can determine the node devices that match the node search strategy among all node devices that currently have idle node resources as available node devices, without matching available node devices among all node devices included in the container cluster, so as to improve the search speed of available node devices.

[0078] Of course, it can be understood that the above is only an example, which illustrates that in some possible scenarios, the node device requesting to evict the pod belongs to a node device that currently has no idle node resources; in some other possible scenarios, the node device that currently has no idle node resources can also be determined based on the status identification information of each node device or the resource utilization situation, and this application does not limit this.

[0079] In addition, in some possible scenarios, when the pre-eviction controller finishes traversing the above container eviction list, there is still no target pod that can be scheduled to other available node devices, that is, there is no multi-replica pod that can be scheduled to other available node devices in the container eviction list, then the pre-eviction controller can determine the multi-replica pod with the highest eviction priority in the container eviction list as the pod to be evicted; in this way, while releasing as many node resources as possible, even if the pod is evicted and cannot be temporarily scheduled to other node devices, there are other replica pods to provide services, thereby avoiding service interruption after the single replica pod is evicted.

[0080] Furthermore, in some possible scenarios, when the pre-eviction controller determines the pod to be evicted, the EvictionManager running in the target node device can evict the pod to be evicted. In addition, the pre-eviction controller can also configure the state of the target node device to a scheduling-disabled state to indicate that the target node device is not used to create a new pod; that is, the target node device has executed the pod eviction operation, indicating that the current node resources of the target node device are insufficient. Therefore, the state of the target node device is configured to a scheduling-disabled state to avoid the evicted pod from being rescheduled to the target node device, thereby reducing the situation where the pod is repeatedly evicted.

[0081] In addition, in some possible scenarios, for the above-mentioned pod to be evicted, after the EvictionManager evicts the pod to be evicted, the pre-eviction controller can monitor the container status of the target object to which the pod to be evicted belongs. The container status can be used to indicate the replica status of the target object, that is, the number of replica pods currently owned by the target object.

[0082] Based on this, when the pre-eviction controller determines that the container state of the target object meets the set multi-copy condition, for example, when the number of pods belonging to the target object reaches the second threshold, the pre-eviction controller can configure the state of the target node device to allow scheduling to indicate that the target node device is allowed to be used to create a new pod; that is, when the container state of the target object meets the set multi-copy condition, it indicates that the previously evicted pod has been scheduled to other node devices and will not be scheduled to the target node device again to cause repeated evictions.

[0083] In addition, based on the same inventive concept as the above container group expulsion method provided by the present application, combined with Figure 4 As shown, the present application also provides a container group expelling device 300. In some embodiments, the container group expelling device 300 may include a processing module 301 and a judgment module 302. Among them:

[0084] The processing module 301 is used to traverse the multiple evictable container groups recorded in the container eviction list in turn according to the eviction priority order corresponding to each container group, and determine the target container group in the container eviction list; wherein the target container group is a multiple replica container group among the multiple evictable container groups;

[0085] A judgment module 302 is used to judge whether the target container group can be scheduled to other available node devices in the container cluster except the target node device; wherein the container cluster includes multiple node devices, the target node device is a node device running the target container group among the multiple node devices, and the available node device is a node device capable of running the target container group among the multiple node devices;

[0086] The processing module 301 is further configured to determine the target container group as a container group to be evicted when the target container group can be scheduled to other available node devices.

[0087] Optionally, in some possible implementations, when determining whether the target container group can be scheduled to other available node devices in the container cluster except the target node device, the determination module 302 is specifically configured to:

[0088] Find all available node devices except the target node device in the container cluster;

[0089] When the number of available node devices reaches a first threshold, it is determined that the target container group can be scheduled to other available node devices;

[0090] When the number of available node devices does not reach the first threshold, it is determined that the target container group cannot be scheduled to other available node devices.

[0091] Optionally, in some possible implementations, when the determination module 302 searches for available node devices other than the target node device in the container cluster, it is configured to:

[0092] Create a node search strategy corresponding to the target container group;

[0093] Node devices in the container cluster that match the node search strategy are determined as available node devices.

[0094] Optionally, in some possible implementations, before determining the node device in the container cluster that matches the node search strategy as an available node device, the determination module 302 is further configured to:

[0095] Determine all node devices in the container cluster that currently have idle node resources;

[0096] When determining the node device in the container cluster that matches the node search strategy as an available node device, the judgment module 302 is specifically used to:

[0097] Among all the node devices currently having idle node resources, the node devices matching the node search strategy are determined as available node devices.

[0098] Optionally, in some possible implementations, when determining all node devices that currently have idle node resources in the container cluster, the determination module 302 is specifically configured to:

[0099] The other node devices in the container cluster except the node device currently requesting to evict the container group are determined to be all the node devices currently having idle node resources.

[0100] Optionally, in some possible implementations, the processing module 301 is further configured to:

[0101] When there is no target container group in the container eviction list that can be scheduled to other available node devices, the corresponding multi-copy container group with the highest eviction priority in the container eviction list is determined as the container group to be evicted.

[0102] Optionally, in some possible implementations, the processing module 301 is further configured to:

[0103] The state of the target node device is configured as a scheduling-prohibited state; wherein the scheduling-prohibited state is used to indicate that the corresponding node device is not used to create a new container group.

[0104] Optionally, in some possible implementations, the processing module 301 is further configured to:

[0105] Monitor the container status of the target object to which the container group to be evicted belongs;

[0106] When the container state of the target object meets the set multiple copy condition, the state of the target node device is configured to be a scheduling-allowed state; wherein the scheduling-allowed state is used to indicate that the corresponding node device is allowed to be used to create a new container group.

[0107] Optionally, in some possible implementations, when determining that the container state of the target object meets the set multiple-copy condition, the processing module 301 is specifically configured to:

[0108] When the number of container groups belonging to the target object reaches a second threshold, it is determined that the container state of the target object meets the set multi-copy condition.

[0109] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods may also be implemented in other ways. The device embodiments described above are merely schematic, for example, the flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions and operations of the devices, methods and computer program products according to some embodiments of the present application. In this regard, each box in the flowchart or block diagram may represent a module, a program segment or a part of a code, and the module, program segment or a part of a code includes one or more executable instructions for implementing a specified logical function.

[0110] It should also be noted that in some alternative implementations, the functions marked in the blocks may also occur in a different order than that marked in the accompanying drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in the opposite order, depending on the functions involved.

[0111] It should also be noted that each box in the block diagram and / or flowchart, and combinations of boxes in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.

[0112] In addition, in some embodiments of the present application, the functional modules may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0113] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in some embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories, random access memories, magnetic disks or optical disks.

[0114] The above description is only a partial embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

[0115] It will be apparent to those skilled in the art that the present application is not limited to the details of the exemplary embodiments described above, and that the present application can be implemented in other specific forms without departing from the spirit or essential features of the present application. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the present application is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims be included in the present application. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.

Claims

1. A container group expulsion method, characterized in that: Applied to a node device, the node device includes a pre-created pre-eviction controller service using a CRD function provided by a kubernetes cluster, the method comprising: According to the eviction priority order corresponding to each container group, the multiple evictable container groups recorded in the container eviction list are traversed in sequence, and a target container group is determined in the container eviction list; wherein the target container group is a multi-copy container group among the multiple evictable container groups, and the eviction priority order corresponding to each container group is determined according to the resource usage of each running container group; Determine whether the target container group can be scheduled to other available node devices in the container cluster except the target node device; wherein the container cluster includes multiple node devices, the target node device is a node device running the target container group among the multiple node devices, and the available node device is a node device capable of running the target container group among the multiple node devices; When the target container group can be scheduled to other available node devices, the target container group is determined as the container group to be evicted; when the target container group cannot be scheduled to other available node devices, the step of returning to execute, in accordance with the eviction priority order corresponding to each container group, sequentially traversing the multiple evictable container groups recorded in the container eviction list, determining the next target container group from the container eviction list, and determining whether the next target container group can be scheduled to other available node devices in the container cluster except the target node device.

2. The method according to claim 1, characterized in that The determining whether the target container group can be scheduled to other available node devices in the container cluster except the target node device includes: Searching for all available node devices except the target node device in the container cluster; When the number of available node devices reaches a first threshold, determining that the target container group can be scheduled to other available node devices; When the number of the available node devices does not reach the first threshold, it is determined that the target container group cannot be scheduled to other available node devices.

3. The method according to claim 2, characterized in that The searching for available node devices other than the target node device in the container cluster includes: Create a node search strategy corresponding to the target container group; A node device in the container cluster that matches the node search strategy is determined as an available node device.

4. The method according to claim 3, characterized in that Before determining the node device in the container cluster that matches the node search strategy as an available node device, the method further includes: Determine all node devices in the container cluster that currently have idle node resources; The step of determining a node device in the container cluster that matches the node search strategy as an available node device includes: The node devices that match the node search strategy among all the node devices that currently have idle node resources are determined as available node devices.

5. The method according to claim 4, characterized in that The determining of all node devices that currently have idle node resources in the container cluster includes: The other node devices in the container cluster except the node device currently requesting to evict the container group are determined to be all the node devices currently having idle node resources.

6. The method according to any one of claims 1 to 5, characterized in that The method further comprises: When there is no target container group in the container eviction list that can be scheduled to other available node devices, the corresponding multi-copy container group with the highest eviction priority in the container eviction list is determined as the container group to be evicted.

7. The method according to any one of claims 1 to 5, characterized in that The method further comprises: The state of the target node device is configured as a scheduling-prohibited state; wherein the scheduling-prohibited state is used to indicate that the corresponding node device is not used to create a new container group.

8. The method according to claim 7, characterized in that The method further comprises: Monitor the container status of the target object to which the to-be-evicted container group belongs; When the container state of the target object meets the set multiple-copy condition, the state of the target node device is configured as a scheduling-allowed state; wherein the scheduling-allowed state is used to indicate that the corresponding node device is allowed to be used to create a new container group.

9. The method according to claim 8, characterized in that The container status of the target object meets the set multiple copy conditions, including: When the number of container groups belonging to the target object reaches a second threshold, it is determined that the container state of the target object meets the set multiple-copy condition.

10. A container group expelling device, characterized in that: Applied to a node device, the node device includes a pre-created pre-eviction controller service using a CRD function provided by a kubernetes cluster, and the device includes: A processing module, configured to sequentially traverse a plurality of evictable container groups recorded in a container eviction list according to an eviction priority order corresponding to each container group, and determine a target container group in the container eviction list; wherein the target container group is a multi-copy container group among the plurality of evictable container groups, and the eviction priority order corresponding to each container group is determined according to resource usage of each running container group; A judgment module, used to judge whether the target container group can be scheduled to other available node devices in the container cluster except the target node device; wherein the container cluster includes multiple node devices, the target node device is a node device running the target container group among the multiple node devices, and the available node device is a node device capable of running the target container group among the multiple node devices; The processing module is further configured to, when the target container group can be scheduled to other available node devices, determine the target container group as a container group to be evicted; when the target container group cannot be scheduled to other available node devices, return to execute the step of traversing the multiple evictable container groups recorded in the container eviction list in sequence according to the eviction priority order corresponding to each container group, determine the next target container group from the container eviction list, and determine whether the next target container group can be scheduled to other available node devices in the container cluster except the target node device.

11. The device according to claim 10, characterized in that When judging whether the target container group can be scheduled to other available node devices in the container cluster except the target node device, the judging module is specifically used to: Searching for all available node devices except the target node device in the container cluster; When the number of available node devices reaches a first threshold, determining that the target container group can be scheduled to other available node devices; When the number of the available node devices does not reach the first threshold, it is determined that the target container group cannot be scheduled to other available node devices.

12. The device according to claim 11, characterized in that When the determination module searches for available node devices other than the target node device in the container cluster, the determination module is used to: Create a node search strategy corresponding to the target container group; A node device in the container cluster that matches the node search strategy is determined as an available node device.

13. The device according to claim 12, characterized in that Before determining the node device in the container cluster that matches the node search strategy as an available node device, the judgment module is further used to: Determine all node devices in the container cluster that currently have idle node resources; When the judgment module determines the node device in the container cluster that matches the node search strategy as an available node device, it is specifically used to: The node devices that match the node search strategy among all the node devices that currently have idle node resources are determined as available node devices.

14. The device according to claim 13, characterized in that When determining all node devices that currently have idle node resources in the container cluster, the judgment module is specifically used to: The other node devices in the container cluster except the node device currently requesting to evict the container group are determined to be all the node devices currently having idle node resources.

15. The device according to any one of claims 10 to 14, characterized in that The processing module is also used for: When there is no target container group in the container eviction list that can be scheduled to other available node devices, the corresponding multi-copy container group with the highest eviction priority in the container eviction list is determined as the container group to be evicted.

16. The device according to any one of claims 10 to 14, characterized in that The processing module is also used for: The state of the target node device is configured as a scheduling-prohibited state; wherein the scheduling-prohibited state is used to indicate that the corresponding node device is not used to create a new container group.

17. The device according to claim 16, characterized in that The processing module is also used for: Monitor the container status of the target object to which the to-be-evicted container group belongs; When the container state of the target object meets the set multiple-copy condition, the state of the target node device is configured as a scheduling-allowed state; wherein the scheduling-allowed state is used to indicate that the corresponding node device is allowed to be used to create a new container group.

18. The device according to claim 17, characterized in that When determining that the container state of the target object meets the set multiple-copy condition, the processing module is specifically configured to: When the number of container groups belonging to the target object reaches a second threshold, it is determined that the container state of the target object meets the set multiple-copy condition.

19. A node device, characterized in that: include: A memory for storing one or more programs; processor; When the one or more programs are executed by the processor, the method according to any one of claims 1 to 9 is implemented.

20. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.

Citation Information

Patent Citations

  • Cluster resource scheduling method, device and equipment and storage medium

    CN110727512A

  • Multi-dimensional resource scheduling method under Kubernetes cluster architecture system

    CN111522639A

  • Cluster node load balancing method and device, and computer storage medium

    CN111694633A