Disk container expelling method and device, equipment and storage medium

By sorting and traversing the temporary storage usage in the container orchestration platform, determining the target container and performing the eviction operation according to preset conditions, the problem of inability to effectively evict pods that actually occupy more disks in the prior art is solved, and resource recycling is realized the adequacy of the

CN119441072APending Publication Date: 2025-02-14SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411540224.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

When the node disk alarms, the existing eviction method cannot effectively evict pods that actually occupy more disks, but instead evict pods with lower priority but smaller disks in actual use, resulting in insufficient resource recycling.

Method used

In the container orchestration platform, when the node triggers disk eviction and the preset feature gating is turned on, the temporary storage usage of the container is sorted based on the container, and the target container with the most temporary storage usage is traversed. If its usage exceeds the preset threshold and If the preset eviction conditions are met, the eviction operation will be performed.

Benefits of technology

Effectively evict pods that actually occupy more disks, avoid evict pods that actually occupy less disks, and thus evict as few containers as possible and recycle sufficient resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119441072A_ABST
    Figure CN119441072A_ABST
Patent Text Reader

Abstract

The invention discloses a disk container expelling method, device and equipment and a storage medium, and relates to the technical field of container arrangement, and the method comprises the following steps: when a node triggers disk expelling and a preset characteristic gating is in an open state, performing sorting based on a temporary storage usage amount in a container; traversing the container column to obtain a target container with the maximum temporary storage usage amount; if the temporary storage usage amount in the target container exceeds a preset threshold value, whether the target container meets a preset expelling condition or not is judged, and expelling operation is executed based on a judgment result; the preset expelling condition is that the target container is a non-static container or a container which does not meet a preset priority condition or a container which is not deployed independently or a container which does not use local storage or a container which is not configured with a preset ignoring annotation. The target containers which meet the preset expelling condition and have the temporary storage usage amount exceeding the preset threshold value are expelled, the containers actually occupying more disks can be expelled, the containers are expelled as few as possible, and enough resources are recycled.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of container arrangement, and in particular to a disk container expulsion method, device, equipment and storage medium. Background Art

[0002] At present, the order of existing eviction methods has the following problem: if a pod (i.e., the basic unit deployed and managed in a Kubernetes cluster; Kubernetes is a container orchestration system) has a high priority and a large or no request volume is set, when the node disk alarm triggers eviction, some pods with lower priorities will be evicted. However, these pods with lower priorities may actually use less disk space, while pods that actually use more disk space are not evicted because of their high priority. This results in the node evicting more invalid pods in order to recycle resources.

[0003] As can be seen from the above, how to evict pods that actually occupy more disk space and avoid nodes evicting too many pods that actually occupy less disk space is a problem that needs to be solved urgently. Summary of the invention

[0004] In view of this, the purpose of the present invention is to provide a disk container eviction method, device, equipment and storage medium, which can evict pods that actually occupy more disks and avoid nodes evicting too many pods that actually occupy less disks. The specific scheme is as follows:

[0005] In a first aspect, the present application provides a disk container eviction method, which is applied to a container orchestration platform, comprising:

[0006] When a node triggers disk eviction and the preset feature gate is turned on, the container column is sorted based on the temporary storage usage in the container;

[0007] By traversing the container list, obtaining the target container with the largest temporary storage usage;

[0008] If the temporary storage usage in the target container exceeds a preset threshold, determining whether the target container meets a preset eviction condition, and performing a corresponding eviction operation based on the determination result;

[0009] The preset eviction condition is that the target container is a non-static container or a container that does not meet a preset priority condition or a container that is not deployed separately or a container that does not use local storage or a container that is not configured with a preset ignore annotation.

[0010] Optionally, when the node triggers disk eviction and the preset feature gating is in an on state, before sorting based on the temporary storage usage in the container to obtain the container column, the method further includes:

[0011] The temporary storage usage of the container is collected based on a preset time interval, and the temporary storage usage is stored in the container.

[0012] Optionally, when the node triggers disk eviction and the preset feature gating is in an on state, before sorting based on the temporary storage usage in the container to obtain the container column, the method further includes:

[0013] Obtaining a preset feature gating by configuring the container orchestration platform parameters, and determining whether the preset feature gating is in an open state;

[0014] If the preset characteristic gating is in the on state, the step of sorting based on the temporary storage usage in the container to obtain the container column is triggered.

[0015] Optionally, after determining whether the preset characteristic gating is in an on state, the method further includes:

[0016] If the preset feature gating is in a closed state, the existing eviction strategy is executed;

[0017] The existing eviction strategies include a first eviction strategy for evicting containers that meet a low priority condition, a second eviction strategy for evicting non-static containers, and a third eviction strategy for evicting non-mirrored containers.

[0018] Optionally, when the node triggers disk eviction and the preset feature gating is in an on state, sorting based on temporary storage usage in the container to obtain a container column includes:

[0019] When a node is detected to have triggered disk eviction, check whether it is a disk pressure alarm;

[0020] If it is not a disk pressure alarm, the existing eviction strategy is executed;

[0021] If it is a disk pressure alarm, the step of determining whether the preset characteristic gating is in an open state is triggered.

[0022] Optionally, if the temporary storage usage in the target container exceeds a preset threshold, determining whether the target container satisfies a preset eviction condition includes:

[0023] Determine whether the temporary storage usage in the target container exceeds a preset threshold;

[0024] If the temporary storage usage in the target container exceeds a preset threshold, triggering the step of determining whether the target container satisfies a preset eviction condition;

[0025] If the temporary storage usage in the target container does not exceed a preset threshold, the step of traversing the container list is exited.

[0026] Optionally, the determining whether the target container satisfies a preset eviction condition and performing a corresponding eviction operation based on the determination result includes:

[0027] Determining whether the target container meets a preset expulsion condition;

[0028] If the target container meets the preset eviction condition, performing an eviction operation on the target container;

[0029] If the target container does not meet the preset eviction condition, the process jumps to the step of traversing the container list to obtain the target container with the largest temporary storage usage.

[0030] In a second aspect, the present application provides a disk container eviction device, which is applied to a container orchestration platform, including:

[0031] The container sorting module is used to sort the container columns based on the temporary storage usage in the container when the node triggers disk eviction and the preset feature gate is turned on;

[0032] A container list traversal module, used to obtain the target container with the largest temporary storage usage by traversing the container list;

[0033] A container eviction module is used to determine whether the target container meets a preset eviction condition if the temporary storage usage in the target container exceeds a preset threshold, and perform a corresponding eviction operation based on the determination result; wherein the preset eviction condition is that the target container is a non-static container or a container that does not meet a preset priority condition or a container that is not deployed separately or a container that does not use local storage or a container that is not configured with a preset ignore annotation.

[0034] In a third aspect, the present application provides an electronic device, including:

[0035] Memory, used to store computer programs;

[0036] The processor is used to execute the computer program to implement the aforementioned disk container eviction method.

[0037] In a fourth aspect, the present application provides a computer-readable storage medium for storing a computer program, wherein the computer program implements the aforementioned disk container eviction method when executed by a processor.

[0038] In this application, when a node triggers disk eviction and the preset feature gating is in the on state, the container column is sorted based on the temporary storage usage in the container, and the target container with the largest temporary storage usage is obtained by traversing the container column; if the temporary storage usage in the target container exceeds the preset threshold, it is determined whether the target container meets the preset eviction condition, and the corresponding eviction operation is performed based on the judgment result; wherein the preset eviction condition is that the target container is a non-static container or a container that does not meet the preset priority condition or a container that is not deployed separately or a container that does not use local storage or a container that is not configured with a preset ignore annotation. As can be seen from the above, before sorting the container column based on the temporary storage usage in the container to obtain the container column, the preset feature gating is first determined whether it is in the on state. When the node triggers disk eviction and the preset feature gating is in the on state, the step of traversing the container column can be performed, and the target container with the largest temporary storage usage is obtained based on the traversal result. If the temporary storage usage in the target container exceeds the preset threshold and the target container meets the preset eviction condition, the eviction operation is performed on the target container. In this way, the target container that meets the preset eviction conditions and whose temporary storage usage exceeds the preset threshold will be evicted, which can evict containers that actually occupy more disk space and avoid the node evicting too many containers that actually occupy less disk space, thereby evicting as few containers as possible and recovering enough resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0040] Figure 1 A flow chart of a disk container expulsion method disclosed in this application;

[0041] Figure 2 A specific disk container eviction method flow chart provided for this application;

[0042] Figure 3 A schematic diagram of the structure of a disk container ejection device disclosed in the present application;

[0043] Figure 4 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION

[0044] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0045] At present, the existing eviction methods can only evict pods with lower priorities according to the priority conditions, but these pods may actually use less disk space, while pods that actually use more disk space are not evicted because of their high priority, which results in the node evicting more invalid pods in order to recycle resources. To this end, the present application provides a disk container eviction method that can evict pods that actually occupy more disk space and avoid the node evicting too many pods that actually occupy less disk space.

[0046] See also Figure 1 As shown, an embodiment of the present invention discloses a disk container eviction method, which is applied to a container orchestration platform, and includes:

[0047] Step S11: When the node triggers disk eviction and the preset feature gating is in the on state, sorting is performed based on the temporary storage usage in the container to obtain a container column.

[0048] In this embodiment, before the preset feature gating is turned on, kubelet (i.e., container orchestration platform) will periodically collect the temporary storage usage of the container and store it in the pod information. Specifically, when the node triggers disk eviction and the preset feature gating is turned on, before sorting based on the temporary storage usage in the container to obtain the container column, it also includes: collecting the temporary storage usage of the container based on the preset time interval, and storing the temporary storage usage in the container.

[0049] It can be understood that, when the container orchestration platform parameters are configured to enable the preset feature gating, when an eviction event occurs, the configuration items corresponding to the configuration parameters in the container orchestration platform parameters are obtained, and the status of the configuration items is judged to execute the corresponding eviction strategy based on the judgment result. Specifically, when the node triggers disk eviction and the preset feature gating is in the on state, before sorting based on the temporary storage usage in the container to obtain the container column, it also includes: obtaining the preset feature gating by configuring the container orchestration platform parameters, and judging whether the preset feature gating is in the on state; if the preset feature gating is in the on state, triggering the step of sorting based on the temporary storage usage in the container to obtain the container column. After judging whether the preset feature gating is in the on state, it also includes: if the preset feature gating is in the off state, executing the existing eviction strategy; wherein the existing eviction strategy includes a first eviction strategy for evicting containers that meet low priority conditions, a second eviction strategy for evicting non-static containers, and a third eviction strategy for evicting non-mirrored containers.

[0050] It can be further understood that the feature can be enabled by configuring the kubelet parameters EvictMostDiskUsedPod (i.e., clearing most used containers) and EvictMostUsedPodLimitSize (i.e., clearing the most commonly used container limit size). When kubelet starts, all configuration items in the configuration are read and stored in memory. When an eviction event occurs, the parameter is read from the configuration item. If the configuration item is turned on, the eviction policy of the present invention will be executed; if the configuration item is closed, the original eviction policy of Kubernetes will be executed; it should be noted that the original eviction policy of Kubernetes is static pod, mirror pod and pod with a priority of more than 2000000000 will not be evicted; after sorting according to the pod temporary storage usage exceeding the request amount, the priority of the pod, and the temporary storage usage of the pod, the pods are evicted in order. The parameter configuration of the container orchestration platform can be adjusted accordingly according to the actual situation, and is not specifically limited here.

[0051] In this embodiment, when the container orchestration platform detects that a node triggers eviction, it executes a corresponding eviction strategy by detecting whether the disk pressure alarms. Specifically, when the node triggers disk eviction and the preset feature gating is in the on state, the container column is obtained by sorting based on the temporary storage usage in the container, including: when it is detected that the node triggers disk eviction, it detects whether it is a disk pressure alarm; if it is not a disk pressure alarm, the existing eviction strategy is executed; if it is a disk pressure alarm, the step of determining whether the preset feature gating is in the on state is triggered.

[0052] It is understandable that when kubelet detects that a node triggers eviction, it will first check whether there is a disk pressure alarm. If there is no disk pressure alarm, the existing eviction process will be executed; if the disk pressure alarm has been triggered, it will check whether the preset feature gate is turned on. If the preset feature gate is not turned on and is in the closed state, the existing eviction process will also be executed. Further, after obtaining the temporary storage usage in the container, the container is sorted in descending order based on the temporary storage usage in the container to obtain the corresponding container column.

[0053] Step S12: Obtain the target container with the largest temporary storage usage by traversing the container list.

[0054] In this embodiment, when a node triggers disk eviction and the preset feature gating is in an on state, the sorted container column is traversed, and the target container with the largest temporary storage usage is obtained based on the traversal result.

[0055] Step S13: If the temporary storage usage in the target container exceeds a preset threshold, determine whether the target container meets a preset eviction condition, and perform a corresponding eviction operation based on the determination result; wherein the preset eviction condition is that the target container is a non-static container or a container that does not meet a preset priority condition or a container that is not deployed separately or a container that does not use local storage or a container that is not configured with a preset ignore annotation.

[0056] In this embodiment, it is determined whether the temporary storage usage in the target container exceeds a preset threshold, and whether the target container that exceeds the preset threshold satisfies a preset eviction condition, so as to execute a corresponding eviction policy based on the determination result. Specifically, if the temporary storage usage in the target container exceeds the preset threshold, it is determined whether the target container satisfies the preset eviction condition, including: determining whether the temporary storage usage in the target container exceeds the preset threshold; if the temporary storage usage in the target container exceeds the preset threshold, triggering the step of determining whether the target container satisfies the preset eviction condition; if the temporary storage usage in the target container does not exceed the preset threshold, exiting the step of traversing the container column. It can be understood that the sorted pods are traversed to check whether the pods have exceeded the preset threshold. If no pod exceeds the preset threshold, the traversal of the container column is exited.

[0057] It can be understood that if the temporary storage usage in the target container exceeds a preset threshold, it is determined whether the target container meets the preset eviction condition, and a corresponding eviction strategy is executed based on the determination result. Specifically, the determination of whether the target container meets the preset eviction condition and the execution of a corresponding eviction operation based on the determination result include: determining whether the target container meets the preset eviction condition; if the target container meets the preset eviction condition, executing an eviction operation on the target container; if the target container does not meet the preset eviction condition, jumping to the step of traversing the container list to obtain the target container with the largest temporary storage usage.

[0058] Furthermore, if there are pods exceeding the preset threshold, it is checked whether the pods can meet the preset eviction conditions. If the pods meet the preset eviction conditions, the pod eviction action is performed. After the pods are evicted, the step of traversing the container column is exited, that is, only one pod is evicted at a time. If the pod does not meet the preset eviction conditions, the traversal of the next pod continues. If the policy of ignoring this embodiment is configured in the pod's annotation, the pod will not be evicted. It is worth mentioning that some pods may use temporary storage to store some logs and other content, which may lead to an increase in temporary storage usage, but this is part of the business and the container should not be evicted, so the corresponding parameters can be configured in the pod's annotation to ignore the policy of this embodiment to ensure that the pod will not be evicted.

[0059] In this embodiment, the preset expulsion condition is that the target container is a non-static container. Specifically, the static pod is started by kubelet. Even if the static pod is expelled, it will be redeployed on the current node, which is a useless expulsion. Therefore, when the target container is a non-static container, the target container will not be expelled; the preset expulsion condition is that the target container is a container that does not meet the preset priority condition. The target container is a container with a non-system-cluster priority (that is, the priority cannot exceed 2000000000), and the pod with a high priority will not be expelled. By increasing the pod priority, the container can be prevented from being mistakenly expelled, which may cause interruption of important services. The preset expulsion condition is that the target container is not a container that is deployed separately, because the separately deployed pod is not managed by a controller, so if the separate pod is evicted and will not be redeployed, the corresponding service will be unavailable, so the separately deployed pod will not be evicted; the preset expulsion condition is that the target container is a container that does not use local storage. After determining the target container, it will be determined whether the target container uses local storage. If the target container uses local storage, the target container will not be evicted, because if the target container is scheduled to other nodes, it will cause the loss of storage data, which will cause business interruption and problems, so the pod using local storage cannot be evicted; the preset expulsion condition is that the target container is a container that is not configured with ignore annotations, and the container can be avoided from being evicted by the eviction policy of this embodiment by configuring ignore annotations. It should be pointed out that the judgment condition of container priority can be adjusted accordingly according to actual conditions, and no specific limitation is made here.

[0060] As can be seen from the above, before the present application sorts the temporary storage usage in the container to obtain the container column, it first determines whether the preset feature gate is in the on state. When the node triggers disk eviction and the preset feature gate is in the on state, the step of traversing the container column can be performed, and the target container with the largest temporary storage usage is obtained based on the traversal result. If the temporary storage usage in the target container exceeds the preset threshold and the target container meets the preset eviction condition, the eviction operation is performed on the target container. In this way, the target container that meets the preset eviction condition and the temporary storage usage exceeds the preset threshold is evicted, which can evict containers that actually occupy more disks and avoid nodes evicting too many containers that actually occupy less disks, thereby evicting as few containers as possible and recovering enough resources.

[0061] It can be seen from the above embodiments that the present application evicts target containers that meet preset eviction conditions and whose temporary storage usage exceeds a preset threshold, so as to evict containers that actually occupy more disks. Therefore, the process of evict- ing target containers is described.

[0062] For further information, see Figure 2 As shown, an embodiment of the present invention provides a specific flow chart of a disk container eviction method, which is applied to a container orchestration platform, including:

[0063] When the node of the container orchestration platform triggers disk eviction, the pods are sorted according to the temporary storage usage, and the sorted pod column (i.e., container column) is traversed to obtain the target pod (i.e., target container) with the largest temporary storage usage; if the temporary storage usage of the target pod exceeds the preset threshold, it is determined whether the target pod can be evicted, that is, whether the target pod meets the preset eviction condition. If the target pod meets the preset eviction condition, the target pod is evicted; if the target pod does not meet the preset eviction condition, it jumps to the step of traversing the sorted pod column (i.e., container column); if the temporary storage usage of the target pod does not exceed the preset threshold, the traversal is exited. It should be noted that only one target pod is evicted each time the traversal is performed.

[0064] As can be seen from the above, by evicting target containers that meet the preset eviction conditions and whose temporary storage usage exceeds the preset threshold, containers that occupy more disks can be evicted first, so that the fewest containers can be evicted and the most resources can be recovered; frequent evictions can be avoided by setting the preset threshold.

[0065] Accordingly, see Figure 3 As shown, the present application also provides a disk container eviction device, which is applied to a container orchestration platform, including:

[0066] A container sorting module 11 is used to sort the container columns based on the temporary storage usage in the container when the node triggers disk eviction and the preset feature gating is in the on state;

[0067] A container list traversal module 12 is used to obtain the target container with the largest temporary storage usage by traversing the container list;

[0068] The container eviction module 13 is used to determine whether the target container meets a preset eviction condition if the temporary storage usage in the target container exceeds a preset threshold, and perform a corresponding eviction operation based on the determination result; wherein the preset eviction condition is that the target container is a non-static container or a container that does not meet a preset priority condition or a container that is not deployed separately or a container that does not use local storage or a container that is not configured with a preset ignore annotation.

[0069] As can be seen from the above, before the present application sorts the temporary storage usage in the container to obtain the container column, it first determines whether the preset feature gate is in the on state. When the node triggers disk eviction and the preset feature gate is in the on state, the step of traversing the container column can be performed, and the target container with the largest temporary storage usage is obtained based on the traversal result. If the temporary storage usage in the target container exceeds the preset threshold and the target container meets the preset eviction condition, the eviction operation is performed on the target container. In this way, the target container that meets the preset eviction condition and the temporary storage usage exceeds the preset threshold is evicted, which can evict containers that actually occupy more disks and avoid nodes evicting too many containers that actually occupy less disks, thereby evicting as few containers as possible and recovering enough resources.

[0070] In some specific implementations, the disk container ejection device may further include:

[0071] The usage collection unit is used to collect the temporary storage usage of the container based on a preset time interval and store the temporary storage usage in the container.

[0072] In some specific implementations, the disk container ejection device may further include:

[0073] A feature gating determination unit, configured to obtain a preset feature gating by configuring a container orchestration platform parameter, and determine whether the preset feature gating is in an open state;

[0074] The characteristic gating opening unit is used to trigger the step of obtaining the container column by sorting based on the temporary storage usage in the container if the preset characteristic gating is in the opening state.

[0075] In some specific implementations, the disk container ejection device may further include:

[0076] The first eviction strategy execution unit is configured to execute an existing eviction strategy if the preset characteristic gating is in a closed state.

[0077] In some specific implementations, the container sorting module 11 may specifically include:

[0078] A disk pressure judgment unit, used to detect whether it is a disk pressure alarm when it is detected that a node triggers disk eviction;

[0079] A second eviction strategy execution unit, configured to execute an existing eviction strategy if it is not a disk pressure alarm;

[0080] The disk pressure alarm unit is used to trigger the step of determining whether the preset characteristic gating is in an open state if a disk pressure alarm is generated.

[0081] In some specific implementations, the container expulsion module 13 may specifically include:

[0082] A usage determination unit, configured to determine whether the temporary storage usage in the target container exceeds a preset threshold;

[0083] a first target container determination unit, configured to trigger the step of determining whether the target container satisfies a preset eviction condition if the temporary storage usage in the target container exceeds a preset threshold;

[0084] The container traversal exit unit is used to exit the step of traversing the container list if the temporary storage usage in the target container does not exceed a preset threshold.

[0085] In some specific implementations, the container expulsion module 13 may specifically include:

[0086] A second target container determination unit, configured to determine whether the target container satisfies a preset expulsion condition;

[0087] a target container eviction unit, configured to perform an eviction operation on the target container if the target container satisfies a preset eviction condition;

[0088] The target container determining unit is configured to jump to the step of obtaining the target container with the largest temporary storage usage by traversing the container list if the target container does not meet the preset eviction condition.

[0089] Furthermore, the present application also discloses an electronic device. Figure 4 This is a structural diagram of an electronic device 20 according to an exemplary embodiment, and the content in the diagram cannot be regarded as any limitation on the scope of use of this application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the disk container expulsion method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.

[0090] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0091] In addition, the memory 22 as a carrier for resource storage may be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon may include an operating system 221, a computer program 222, etc., and the storage method may be temporary storage or permanent storage.

[0092] The operating system 221 is used to manage and control the hardware devices and computer program 222 on the electronic device 20, and can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the disk container expulsion method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.

[0093] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the above-disclosed disk container eviction method. For the specific steps of the method, reference may be made to the corresponding contents disclosed in the above-disclosed embodiments, and no further description will be given here.

[0094] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0095] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0096] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0097] Finally, 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 presence of other identical elements in the process, method, article or device including the elements.

[0098] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of ​​the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A disk container eviction method, characterized in that: Applied to container orchestration platforms, including: When a node triggers disk eviction and the preset feature gate is turned on, the container column is sorted based on the temporary storage usage in the container; By traversing the container list, obtaining the target container with the largest temporary storage usage; If the temporary storage usage in the target container exceeds a preset threshold, determining whether the target container meets a preset eviction condition, and performing a corresponding eviction operation based on the determination result; The preset eviction condition is that the target container is a non-static container or a container that does not meet a preset priority condition or a container that is not deployed separately or a container that does not use local storage or a container that is not configured with a preset ignore annotation.

2. The disk container expulsion method according to claim 1, characterized in that: When the node triggers disk eviction and the preset feature gating is in the on state, before sorting based on the temporary storage usage in the container to obtain the container column, the method further includes: The temporary storage usage of the container is collected based on a preset time interval, and the temporary storage usage is stored in the container.

3. The disk container expulsion method according to claim 1, characterized in that: When the node triggers disk eviction and the preset feature gating is in the on state, before sorting based on the temporary storage usage in the container to obtain the container column, the method further includes: Obtaining a preset feature gating by configuring the container orchestration platform parameters, and determining whether the preset feature gating is in an open state; If the preset characteristic gating is in the on state, the step of sorting based on the temporary storage usage in the container to obtain the container column is triggered.

4. The disk container expulsion method according to claim 3, characterized in that: After determining whether the preset characteristic gating is in an on state, the method further includes: If the preset feature gating is in a closed state, the existing eviction strategy is executed; The existing eviction strategies include a first eviction strategy for evicting containers that meet a low priority condition, a second eviction strategy for evicting non-static containers, and a third eviction strategy for evicting non-mirrored containers.

5. The disk container expulsion method according to claim 4, characterized in that: When the node triggers disk eviction and the preset feature gating is in the on state, the container column is obtained by sorting based on the temporary storage usage in the container, including: When a node is detected to have triggered disk eviction, check whether it is a disk pressure alarm; If it is not a disk pressure alarm, the existing eviction strategy is executed; If it is a disk pressure alarm, the step of determining whether the preset characteristic gating is in an open state is triggered.

6. The disk container expulsion method according to claim 1, characterized in that: If the temporary storage usage in the target container exceeds a preset threshold, determining whether the target container satisfies a preset eviction condition includes: Determine whether the temporary storage usage in the target container exceeds a preset threshold; If the temporary storage usage in the target container exceeds a preset threshold, triggering the step of determining whether the target container satisfies a preset eviction condition; If the temporary storage usage in the target container does not exceed a preset threshold, the step of traversing the container list is exited.

7. The disk container expelling method according to any one of claims 1 to 6, characterized in that: The determining whether the target container satisfies a preset eviction condition and performing a corresponding eviction operation based on the determination result includes: Determining whether the target container meets a preset expulsion condition; If the target container meets the preset eviction condition, performing an eviction operation on the target container; If the target container does not meet the preset eviction condition, the process jumps to the step of traversing the container list to obtain the target container with the largest temporary storage usage.

8. A disk container ejection device, characterized in that: Applied to container orchestration platforms, including: The container sorting module is used to sort the container columns based on the temporary storage usage in the container when the node triggers disk eviction and the preset feature gate is turned on; A container list traversal module, used to obtain the target container with the largest temporary storage usage by traversing the container list; A container eviction module is used to determine whether the target container meets a preset eviction condition if the temporary storage usage in the target container exceeds a preset threshold, and perform a corresponding eviction operation based on the determination result; wherein the preset eviction condition is that the target container is a non-static container or a container that does not meet a preset priority condition or a container that is not deployed separately or a container that does not use local storage or a container that is not configured with a preset ignore annotation.

9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the disk container eviction method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: Used to store a computer program, wherein when the computer program is executed by a processor, the disk container expulsion method according to any one of claims 1 to 7 is implemented.