Container resource management method and device, equipment, storage medium and program product

By deploying container resource proxy components and management components in Kubernetes clusters, monitoring and adjusting container resources, the problem of high resource management pressure in the cluster is solved, and precise management of container resources and stable operation of the cluster is achieved.

CN119668779APending Publication Date: 2025-03-21CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411778182.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2025-03-21

AI Technical Summary

Technical Problem

With the expansion of Kubernetes cluster size, the number of nodes and containers in the cluster has increased, and the pressure on Apiserver and Etcd has also increased, resulting in container resource management becoming a major challenge.

Method used

By deploying container resource proxy components and resource management components on target nodes, monitor and adjust the resource usage of target containers, including determining container priorities, adjusting container resource limitations and allocations, and promptly dealing with resource limits.

Benefits of technology

Accurate management of container resources is realized, the phenomenon of resource exceeding limits is avoided, and the stable operation of the cluster is ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119668779A_ABST
    Figure CN119668779A_ABST
Patent Text Reader

Abstract

The invention relates to a container resource management method and device, equipment, a storage medium and a program product. The method comprises the following steps: after monitoring that a resource overrun phenomenon exists in a target container in a target node through a container resource agent component deployed by the target node, initiating a resource adjustment request corresponding to the resource overrun phenomenon of the target container; wherein the number of the target container is at least one; and performing corresponding container resource adjustment on the target container according to the resource adjustment request of the target container through a container resource management component deployed by the target node. By adopting the method, the management of the container resources can be well realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a container resource management method, apparatus, device, storage medium and program product. Background Art

[0002] With the rapid development of container technology, more and more companies and individuals choose to deploy business code in containers. At the same time, Kubernetes has become the de facto best practice for container orchestration and management. As the business scale continues to expand, the scale of the Kubernetes cluster will also increase, and the number of nodes and containers in the cluster will increase greatly, which will put considerable pressure on the Apiserver and Etcd (Kubernetes core components) in the cluster.

[0003] Therefore, it is crucial to manage the container resources of the cluster well. Summary of the invention

[0004] Based on this, it is necessary to provide a container resource management method, device, equipment, storage medium and program product to address the above technical problems, which can well implement the management of container resources.

[0005] In a first aspect, the present application provides a container resource management method, the method comprising:

[0006] After the container resource agent component deployed on the target node detects that the target container in the target node has a resource overlimit phenomenon, a resource adjustment request corresponding to the resource overlimit phenomenon of the target container is initiated; wherein the number of the target container is at least one;

[0007] The container resource management component deployed on the target node adjusts the corresponding container resources of the target container according to the resource adjustment request of the target container.

[0008] In one embodiment, adjusting the corresponding container resources of the target container according to the resource adjustment request of the target container includes:

[0009] When the current resource usage of the target node exceeds the resource threshold, a first container whose container priority is lower than the target container is determined according to the container priorities of the containers in the target node; and according to the resource adjustment request of the target container, a corresponding container resource reduction process is performed on the first container, and a corresponding container resource increase process is performed on the target container.

[0010] In one embodiment, according to the resource adjustment request of the target container, reducing the corresponding container resources of the first container includes:

[0011] When the resource limit of the corresponding container resource of the first container is greater than the actual resource usage of the corresponding container resource of the target container, the actual resource usage of the corresponding container resource of the target container is used as the new resource limit of the corresponding container resource of the first container.

[0012] In one embodiment, performing a process of upgrading corresponding container resources on a target container includes:

[0013] When the amount of released resources obtained after the corresponding container resource reduction processing is performed on the first container is less than the required resource amount of the target container, a balancing request is sent to the balancer in the control plane center cluster through the node resource proxy component deployed on the target node; wherein the balancing request is used to instruct the balancer to select the node with the least actual resource usage of the corresponding container resources in the target subcluster to which the target node belongs as the scheduling node, and schedule the target container to the scheduling node, and the scheduling node provides the target container with corresponding container resources greater than or equal to the required resource amount.

[0014] In one of the embodiments, the balancing request is also used to instruct the balancer to select a cluster with the least actual resource usage of corresponding container resources from other subclusters as the scheduling cluster when no scheduling node is selected from the target subcluster, and to select a node with the least actual resource usage of corresponding container resources from the corresponding scheduling cluster as the scheduling node, and the scheduling node provides the target container with corresponding container resources greater than or equal to the required resource amount.

[0015] In one embodiment, adjusting the corresponding container resources of the target container according to the resource adjustment request of the target container includes:

[0016] When the current remaining amount of resources of the target node is greater than the required amount of resources of the target container, the relevant files in the control group subsystem of the container resources corresponding to the target container are modified according to the resource adjustment request of the target container.

[0017] In a second aspect, the present application further provides a container resource management device, the device comprising:

[0018] A request initiation module is used to initiate a resource adjustment request corresponding to the resource overlimit phenomenon of the target container after monitoring the resource overlimit phenomenon of the target container in the target node through the container resource proxy component deployed on the target node; wherein the number of the target container is at least one;

[0019] The resource adjustment module is used to adjust the corresponding container resources of the target container according to the resource adjustment request of the target container through the container resource management component deployed on the target node.

[0020] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0021] After the container resource agent component deployed on the target node detects that the target container in the target node has a resource overlimit phenomenon, a resource adjustment request corresponding to the resource overlimit phenomenon of the target container is initiated; wherein the number of the target container is at least one;

[0022] The container resource management component deployed on the target node adjusts the corresponding container resources of the target container according to the resource adjustment request of the target container.

[0023] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0024] After the container resource agent component deployed on the target node detects that the target container in the target node has a resource overlimit phenomenon, a resource adjustment request corresponding to the resource overlimit phenomenon of the target container is initiated; wherein the number of the target container is at least one;

[0025] The container resource management component deployed on the target node adjusts the corresponding container resources of the target container according to the resource adjustment request of the target container.

[0026] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

[0027] After the container resource agent component deployed on the target node detects that the target container in the target node has a resource overlimit phenomenon, a resource adjustment request corresponding to the resource overlimit phenomenon of the target container is initiated; wherein the number of the target container is at least one;

[0028] The container resource management component deployed on the target node adjusts the corresponding container resources of the target container according to the resource adjustment request of the target container.

[0029] The above-mentioned container resource management method, device, equipment, storage medium and program product, after the container resource agent component deployed on the target node monitors that the target container in the target node has resource overlimit, initiates a resource adjustment request corresponding to the resource overlimit phenomenon of the target container; further, the container resource management component deployed on the target node can make corresponding container resource adjustments to the target container according to the resource adjustment request of the target container. By introducing the container resource agent component, this scheme can realize the monitoring of the target container in the target node, timely monitor the resource overlimit phenomenon, and make timely resource adjustments; further, by introducing the container resource management component, it provides a data basis for determining the accurate adjustment of container resources, and finally accurately realizes the management of various container resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0031] Figure 1 An architectural diagram of a container resource management method provided in an embodiment of the present application;

[0032] Figure 2 A schematic diagram of a process of container resource management provided in an embodiment of the present application;

[0033] Figure 3 A schematic diagram of a process for adjusting container resources provided in an embodiment of the present application;

[0034] Figure 4 A structural block diagram of a container resource management device provided in an embodiment of the present application;

[0035] Figure 5 A structural block diagram of another container resource management device provided in an embodiment of the present application;

[0036] Figure 6 This is a diagram of the internal structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0037] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0038] The container resource management method provided in the embodiment of the present application can be applied to Figure 1 In an exemplary embodiment, as shown in FIG. Figure 2 As shown, a container resource management method is provided, which is applied to Figure 1 Taking the target node in as an example, the following steps may be included:

[0039] S201, after the container resource agent component deployed on the target node monitors that the target container in the target node has a resource overlimit phenomenon, a resource adjustment request corresponding to the resource overlimit phenomenon of the target container is initiated.

[0040] Among them, the target node can represent any node where container resources exceed the limit; the container resource agent component can collect and analyze the resource usage and container status of all containers on the current node, including CPU resources and memory resources, etc., and can summarize the collected data to the node resource agent component of the same node; the target container can represent the container where resources exceed the limit in the target node; the number of target containers is at least one; the resource adjustment request may include but is not limited to a memory resource adjustment request and a CPU (Central Processing Unit) resource adjustment request.

[0041] For example, Figure 1 As shown in the figure, the container resource agent component deployed on the target node will collect the CPU resources and memory resources of each container in the target node, and then determine whether there is a resource overlimit phenomenon in the container in the target node. For example, based on the memory.usage_in_bytes (a file that displays the current used memory) file in the memory cgroup subsystem (memory control group), the actual memory resources used by the current container can be obtained. Based on the cpuacct.usage (CPU usage accumulation) file in the cpuacct cgroup (Cpuacct control group) subsystem, the actual CPU resources used by the current container can be obtained. The cpu.stat.nr_throttled (CPU current limiting) file in the cgroup subsystem (CPU control group) is used to obtain whether the current container has a CPU over-limit phenomenon. Furthermore, if it is detected that the target container in the target node has a resource over-limit phenomenon (such as CPU over-limit or memory over-limit), it indicates that the resources (CPU or memory) actually allocated to the target container are less than the resources (CPU or memory) actually required by the target container. Then, the container resource agent component can send a resource adjustment request for the target container (such as a request for dynamic adjustment of CPU resources or a request for dynamic adjustment of memory resources) to the message queue corresponding to the target node.

[0042] It should be noted that the cpuacct subsystem (CPU accounting) automatically generates reports to display the CPU resources used by tasks in the cgroup. The message queue sorts messages by container priority, giving priority to requests with high container priority. The message queue is deployed on certain nodes (single or multiple) in each subcluster (can be deployed through KubernetesDeployment); the content of the message can include node ID, operation type (modify cpu cgroup or modify memory cgroup), operation content (such as CPU resource adjustment amount and memory resource adjustment amount), container ID and container priority (can be used as a sorting standard, the higher the priority, the easier it is to be consumed); for multiple container resource adjustment requests for the same node and the same container, the message queue will merge multiple requests to reduce the number of requests; the message queue can be deployed in multiple copies, and data synchronization and consistency between copies must be guaranteed (such as using the Raft algorithm).

[0043] S202: adjusting corresponding container resources of the target container according to the resource adjustment request of the target container through the container resource management component deployed on the target node.

[0044] Among them, the container resource management component can realize dynamic adjustment of container resource restrictions and allocations; optionally, it can be deployed through Kubernetes Daemonset.

[0045] It should be noted that the container resource management component can monitor the message queue to pull the resource adjustment request belonging to the target node from the message queue and execute it locally (such as modifying the container resources at the target node); if the resource adjustment request belonging to the target node pulled from the message queue is a memory resource adjustment request, the cpu.cfs_period_us and cpu.cfs_quota_us files in the cpu cgroup subsystem corresponding to the target container are modified to complete the dynamic restriction or allocation of the CPU resources of the target container; if the resource adjustment request belonging to the target node pulled from the message queue is a CPU resource adjustment request, the cpu.cfs_period_us (which can be used to configure the time period length) and cpu.cfs_quota_us (which can be used to configure the number of CPU times that the current cgroup can use within the set period length) files in the cpu cgroup subsystem corresponding to the target container are modified to complete the dynamic restriction or allocation of the CPU resources of the target container.

[0046] Exemplarily, based on the resource adjustment request of the target container, the container resource management component will send an inquiry request to the node resource agent component in the target node before operating the resource adjustment, asking whether the resource adjustment request can be carried out, and make corresponding container resource adjustments to the target container based on the return message of the node resource agent component.

[0047] Optionally, if the node resource agent component in the target node returns that resource adjustment operations are prohibited, the container resource management component will perform resource adjustment operations (such as reducing resource usage) on all containers in the target node whose priority is lower than that of the target container, in the hope of responding to the resource adjustment request corresponding to the target container. If sufficient resource margin cannot be obtained for the target container, a resource alarm will be initiated to the node resource agent component.

[0048] The above container resource management method, after the container resource agent component deployed on the target node monitors that the target container in the target node has resource overlimit, initiates a resource adjustment request corresponding to the resource overlimit phenomenon of the target container; further, the container resource management component deployed on the target node can make corresponding container resource adjustments to the target container according to the resource adjustment request of the target container. By introducing the container resource agent component, this solution can monitor the target container in the target node, monitor the resource overlimit phenomenon in a timely manner, and make resource adjustments in a timely manner; furthermore, by introducing the container resource management component, it provides a data basis for determining the accurate adjustment of container resources, and finally accurately realizes the management of container resources.

[0049] Based on the above embodiment, the present embodiment of the application explains the above embodiment S202 in detail. Specifically, the present embodiment of the application involves a process of adjusting the corresponding container resources of the target container, such as Figure 3 As shown, the specific steps include:

[0050] S301 : When the current resource usage of the target node exceeds the resource threshold, determine, according to the container priorities of the containers in the target node, a first container whose container priority is lower than the target container.

[0051] The resource threshold may include a memory resource threshold and a CPU resource threshold; the first container may represent all containers in the target node that have a lower priority than the target container.

[0052] For example, when experiencing business peaks or encountering sudden traffic, the container may exit abnormally due to resource thresholds. At this time, the container resource agent component will perceive the abnormal state of the container and submit a resource modification request to the message queue.

[0053] It should be noted that there is a container priority between each container, and a container with a higher container priority can be allocated resources faster than a container with a lower container priority.

[0054] Exemplarily, if the memory resource threshold in the resource threshold is 90% and the CPU resource threshold is 80%, when the current CPU usage of the target node exceeds 80%, or the memory usage exceeds 90%, the containers under the target node can be sorted based on the container priority, and all containers with a lower container priority than the target container are determined as the first container.

[0055] S302: According to the resource adjustment request of the target container, the corresponding container resources of the first container are reduced, and the corresponding container resources of the target container are increased.

[0056] In one achievable manner, when the resource limit of the corresponding container resource of the first container is greater than the actual resource usage of the corresponding container resource of the target container, the actual resource usage of the corresponding container resource of the target container is used as the new resource limit of the corresponding container resource of the first container.

[0057] The resource limit may represent the amount of resources allocated to the container, that is, the resource limit is greater than or equal to the actual resource usage of the container.

[0058] Exemplarily, in order to solve the problem of resource shortage of the target container, the resource limit of the first container under the target node can be adjusted first, such as first screening out the first container whose actual resource usage is greater than the container resources corresponding to the target container, and reducing the resource limit of the screened first container, and adjusting the new resource limit of the first container to the actual resource usage of the container resources corresponding to the target container, so as to release some resources for use by the target container.

[0059] Furthermore, when the amount of released resources obtained after the corresponding container resource reduction processing is performed on the first container is less than the required resource amount of the target container, a balancing request is sent to the balancer in the control plane central cluster through the node resource agent component deployed on the target node; wherein the balancing request is used to instruct the balancer to select the node with the least actual resource usage of the corresponding container resources in the target subcluster to which the target node belongs as the scheduling node, and schedule the target container to the scheduling node, and the scheduling node provides the target container with corresponding container resources greater than or equal to the required resource amount.

[0060] Among them, the scheduling node represents the node that can meet the resource requirements of the target node; the balancer in the control plane center cluster can redistribute resources for the entire cluster and schedule containers within the sub-cluster, that is, migrate the containers in some nodes with higher actual resource usage in a sub-cluster to another node in the sub-cluster with lower actual resource usage.

[0061] It should be noted that the balancer in the control plane center cluster will regularly synchronize the data of the node resource agent component and summarize the node resource agent component data of the same sub-cluster to obtain information such as resource usage of each sub-cluster.

[0062] Exemplarily, after reducing the container resources corresponding to the first container, if the released resources still cannot meet the required resource amount of the target container, a balancing request can be sent to the balancer in the control plane center cluster to realize resource scheduling across nodes; optionally, through the node resource proxy component corresponding to each node in the target subcluster, the balancer can determine the actual resource usage corresponding to each node in the target subcluster, and use the node with the least actual resource usage as the scheduling node, and the scheduling node provides resources that meet the target container, that is, the scheduling node provides the target container with corresponding container resources greater than or equal to the required resource amount.

[0063] It should be noted that the balancing request is also used to instruct the balancer to select a cluster with the least actual resource usage of corresponding container resources from other subclusters as the scheduling cluster when no scheduling node is selected from the target subcluster, and to select a node with the least actual resource usage of corresponding container resources from its own scheduling cluster as the scheduling node, and the scheduling node provides the target container with corresponding container resources greater than or equal to the required resource amount.

[0064] Among them, the scheduling cluster is a cluster that can meet the resource requirements of the target node.

[0065] For example, if scheduling is not possible within a sub-cluster, cross-cluster scheduling is performed, that is, nodes on some sub-clusters with higher actual resource usage can be migrated to sub-clusters with lower actual resource usage, so as to achieve relatively balanced resource allocation in each sub-cluster; if the above scheduling behaviors cannot be achieved, the balancer has two processing modes, namely alarm mode and CA (Cluster Autoscaler) mode; in the alarm mode, the result and cause of the scheduling failure are notified to the upper layer in the form of an alarm, and manual intervention is required. The CA mode relies on the node expansion service provided by the cloud vendor, that is, once the cluster resources are in emergency, the cluster can be automatically expanded through the CA component, and the balancer will allocate the containers to be scheduled to the newly expanded cluster.

[0066] In the embodiment of the present application, by screening out the first container, a solution and idea are provided for adjusting resources for the target container, laying a foundation for reasonable container resource management.

[0067] Based on the above embodiment, the embodiment of the present application explains the above embodiment S202 in detail. Specifically, the embodiment of the present application involves a process of adjusting the corresponding container resources of the target container, which specifically includes: when the current remaining resources of the target node are greater than the required resources of the target container, according to the resource adjustment request of the target container, modifying the relevant files in the control group subsystem of the corresponding container resources of the target container.

[0068] Exemplarily, after adjusting the corresponding container resources of the target container, if it is monitored that the current remaining resources of the target node are greater than the required resources of the target container, the required resources of the target container can be met within the target node, and there is no need for inter-cluster scheduling. The relevant files in the control group subsystem of the corresponding container resources of the target container can be modified to update the actual resource usage of the target node.

[0069] In the embodiment of the present application, by analyzing the situation where the current remaining amount of resources of the target node is greater than the required amount of resources of the target container, the process of container resource management is improved to achieve perfect resource management.

[0070] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0071] Based on the same inventive concept, the embodiment of the present application also provides a container resource management device for implementing the container resource management method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more container resource management device embodiments provided below can refer to the limitations of the container resource management method above, and will not be repeated here.

[0072] In an exemplary embodiment, Figure 4As shown, a container resource management device 1 is provided, comprising: a request initiating module 10 and a resource adjustment module 20, wherein:

[0073] The request initiation module 10 is used to initiate a resource adjustment request corresponding to the resource overlimit phenomenon of the target container after monitoring the resource overlimit phenomenon of the target container in the target node through the container resource agent component deployed on the target node; wherein the number of the target container is at least one.

[0074] The resource adjustment module 20 is used to adjust the corresponding container resources of the target container according to the resource adjustment request of the target container through the container resource management component deployed on the target node.

[0075] In one embodiment, Figure 5 As shown, the resource adjustment module 20 specifically includes:

[0076] The container determination unit 21 is configured to determine, when the current resource usage of the target node exceeds the resource threshold, a first container having a lower container priority than the target container according to the container priorities of the containers in the target node.

[0077] The promotion processing unit 22 is used to reduce the container resources corresponding to the first container and promote the container resources corresponding to the target container according to the resource adjustment request of the target container.

[0078] In one embodiment, the promotion processing unit 22 is further configured to:

[0079] When the resource limit of the corresponding container resource of the first container is greater than the actual resource usage of the corresponding container resource of the target container, the actual resource usage of the corresponding container resource of the target container is used as the new resource limit of the corresponding container resource of the first container.

[0080] In one embodiment, the promotion processing unit 22 is further configured to:

[0081] When the amount of released resources obtained after the corresponding container resource reduction processing is performed on the first container is less than the required resource amount of the target container, a balancing request is sent to the balancer in the control plane center cluster through the node resource proxy component deployed on the target node; wherein the balancing request is used to instruct the balancer to select the node with the least actual resource usage of the corresponding container resources in the target subcluster to which the target node belongs as the scheduling node, and schedule the target container to the scheduling node, and the scheduling node provides the target container with corresponding container resources greater than or equal to the required resource amount.

[0082] In one embodiment, the promotion processing unit 22 is further configured to:

[0083] The balancing request is also used to instruct the balancer to select a cluster with the least actual resource usage of corresponding container resources from other subclusters as the scheduling cluster if no scheduling node is selected from the target subcluster, and to select a node with the least actual resource usage of corresponding container resources from its own scheduling cluster as the scheduling node, and the scheduling node provides the target container with corresponding container resources greater than or equal to the required resource amount.

[0084] In one embodiment, the resource adjustment module 20 is further configured to:

[0085] When the current remaining amount of resources of the target node is greater than the required amount of resources of the target container, the relevant files in the control group subsystem of the container resources corresponding to the target container are modified according to the resource adjustment request of the target container.

[0086] Each module in the container resource management device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0087] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 6 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store node data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a container resource management method is implemented.

[0088] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0089] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0090] After the container resource agent component deployed on the target node detects that the target container in the target node has a resource overlimit phenomenon, a resource adjustment request corresponding to the resource overlimit phenomenon of the target container is initiated; wherein the number of the target container is at least one;

[0091] The container resource management component deployed on the target node adjusts the corresponding container resources of the target container according to the resource adjustment request of the target container.

[0092] In one embodiment, when the processor executes the computer program, the following steps are also implemented:

[0093] When the current resource usage of the target node exceeds the resource threshold, a first container whose container priority is lower than the target container is determined according to the container priorities of the containers in the target node; and according to the resource adjustment request of the target container, a corresponding container resource reduction process is performed on the first container, and a corresponding container resource increase process is performed on the target container.

[0094] In one embodiment, when the processor executes the computer program, the following steps are also implemented:

[0095] When the resource limit of the corresponding container resource of the first container is greater than the actual resource usage of the corresponding container resource of the target container, the actual resource usage of the corresponding container resource of the target container is used as the new resource limit of the corresponding container resource of the first container.

[0096] In one embodiment, when the processor executes the computer program, the following steps are also implemented:

[0097] When the amount of released resources obtained after the corresponding container resource reduction processing is performed on the first container is less than the required resource amount of the target container, a balancing request is sent to the balancer in the control plane center cluster through the node resource proxy component deployed on the target node; wherein the balancing request is used to instruct the balancer to select the node with the least actual resource usage of the corresponding container resources in the target subcluster to which the target node belongs as the scheduling node, and schedule the target container to the scheduling node, and the scheduling node provides the target container with corresponding container resources greater than or equal to the required resource amount.

[0098] In one embodiment, when the processor executes the computer program, the following steps are also implemented:

[0099] The balancing request is also used to instruct the balancer to select a cluster with the least actual resource usage of corresponding container resources from other subclusters as the scheduling cluster if no scheduling node is selected from the target subcluster, and to select a node with the least actual resource usage of corresponding container resources from its own scheduling cluster as the scheduling node, and the scheduling node provides the target container with corresponding container resources greater than or equal to the required resource amount.

[0100] In one embodiment, when the processor executes the computer program, the following steps are also implemented:

[0101] When the current remaining amount of resources of the target node is greater than the required amount of resources of the target container, the relevant files in the control group subsystem of the container resources corresponding to the target container are modified according to the resource adjustment request of the target container.

[0102] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0103] After the container resource agent component deployed on the target node detects that the target container in the target node has a resource overlimit phenomenon, a resource adjustment request corresponding to the resource overlimit phenomenon of the target container is initiated; wherein the number of the target container is at least one;

[0104] The container resource management component deployed on the target node adjusts the corresponding container resources of the target container according to the resource adjustment request of the target container.

[0105] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0106] When the current resource usage of the target node exceeds the resource threshold, a first container whose container priority is lower than the target container is determined according to the container priorities of the containers in the target node; and according to the resource adjustment request of the target container, a corresponding container resource reduction process is performed on the first container, and a corresponding container resource increase process is performed on the target container.

[0107] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0108] When the resource limit of the corresponding container resource of the first container is greater than the actual resource usage of the corresponding container resource of the target container, the actual resource usage of the corresponding container resource of the target container is used as the new resource limit of the corresponding container resource of the first container.

[0109] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0110] When the amount of released resources obtained after the corresponding container resource reduction processing is performed on the first container is less than the required resource amount of the target container, a balancing request is sent to the balancer in the control plane center cluster through the node resource proxy component deployed on the target node; wherein the balancing request is used to instruct the balancer to select the node with the least actual resource usage of the corresponding container resources in the target subcluster to which the target node belongs as the scheduling node, and schedule the target container to the scheduling node, and the scheduling node provides the target container with corresponding container resources greater than or equal to the required resource amount.

[0111] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0112] The balancing request is also used to instruct the balancer to select a cluster with the least actual resource usage of corresponding container resources from other subclusters as the scheduling cluster if no scheduling node is selected from the target subcluster, and to select a node with the least actual resource usage of corresponding container resources from its own scheduling cluster as the scheduling node, and the scheduling node provides the target container with corresponding container resources greater than or equal to the required resource amount.

[0113] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0114] When the current remaining amount of resources of the target node is greater than the required amount of resources of the target container, the relevant files in the control group subsystem of the container resources corresponding to the target container are modified according to the resource adjustment request of the target container.

[0115] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:

[0116] After the container resource agent component deployed on the target node detects that the target container in the target node has a resource overlimit phenomenon, a resource adjustment request corresponding to the resource overlimit phenomenon of the target container is initiated; wherein the number of the target container is at least one;

[0117] The container resource management component deployed on the target node adjusts the corresponding container resources of the target container according to the resource adjustment request of the target container.

[0118] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0119] When the current resource usage of the target node exceeds the resource threshold, a first container whose container priority is lower than the target container is determined according to the container priorities of the containers in the target node; and according to the resource adjustment request of the target container, a corresponding container resource reduction process is performed on the first container, and a corresponding container resource increase process is performed on the target container.

[0120] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0121] When the resource limit of the corresponding container resource of the first container is greater than the actual resource usage of the corresponding container resource of the target container, the actual resource usage of the corresponding container resource of the target container is used as the new resource limit of the corresponding container resource of the first container.

[0122] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0123] When the amount of released resources obtained after the corresponding container resource reduction processing is performed on the first container is less than the required resource amount of the target container, a balancing request is sent to the balancer in the control plane center cluster through the node resource proxy component deployed on the target node; wherein the balancing request is used to instruct the balancer to select the node with the least actual resource usage of the corresponding container resources in the target subcluster to which the target node belongs as the scheduling node, and schedule the target container to the scheduling node, and the scheduling node provides the target container with corresponding container resources greater than or equal to the required resource amount.

[0124] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0125] The balancing request is also used to instruct the balancer to select a cluster with the least actual resource usage of corresponding container resources from other subclusters as the scheduling cluster if no scheduling node is selected from the target subcluster, and to select a node with the least actual resource usage of corresponding container resources from its own scheduling cluster as the scheduling node, and the scheduling node provides the target container with corresponding container resources greater than or equal to the required resource amount.

[0126] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0127] When the current remaining amount of resources of the target node is greater than the required amount of resources of the target container, the relevant files in the control group subsystem of the container resources corresponding to the target container are modified according to the resource adjustment request of the target container.

[0128] It should be noted that the information (including but not limited to node information, component information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0129] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0130] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0131] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A container resource management method, characterized in that: Applied to a target node, the method comprises: After the container resource agent component deployed on the target node detects that a target container in the target node has a resource overlimit phenomenon, a resource adjustment request corresponding to the resource overlimit phenomenon is initiated for the target container; wherein the number of the target container is at least one; Through the container resource management component deployed on the target node, the corresponding container resource of the target container is adjusted according to the resource adjustment request of the target container.

2. The method according to claim 1, characterized in that The step of adjusting the corresponding container resources of the target container according to the resource adjustment request of the target container includes: When the current resource usage of the target node exceeds the resource threshold, determining, according to the container priorities of the containers in the target node, a first container whose container priority is lower than that of the target container; According to the resource adjustment request of the target container, the first container is processed to reduce the corresponding container resources, and the target container is processed to increase the corresponding container resources.

3. The method according to claim 2, characterized in that The reducing processing of corresponding container resources for the first container according to the resource adjustment request of the target container includes: When the resource limit of the container resource corresponding to the first container is greater than the actual resource usage of the container resource corresponding to the target container, the actual resource usage of the container resource corresponding to the target container is used as a new resource limit of the container resource corresponding to the first container.

4. The method according to claim 2, characterized in that: The performing a processing of upgrading the corresponding container resources on the target container includes: When the amount of released resources obtained after the corresponding container resource reduction processing is performed on the first container is less than the amount of required resources of the target container, a balancing request is sent to a balancer in the control plane center cluster through a node resource proxy component deployed on the target node; Among them, the balancing request is used to instruct the balancer to select the node with the least actual resource usage of the corresponding container resources in the target subcluster to which the target node belongs as the scheduling node, and schedule the target container to the scheduling node, and the scheduling node provides the target container with corresponding container resources greater than or equal to the required resource amount.

5. The method according to claim 4, characterized in that The balancing request is also used to instruct the balancer to select a cluster with the least actual resource usage of corresponding container resources from other subclusters as the scheduling cluster when no scheduling node is selected from the target subcluster, and to select a node with the least actual resource usage of corresponding container resources from the corresponding scheduling cluster as the scheduling node, and the scheduling node provides the target container with corresponding container resources greater than or equal to the required resource amount.

6. The method according to claim 1, characterized in that The step of adjusting the corresponding container resources of the target container according to the resource adjustment request of the target container includes: When the current remaining amount of resources of the target node is greater than the required amount of resources of the target container, the relevant files in the control group subsystem of the container resources corresponding to the target container are modified according to the resource adjustment request of the target container.

7. A container resource management device, characterized in that: The device comprises: a request initiation module, configured to initiate a resource adjustment request corresponding to the resource overlimit phenomenon for the target container after monitoring the resource overlimit phenomenon of the target container in the target node through the container resource proxy component deployed on the target node; wherein the number of the target container is at least one; The resource adjustment module is used to adjust the corresponding container resources of the target container according to the resource adjustment request of the target container through the container resource management component deployed by the target node.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

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

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.