Resource management method, device and system, storage medium and computer program product

By monitoring node failures in the edge computing environment and migrating containers to nodes with pre-reserved resources according to container management policies, the problem of evicted containers or pods being unable to start normally is solved and business continuity and rapid recovery are achieved.

CN118819814APending Publication Date: 2024-10-22CHINA MOBILE SHANGHAI ICT CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410581353.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-10
Publication Date
2024-10-22

AI Technical Summary

Technical Problem

In an edge computing environment, when core or key pods or containers on k8s nodes are automatically expelled to other nodes, they may not start properly, causing the application to be down for a long time.

Method used

By monitoring the node failure status, the second working node of the association is determined from high to low based on the container management policy, and eviction instructions are sent to migrate the container to the node with pre-reserved resources to ensure the normal operation of the container on the new node. start up.

Benefits of technology

This shortens the data recovery time for evicted containers or pods on new nodes and ensures the continuity of application services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118819814A_ABST
    Figure CN118819814A_ABST
Patent Text Reader

Abstract

The invention discloses a resource management method, which is applied to a main node, and comprises the following steps: if monitoring that a first working node is in a preset fault state, determining a first working node according to a grading level parameter specified in a container management strategy, sequentially determining second working nodes with association relationships among the first container objects borne by the first working nodes according to a descending order of levels; wherein the second working node is a node which is predetermined by the main node based on the container management strategy and reserves resources for each first container object in advance; and sending first expelling indication information to the first working node, so that each first container object is migrated to the corresponding second working node. The invention further discloses a resource management device and system, a storage medium and a computer program product.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] With the rapid development of communication network technology, edge computing (Mobile Edge Computing, MEC) technology has become increasingly mature and widely used. In the MEC platform, applications are generally deployed as services in a platform for managing container clusters (Kubernetes, k8s). K8s is an open source container orchestration engine that is used to automatically deploy, scale and manage containerized applications. It can manage namespaces, resource reservations and resource restrictions of containers through declarative configuration. In the application process, k8s provides a framework for elastically running distributed systems. Application containers are automatically allocated to appropriate host nodes through schedulers and built-in algorithms, and can automatically manage the use of resources of each node in the cluster, such as the central processing unit (CPU), memory, disk, etc. When a k8s node has excessive resource consumption, the k8s cluster will automatically set the stain and automatically evict or migrate the container group (pod) or container on it, so that the pod can be restarted and run on other nodes in the cluster to reduce the resource load of the node and ensure the operation of the container.

[0003] However, relatively core or critical pods or containers on the k8s node may be automatically evicted by the k8s scheduler to other nodes in the k8s cluster. However, there is currently no guarantee that the evicted pods or containers can start and run normally on the new nodes, which may eventually cause the key applications carried by the pods or containers to be down for a long time. How to solve this problem has become a technical problem that needs to be solved urgently.

[0004] Application Contents

[0005] In order to solve the above technical problems, the present application hopes to provide a resource management method, device, system, storage medium and computer program product, which solves the problem that the evicted pod or container may not start normally on the new node, and proposes a resource management method, which shortens the data recovery time of the evicted pod or container on the new node and ensures the continuity of the application business of the evicted pod or container.

[0006] The technical solution of this application is implemented as follows:

[0007] The present application provides a resource management method, which is applied to a master node and includes:

[0008] If it is monitored that the first working node is in a preset fault state, based on the hierarchical level parameters specified in the container management policy, the second working node with which each first container object carried by the first working node has an associated relationship is determined in descending order of level; wherein the second working node is a node predetermined by the master node based on the container management policy and for which resources are reserved in advance for each first container object;

[0009] Sending first eviction indication information to the first working node to migrate each of the first container objects to the corresponding second working node; wherein the first eviction indication information is used to indicate the eviction of each of the first container objects to the corresponding second working node.

[0010] In the above solution, the preset fault state includes at least one of the following states: node maintenance state, downtime state, and the remaining operating resources of the node are less than or equal to a preset threshold.

[0011] In the above scheme, if it is monitored that the first working node is in a preset fault state, before determining the second working node with which each first container object carried by the first working node has an associated relationship in order from high to low levels based on the hierarchical level parameters specified in the container management policy, the method further includes:

[0012] Receiving a container management policy sent by a server node; wherein the container management policy is generated after the server node detects a configuration operation corresponding to a policy configuration interface displayed in a display area;

[0013] The container management policy is sent to at least one working node managed by the master node; wherein the at least one working node includes the first working node and the second working node.

[0014] In the above scheme, the method further includes:

[0015] Determine target level parameters of m second container objects included in the container management strategy; wherein m is a positive integer greater than 0;

[0016] Based on each of the second container objects and the corresponding target level parameters, determining a corresponding second working node;

[0017] Sending reservation indication information for indicating to reserve resources for each second container object to the corresponding second working node.

[0018] In the above solution, determining the second working node based on each of the first container objects and the corresponding target level parameters includes:

[0019] Determine, from the m second container objects, n third container objects whose target level parameters are first level parameters; wherein n is a positive integer less than or equal to m;

[0020] Determine, from at least one of the working nodes, a corresponding second working node for each of the third container objects; wherein the second working node does not carry the container object specified in the container management policy, and a remaining resource parameter of the second working node is greater than an operating resource parameter required for the corresponding third container object to run;

[0021] Correspondingly, the reserved indication information is used to instruct each of the second working nodes to create a replica object corresponding to the corresponding third container object.

[0022] In the above solution, determining the second working node based on each of the first container objects and the corresponding target level parameters includes:

[0023] Determine, from the m second-level container objects, p fourth container objects whose target level parameters are second-level parameters; wherein the importance of the second-level parameters is lower than that of the first-level parameters, and p is a positive integer less than or equal to m;

[0024] Grouping the p fourth container objects according to a preset number to obtain q groups of container objects; wherein q is a positive integer greater than or equal to 1;

[0025] Determine a reserved resource parameter corresponding to each group of the container object groups;

[0026] Determine, from at least one of the working nodes, a corresponding second working node for each group of the container object groups; wherein the second working node does not carry the container object specified in the container management policy, and a remaining resource parameter of the second working node is greater than the reserved resource parameter;

[0027] Correspondingly, the reservation indication information is used to instruct each of the second working nodes to create a replica object that matches the reserved resource parameters.

[0028] In the above solution, the step of determining the reserved resource parameters corresponding to each group of container objects includes:

[0029] Calculate the sum of each resource sub-parameter corresponding to each group of the container objects;

[0030] The ratio of the sum of each resource sub-parameter to a preset coefficient is calculated to obtain a reserved value of each resource sub-parameter in the reserved resource parameter.

[0031] In the above scheme, the method further includes:

[0032] If there is a fifth container object whose hierarchical level parameter is a third level parameter in the first working node, and after each of the first container objects is migrated to the corresponding second working node, the remaining resource parameter of at least one working node is monitored; wherein the importance of the third level parameter is lower than the importance of the second level parameter;

[0033] If it is determined that a third working node whose remaining resource parameter is greater than a preset resource threshold is obtained, second eviction indication information is sent to the first working node to migrate the fifth container object to the third working node.

[0034] In the above scheme, the method further includes:

[0035] If the third working node is not determined to be obtained, generating a prompt message for prompting that cluster resources are insufficient;

[0036] The prompt information is displayed.

[0037] In the above solution, after sending the first eviction indication information to the first working node, the method further includes:

[0038] If the corresponding second working node stores a replica object of the corresponding first container object, a recycling instruction for instructing to recycle the replica object resources is sent to the corresponding second working node, so that the second working node deletes the corresponding replica object.

[0039] In the above scheme, the method further includes:

[0040] After confirming that the first container object of the target level parameter is migrated to the second working node and is started normally, determining a corresponding fourth working node for the first container object of the target level parameter; wherein the target level parameter is a first level parameter or a second level parameter;

[0041] Sending reservation indication information for indicating to reserve resources for the first container object of the target level parameter to the fourth working node.

[0042] The present application provides a resource management device, which is mainly applied to a master node. The device includes: a determination unit and a sending unit; wherein:

[0043] The determining unit is configured to determine, if it is monitored that the first working node is in a preset fault state, a second working node with which each first container object carried by the first working node has an associated relationship in descending order based on the hierarchical level parameters specified in the container management policy; wherein the second working node is a node predetermined by the master node based on the container management policy and for which resources are reserved in advance for each first container object;

[0044] The sending unit is used to send first eviction indication information to the first working node, so that each first container object is migrated to the corresponding second working node; wherein the first eviction indication information is used to indicate the eviction of each first container object to the corresponding second working node.

[0045] The present application provides a resource management system, the system comprising: a master node and at least one working node; wherein:

[0046] At least one of the working nodes is used to carry the pod;

[0047] The master node is used to implement the steps of the resource management method as described in any one of the above items.

[0048] The present application provides a storage medium, on which a resource management program is stored. When the resource management program is executed by a processor, the steps of any of the resource management methods described above are implemented.

[0049] The present application provides a computer program product, including a computer program, which implements the steps of any of the resource management methods described above when executed by a processor.

[0050] The embodiment of the present application provides a resource management method, device, system, storage medium and computer program product. If it is detected that the first working node is in a preset fault state, the master node determines the second working node with which each first container object carried by the first working node has an associated relationship in order from high to low levels based on the hierarchical level parameters specified in the container management policy, and sends the first eviction indication information to the first working node, so that each first container object is migrated to the corresponding second working node. In this way, when the master node detects that the first working node is in a preset fault state, according to the container management policy and the hierarchical level parameters, the first working node is preferentially controlled to migrate the first container object with a high level to the corresponding second working node for which resources have been reserved in advance, ensuring that the first container object migrated to the corresponding second working node can start and run normally, solving the problem that the evicted pod or container may not start normally on the new node, and proposing a resource management method, shortening the data recovery time of the evicted pod or container on the new node, and ensuring the continuity of the application business of the evicted pod or container. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 Schematic diagram of the resource management method provided in this application embodiment Figure 1 ;

[0052] Figure 2 Schematic diagram of the resource management method provided in this application embodiment Figure 2 ;

[0053] Figure 3 Schematic diagram of the resource management method provided in this application embodiment Figure 3 ;

[0054] Figure 4 Schematic diagram of the resource management method provided in this application embodiment Figure 4 ;

[0055] Figure 5 Schematic diagram of the resource management method provided in this application embodiment Figure 5 ;

[0056] Figure 6 A schematic diagram of an implementation architecture of an application scenario provided in an embodiment of the present application;

[0057] Figure 7 A schematic diagram of the structure of a resource management device provided in an embodiment of the present application;

[0058] Figure 8 A schematic diagram of the structure of a resource management system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0059] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.

[0060] The embodiment of the present application provides a resource management method, referring to Figure 1 As shown, the method is applied to the master node, and the method includes the following steps:

[0061] Step 101: If it is monitored that the first working node is in a preset fault state, based on the hierarchical level parameters specified in the container management policy, determine the second working node with which each first container object carried by the first working node has an associated relationship in order from high to low levels.

[0062] The second working node is a node that is predetermined by the master node based on the container management policy and reserves resources in advance for each first container object.

[0063] In an embodiment of the present application, the master node is the master node (master node) of the k8s cluster, which is used to manage the entire k8s cluster, schedule the generation, expulsion and destruction of pods, and manage the resource allocation of the cluster. The first working node and the second working node belong to the working node (worker node) of the k8s cluster, which are mainly used to manage pods and other resource objects, including creation, restart, expulsion, deletion, etc. The process of the master node monitoring the status of the first working node can be realized by analyzing the information reported by the first working node. The container management policy is pre-configured in the master node, which is used to indicate the management priority order of the container and / or pod in at least one working node managed by it, which can be determined by the importance of the container and pod to the application service business. The container management policy can be obtained by the master node actively configuring according to business needs, or it can be operated by the user through the server node. After specifying the management priority of the container and pod, the server node generates and sends it to the master node so that the master node manages the container and pod based on the container management policy. In the container management policy, the higher the level of the container and pod classification level parameter, the more important it is to the service business. The first container object may be a single container or multiple containers, or a single container or multiple pods.

[0064] The second working node is a working node that is determined in advance from other working nodes when the levels of the containers and pods carried by the first working node in the container management policy are target level parameters, and the master node reserves resources in advance for the first container object corresponding to the target level parameters.

[0065] Step 102: Send first eviction indication information to the first working node.

[0066] The first eviction indication information is sent to the first working node to migrate each first container object to the corresponding second working node. The first eviction indication information is used to instruct to evict each first container object to the corresponding second working node.

[0067] In an embodiment of the present application, when the master node detects that the first working node is in a preset fault state, it sends a first eviction indication message to the first working node, so that the first working node quickly migrates each first container object to the corresponding second working node, so that the second working node runs the first container object migrated from the first working node based on reserved resources, thereby shortening the impact of the first container object being unable to provide application services due to the failure of the first working node.

[0068] A resource management method provided by an embodiment of the present application, if it is monitored that the first working node is in a preset fault state, the master node determines the second working node with which each first container object carried by the first working node has an associated relationship in order from high to low based on the hierarchical level parameters specified in the container management policy, and sends a first eviction indication message to the first working node, so that each first container object is migrated to the corresponding second working node. In this way, when the master node monitors that the first working node is in a preset fault state, according to the container management policy and the hierarchical level parameters, the first working node is preferentially controlled to migrate the first container object with a high level to the corresponding second working node for which resources have been reserved in advance, ensuring that the first container object migrated to the corresponding second working node can start and run normally, solving the problem that the evicted pod or container may not start normally on the new node, and proposing a resource management method, shortening the data recovery time of the evicted pod or container on the new node, and ensuring the continuity of the application business of the evicted pod or container.

[0069] Based on the above embodiments, the embodiments of the present application provide a resource management method, referring to Figure 2 As shown, the method comprises the following steps:

[0070] Step 201: The master node receives the container management policy sent by the server node.

[0071] The container management policy is generated after the server node detects a configuration operation corresponding to the policy configuration interface displayed in the display area.

[0072] In an embodiment of the present application, the server node is a node that can be operated by users such as managers, and its configured display area can display a policy configuration interface on the display area as required. In this way, users such as managers perform configuration operations on the policy configuration interface and set the hierarchical level parameters of each container and / or pod. The server node generates a container management policy based on the user's configuration operation and sends the container management policy to the master node. After receiving the container management policy, the master node stores the container management policy and performs corresponding operations according to the container management policy, reserving resources for some containers or pods in other working nodes in advance to ensure that these containers or pods can be quickly migrated to corresponding other working nodes when their corresponding working nodes fail, ensuring that the application services provided by the containers or pods are quickly restored and improving the user experience.

[0073] Step 202: The master node sends a container management policy to at least one working node managed by the master node.

[0074] The at least one working node includes a first working node and a second working node.

[0075] In an embodiment of the present application, the master node also sends the received container management policy to at least one working node managed by the master node, so that the at least one working node can determine subsequent related operations according to the container management policy, or report information according to the container management policy. The at least one working node is all the working nodes managed by the master node.

[0076] It should be noted that the container management policy can be a policy generated for the first time, or it can be an updated policy generated after the user updates the hierarchical level parameters of certain containers or pods according to actual needs. The specific policy can be determined by the actual situation.

[0077] Step 203: If it is monitored that the first working node is in a preset fault state, the master node determines, based on the hierarchical level parameters specified in the container management policy, the second working node with which each first container object carried by the first working node has an associated relationship in descending order of level.

[0078] The second working node is a node that is predetermined by the master node based on the container management strategy and reserves resources for each first container object in advance. The preset fault state includes at least one of the following states: node maintenance state, downtime state, and node remaining operating resources are less than or equal to a preset threshold.

[0079] In the embodiment of the present application, the master node monitors the working state of at least one working node by monitoring the heartbeat signal of at least one working node as an example for explanation. If the master node fails to monitor the heartbeat signal of the first working node, it is determined that the first working node fails, that is, the first working node is in a downtime state. At this time, the master node can determine the hierarchical level parameters of all containers carried by the first working node according to the hierarchical level parameters specified in the container management policy, wherein the hierarchical level parameters of the containers in a pod can be the same or different, which can be determined according to the actual situation. The first container object is a container object whose hierarchical level parameter is the target level parameter in the first working node, which can be in units of containers or pods. Since the second working node is determined in advance, the master node can directly determine the second working node that can receive each first container object. At this time, since each first container object is graded according to its importance, such as business importance, when expelling, it can be expelled in sequence according to the hierarchical level parameters. After the high-level first container object is expelled, the low-level first container object is expelled. In this way, the service impact of the high-level first container object is minimized and the user experience effect is improved.

[0080] Step 204: The master node sends first eviction indication information to the first working node.

[0081] The first eviction indication information is sent to the first working node, and the first eviction indication information is used to instruct to evict each first container object to the corresponding second working node.

[0082] In an embodiment of the present application, the master node sends the first eviction indication information corresponding to each first container object to the first working node, so that the first working node migrates the corresponding first container object to the second working node indicated in the first eviction indication information.

[0083] Based on the above embodiments, in other embodiments of the present application, refer to Figure 3 As shown, the master node is also used to execute steps 205 to 207:

[0084] Step 205: The master node determines target level parameters of the m second container objects included in the container management policy.

[0085] Wherein, m is a positive integer greater than 0.

[0086] In an embodiment of the present application, the master node analyzes the received container management policy, determines all container objects of the target level parameter included in the container management policy, and obtains m second container objects. The target level parameter is a hierarchical level parameter in which the level of the container object meets certain requirements and the application service provided by the corresponding container has a high degree of impact.

[0087] Step 206: The master node determines a corresponding second working node based on each second container object and the corresponding target level parameter.

[0088] In the embodiment of the present application, the master node analyzes each second container object and the corresponding target level parameter to determine the second working node corresponding to each second container object.

[0089] Step 207: The master node sends reservation indication information for indicating to reserve resources for each second container object to the corresponding second working node.

[0090] In an embodiment of the present application, after the master node determines the second working node corresponding to each second container object, it sends a reservation indication message to the corresponding second working node so that the second working node reserves resources according to the reservation indication message to ensure that the corresponding second container object has sufficient resources to ensure its operation after migration.

[0091] It should be noted that steps 205 to 207 may be executed after step 201 and before step 203, or may be executed simultaneously with step 202. The specific execution order may be determined by actual conditions and is not specifically limited here.

[0092] Based on the above embodiment, in other embodiments of the present application, step 206 can be implemented by steps 206a to 206b:

[0093] Step 206a: The master node determines n third container objects whose target level parameters are first level parameters from the m second container objects.

[0094] Wherein, n is a positive integer less than or equal to m.

[0095] In the embodiment of the present application, the master node groups the m second container objects again according to the hierarchical level parameter to obtain n third container objects whose target level parameter is the first level parameter.

[0096] Step 206b: The master node determines a corresponding second working node for each third container object from at least one working node.

[0097] The second working node does not carry the container object specified in the container management policy, and the remaining resource parameter of the second working node is greater than the running resource parameter required for the corresponding third container object to run.

[0098] In the embodiment of the present application, when reserving resources for container objects whose grouping level is the first level parameter, the resource reservation process is performed according to the principle of reserving one corresponding resource for one container object. At this time, the master node determines a corresponding second working node for each third container object from at least one working node it manages. At this time, the requirements for the selected second working node are that it currently does not carry the container object specified in the container management policy, and its remaining resource parameters are greater than the operating resource parameters required for the corresponding third container object to run.

[0099] Correspondingly, the master node executes the reserved indication information in step 207 to instruct each second working node to create a replica object corresponding to the corresponding third container object.

[0100] In the embodiment of the present application, the reservation of resources is achieved by instructing to create a copy object of the corresponding third container object in each second working node, that is, after the corresponding second working node receives the reservation instruction information, it generates a copy object corresponding to the corresponding third container object according to the reservation instruction information. The generated copy object of the third container object has only a read-only function.

[0101] Based on the above embodiment, in other embodiments of the present application, step 206 can also be implemented by steps 206c to 206f:

[0102] Step 206c: The master node determines p fourth container objects whose target level parameters are the second level parameters from the m second container objects.

[0103] The importance of the second level parameters is lower than that of the first level parameters, and p is a positive integer less than or equal to m.

[0104] In the embodiment of the present application, the master node determines all container objects whose hierarchical level parameters included in the container management policy are second-level parameters, and obtains p fourth container objects.

[0105] Step 206d: The master node groups the p fourth container objects according to a preset number to obtain q groups of container objects.

[0106] Here, q is a positive integer greater than or equal to 1.

[0107] In the embodiment of the present application, the preset number may be an empirical value obtained by empirical setting, or an empirical value determined according to p, and the value of the preset number may be 1, and the corresponding value of q is at least 1. Each group of container objects includes at least two fourth container objects.

[0108] Step 206e: The master node determines the reserved resource parameters corresponding to each group of container objects.

[0109] In an embodiment of the present application, the master node analyzes the resources of each group of container objects to determine the corresponding reserved resource parameters. For example, the master node determines the maximum value of each resource sub-parameter in each group of container objects as the corresponding reserved resource parameter, or uses a preset algorithm to calculate each resource sub-parameter of the container objects in each group of container objects to obtain the reserved resource parameters.

[0110] Step 206f, the master node determines a corresponding second working node for each group of container objects from at least one working node.

[0111] The second working node does not carry the container object specified in the container management policy, and the remaining resource parameter of the second working node is greater than the reserved resource parameter.

[0112] In an embodiment of the present application, the master node determines, from at least one working node, for each group of container objects, a working node that does not carry the container object specified in the container management policy and whose remaining resource parameter is greater than the reserved resource parameter as the corresponding second working node.

[0113] Correspondingly, the reservation indication information in step 207 is used to instruct each second working node to create a replica object that matches the reserved resource parameters.

[0114] Based on the above embodiment, in other embodiments of the present application, step 206e can be implemented by steps a11 to a12:

[0115] Step a11: The master node calculates the sum of each resource sub-parameter corresponding to each group of container objects.

[0116] In the embodiment of the present application, the resource sub-parameter may be, for example, a resource such as remaining CPU, remaining memory, etc. Exemplarily, when the resource sub-parameter is remaining CPU and remaining memory, assuming that q is equal to 1, the master node calculates the cumulative sum of the remaining CPUs of p fourth container objects to obtain the sum of the remaining CPUs; the master node calculates the cumulative sum of the remaining memory of p fourth container objects to obtain the sum of the remaining memory.

[0117] Step a12: The master node calculates the ratio of the sum of each resource sub-parameter to the preset coefficient to obtain the reserved value of each resource sub-parameter in the reserved resource parameter.

[0118] In the embodiment of the present application, the preset coefficient is an empirical value obtained from a large number of experiments, and can be adjusted according to actual conditions. For example, when the preset coefficient is 2, the master node calculates the ratio of the remaining CPU sum to 2 and the ratio of the remaining memory to 2, thereby obtaining the corresponding reserved resource parameters.

[0119] Based on the above embodiments, in other embodiments of the present application, refer to Figure 4 As shown, the master node is also used to execute steps 208 to 210:

[0120] Step 208: If there is a fifth container object whose hierarchical level parameter is a third level parameter in the first working node, and after each first container object is migrated to the corresponding second working node, the master node monitors the remaining resource parameters of at least one working node.

[0121] Among them, the importance of the third level parameters is lower than that of the second level parameters.

[0122] In an embodiment of the present application, after the master node controls the first working node to evict the first container object of the target level parameters, the master node continues to analyze the container objects that have not been evicted in the first working node according to the container management strategy. If it is determined that there is at least one fifth container object with the third level parameters in the first working node, the master node monitors the remaining resource parameters of at least one working node.

[0123] After the master node executes step 208, it may choose to execute step 209 or step 210.

[0124] Step 209: If it is determined that a third working node has a remaining resource parameter greater than a preset resource threshold, the master node sends a second eviction indication message to the first working node.

[0125] If it is determined that a third working node has a remaining resource parameter greater than a preset resource threshold, second eviction indication information is sent to the first working node to migrate the fifth container object to the third working node.

[0126] In the embodiment of the present application, if a third working node whose remaining resource parameter is greater than a preset resource threshold is monitored, the master node sends a second eviction indication message to the first working node to evict the fifth container object to the third working node, so that the first working node migrates the fifth container object to the third working node. In this process, no resources are reserved in advance for the fifth container object in the third working node.

[0127] Step 210: If the third working node is not determined, the master node sends a prompt message of insufficient cluster resources to the server node.

[0128] If the third working node is not determined to be obtained, prompt information of insufficient cluster resources is sent to the server node, so that the server node generates alarm information of insufficient cluster resources based on the prompt information and displays it.

[0129] In an embodiment of the present application, when the master node has not determined the third working node, it sends the information that the third working node has not been determined to the server node through a prompt message, so that the server node generates an alarm message of insufficient cluster resources, so that the user can perform subsequent resource management processing on the cluster according to the prompt message.

[0130] It should be noted that steps 208 to 210 are executed after the master node executes step 204 .

[0131] Based on the foregoing embodiment, in other embodiments of the present application, when the master node executes step 204, it is also used to execute step 211:

[0132] Step 211: If the corresponding second working node stores a replica object of the corresponding first container object, the master node sends a recycling instruction for instructing to recycle the replica object resources to the corresponding second working node.

[0133] If the corresponding second working node stores a replica object of the corresponding first container object, a recycling instruction for instructing recycling of the replica object resource is sent to the corresponding second working node, so that the second working node deletes the corresponding replica object.

[0134] In an embodiment of the present application, when the second working node reserves resources for the corresponding first container object in the first working node through the replica object, the master node sends the first eviction indication information to the first working node, and then sends a recovery instruction to the second working node, so that the second working node releases the occupied resources and provides running resources for the corresponding first container object migrated to.

[0135] Based on the above embodiments, in other embodiments of the present application, refer to Figure 5 As shown, the master node is also used to execute steps 212 to 213:

[0136] Step 212: After confirming that the first container object of the target level parameter is migrated to the second working node and is started normally, the master node determines a corresponding fourth working node for the first container object of the target level parameter.

[0137] Among them, the target level parameter is a first level parameter or a second level parameter.

[0138] In the embodiment of the present application, after the master node determines that the first container object of the target level parameter is migrated to the corresponding second working node and can be started normally, the master node determines a working node from at least one working node to obtain a fourth working node. The implementation process of the master node determining to obtain the fourth working node is the same as the process of determining the second working node, which will not be described in detail here.

[0139] Step 213: The master node sends reservation indication information for indicating to reserve resources for the first container object of the target level parameter to the fourth working node.

[0140] It should be noted that steps 212 to 213 may be performed after step 204 .

[0141] Based on the above embodiments, the present application embodiment provides an application scenario implementation architecture diagram of a resource management method, such as Figure 6 As shown, it includes: user, server node, k8s master node, worker node 1, ..., worker node n.

[0142] The server node can be composed of three components: a World Wide Web (web) console, a controller, and a database. The web console is used to provide a visual web interface for users to configure grading policies, view policy status, and resource status; the controller is used to interact with the kube-apiserver component in the k8s master node, provide system server functions, manage container grading policies, issue policies, manage containers to be protected and replica containers, etc. The database is used to interact with the controller to store information such as container grading policies, policy status, and the status of container objects that need to be managed.

[0143] The k8s master node, which can be referred to as the master node, mainly includes three k8s management modules: the k8s cluster application programming interface (API) gateway (kube-apiserver), the control management (kube-crontrollermanager), and the coordination (kube-scheduler). These components are the management components of the k8s master node, which are used to manage the entire k8s cluster, schedule the generation, expulsion and destruction of pods, and manage the resource allocation of the cluster.

[0144] The k8s worker node, which can be referred to as the worker node, mainly includes the kubelet client and network manager (kube-proxy) modules that come with k8s. It is mainly used to manage pods and other resource objects, including creation, restart, eviction, deletion, etc.

[0145] When implementing the resource management method, it can be implemented through the client in the worker node. Correspondingly, the server node interacts with the master node through the kube-apiserver component, and then the kube-apiserver component interacts with the client in the worker node to implement the entire control process. Correspondingly, the main functions of the client can include: receiving kubelet management instructions sent by the master node, including the creation of container objects, the creation and recycling of replica objects, resource reservation, resource information collection, etc.; cooperating with kubelet to manage containers: managing the reconstruction of container objects, the creation and destruction of replica objects, etc.; reporting information to the master node, such as regularly reporting the status of container objects, the status of replica objects, and the resource status of each worker node.

[0146] Correspondingly, based on Figure 6 The application scenario implementation architecture diagram shown in the figure, the implementation steps of an embodiment of a resource management method can be specifically as follows:

[0147] Step b11: The user operates on the server node to enable the server node to create a new container classification protection strategy.

[0148] Among them, the user logs in to the web console, can select the container object to be protected, and set the protection level for each container object to be protected to obtain the container hierarchical protection strategy. Among them, the container object to be protected can select a single container or multiple containers. The container object to be protected includes a single pod, a single stateless load pod, that is, a Deployment resource object, and a single stateful load pod, that is, a Statefuelset resource object. For example, 4 levels can be included by default, namely "high", "medium", "low", and "none". The web console saves the configuration according to the user's operation, and the user can customize the policy name. The saved configuration information will be saved to the database by the controller component. It should be noted that the container hierarchical protection strategy corresponds to the aforementioned container management strategy and can be referred to as a strategy.

[0149] Furthermore, in some application scenarios, the policy set by the user can be set to two states: "apply" or "not apply". The policy is applied and takes effect only in the "apply" state.

[0150] Step b12: The server node sends the policy to the k8s master node.

[0151] Among them, the controller component in the server node sends the policy to the kube-apiserver component in the k8s master node, and the policy is uniformly managed and scheduled through the kube-apiserver component.

[0152] Step b13, the k8s master node sends the policy to all worker nodes.

[0153] Among them, the kube-apiserver component in the k8s master node sends policies to clients in all worker nodes, and the kubelet client cooperates to complete the hierarchical management of object containers.

[0154] When the kubelet on the worker node receives the policy, it automatically forwards the policy to the client on the worker node, which manages the container objects and replica objects to be protected and monitors the remaining resources of the worker node. After receiving the policy, the client on the worker node can cooperate with the kubelet to "restart once" the container object to be protected to take effect. The hierarchical protection corresponding to the policy will be effective. Then, during the entire policy validity period of the object to be protected, the client component will manage the container object to be protected. It should be noted that other container objects to be protected that are not graded are still directly managed by kubelet.

[0155] Step b14: The k8s master node reserves resources for the container object to be protected according to the policy.

[0156] Among them, for the container objects to be protected with a higher protection level in the policy, such as a high or medium level, the server node will cooperate with the management component of the k8s master node, usually kube-scheduler, and select another suitable worker node in the cluster through algorithm calculation. The selected worker node must be other worker nodes that do not carry the container objects to be protected, and call the kubelet and client on it to automatically create a copy object of the container object to be protected with a high or medium level, and occupy the resources required for the startup of the container object to be protected in advance, such as CPU and memory resources, to ensure that the container object to be protected is started normally in complex fault scenarios and has sufficient resources to meet the stable operation of the container.

[0157] Specifically, when the master node reserves resources for a "high" level container object to be protected, for a container object to be protected, namely, 1 pod, 1 Deployment resource or 1 Statefulset, a worker node is determined to forcibly reserve resources for it, that is, the k8s cluster is controlled to forcibly generate a replica object of the "high" level container object to be protected in advance on other worker nodes to realize hard reserved resources. In this way, during the migration process, the forced reserved resources automatically recycle the replica object resources to free up the host resources to ensure the normal startup and stable operation of the migrated container object to be protected; the corresponding replica objects generated in other worker nodes, such as replica containers, have a minimum resource reservation of CPU and memory that is usually the same as the maximum resource limit of the "high" level container object to be protected, that is, the maximum resources are forcibly reserved for the "high" level container object to be protected. Therefore, when the resource load of the entire k8s cluster is high, there are sufficient resources to ensure the stable operation of the container object to be protected. The "high" level container object to be protected is suitable for protecting core and key objects, such as "core database", "core middleware", "key application", etc. For example, Figure 6 In the example, the master node determines that the pod A to be protected with a high level in worker node 1 is worker node N. In this way, the master node controls worker node N to generate a pod A replica object corresponding to the pod A to be protected, so that the resources of the pod A to be protected are occupied in worker node N.

[0158] When the master node reserves resources for the "medium" level container objects to be protected, the objects at this protection level will be implemented using an "N to 1" resource reservation method, that is, a replica container is forcibly generated in advance for multiple container objects at the same "medium" level to be protected on other worker nodes in the k8s cluster to hard reserve resources, and finally the replica container resources are automatically recycled to free up host resources to ensure the normal startup and relatively stable operation of the migrated container objects to be protected; when generating replica objects, first count the sum of the maximum resource limits of the CPU and memory currently set for all container objects to be protected at the "medium" level in the same policy, and calculate the sum of the CPU and memory by 2 to get the minimum resource reservations for the CPU and memory of the replica container. For example, Figure 6In the example, the master node determines that the worker node N is also obtained for the pods B to be protected and C to be protected with a level of medium in worker node 1. In this way, the master node controls worker node N to generate pod B&C replica objects corresponding to pods B to be protected and pods C to be protected, so that the resources of pods B to be protected and pods C to be protected are occupied in worker node N.

[0159] Compared with the "high" level protection, this level is more difficult to achieve because multiple container objects to be protected share one replica container resource. Therefore, when the k8s cluster resource load is high, only the container objects to be protected at the "medium" level can be started normally, but there is no guarantee of sufficient resources for stable operation. Therefore, the protection effect is lower than that of the "high" level protection objects. Among them, the "medium" level protection objects are suitable for relatively critical objects, such as "ordinary databases", "ordinary middleware", "relatively critical applications", etc.

[0160] The aforementioned replica object or replica container may be a read-only file system by default, which means that the configuration of the replica container and the files in the container cannot be manually modified.

[0161] For the low-level protected container objects in the policy, such as the low-level protected container objects, the server node and the k8smaster node management component work together to collect the current remaining resources of other nodes in the k8s cluster through kubelet and the client, and determine through the k8s master node that the current remaining resources can meet the needs of the low-level protected container objects to be started normally in complex fault scenarios. However, it cannot guarantee whether there are sufficient resources to meet the needs of the protected container objects to run stably on the worker nodes.

[0162] Specifically, for container objects to be protected at a "low" protection level, replica containers will not be automatically pre-generated on other k8s nodes for mandatory resource reservation; in the process of policy implementation, the maximum CPU and memory resource limits of all container objects to be protected at a "low" protection level are counted, and the worker nodes in the cluster are monitored regularly by the client and kubelet, for example, at intervals of 60 seconds to see if there are sufficient resource reservations to implement soft resource reservations, so that the container objects to be protected can start normally and run relatively stably after migration; if the remaining resources of the worker nodes in the cluster do not meet the resource requirements of the container objects to be protected, the client will feed back the monitoring information to the server, and use emails, instant messages, etc. through the web console to prompt the user that the cluster resources are insufficient at this time, so that the user can solve the resource shortage problem as soon as possible by deleting useless resources or expanding the worker nodes, thereby meeting the "low" level container to cope with complex fault scenarios. There are sufficient resources for stable operation. This level of protection objects does not use the "hard reservation" method to forcibly reserve resources, but uses the "soft reservation" method to monitor the remaining resources of the cluster, so that the protected container can be restarted more stably in complex failure scenarios. Therefore, the protection level is lower than that of the "high" and "medium" level protection objects; "low" level protection objects are suitable for ordinary level applications, such as "ordinary middleware" and "non-critical applications". For example, Figure 6 As shown in , if it is detected that there are still resources corresponding to Pod D to be protected in worker node N (such as Figure 6 ), the Pod D to be protected can be migrated to the worker node N.

[0163] For container objects that do not have a protection level set in the policy, such objects are not protected by default. In complex failure scenarios, only when the "high", "medium", and "low" level objects are started normally will the "none" level object be restarted.

[0164] When a complex failure scenario occurs, the order of container eviction operations is implemented according to the hierarchical levels of "high", "medium", "low", and "none". Specifically:

[0165] When a complex failure scenario occurs on a worker node, the master node will first instruct the worker node to evict the protected container objects of the "high" and "medium" levels to other worker nodes that have occupied resources in advance and automatically generated replica containers. In this process, k8s The master node sends instructions to other worker nodes to recycle replica objects, so that other worker nodes recycle replica resources, and then actively schedule the "high" and "medium" level protected container objects in the worker node to start and run smoothly on the worker node; then, the master node expels the "low" level protected container objects in the failed worker node to other worker nodes that can monitor and ensure the normal startup of the "low" level protected container objects, but cannot guarantee whether there are sufficient resources to meet the stable operation of the "low" level container objects to be protected, so that the "low" level container objects to be protected can start and run smoothly; finally, for the unleveled container objects in the failed worker node, after determining that all the "high", "medium" and "low" level protected container objects are started and run normally, they are scheduled to the worker node with relatively free resources, where the remaining resources of the worker node after the migration of the unleveled container objects can only meet its minimum startup resources, without guaranteeing whether it can run normally.

[0166] It should be noted that in all application scenarios, for the container objects on the failed working node, after migration, all or only part of them may be migrated to the same working node, which can be determined based on the remaining resources of the working node that receives the migrated container objects.

[0167] In some application scenarios, all container objects to be protected are jointly managed by the kubelet and client deployed on each worker node after the policy takes effect. The received policy can only take effect and achieve protection after restarting the pod. After the restart, the container objects to be protected and their replicas are directly managed by the client instead of being directly managed by the kubelet. However, in some application scenarios, the policy can take effect on each worker node without restarting the pod, which can be determined by the actual situation.

[0168] It should be noted that the complex failure scenarios of the aforementioned worker nodes may include the following three types, among which: Scenario 1 is a planned shutdown of the worker node, that is, before the administrator plans to shut it down for maintenance, he manually issues an eviction command to the worker node, such as the kubectl drain command, to actively evict the pods on it to other nodes in the cluster; Scenario 2 is an unplanned downtime of the worker node, that is, the worker node has unplanned hardware, software, system and other failures that cause downtime, and the pods it carries cannot be accessed for a short time, and are not automatically evicted to other nodes in the cluster, causing the pods on it to be in an abnormal state for a long time; Scenario 3 is insufficient remaining resources of the worker node, that is, when the remaining memory and remaining CPU resources of the worker node are insufficient, the worker node actively expels the pods it carries to other nodes in the cluster.

[0169] In this way, through the container hierarchical protection method, it is convenient for users to set the container protection level as needed, use "resources for high availability", and use limited remaining resources on objects that need to be protected; a variety of resource reservation methods are introduced, and hard resource reservation, soft resource reservation, and resource monitoring are used in combination, and coordinated with the container hierarchical protection method to ensure that the migrated container can be started normally and even run stably; by deploying a hierarchical protection system, in combination with resource reservation methods and container hierarchical protection settings, it is achieved that in the event of abnormal host conditions in various complex scenarios, the protection container can be effectively self-healed after being expelled, and can not only be started, but also meet the requirements of normal operation with reference to the protection level; further, a convenient web console is provided through the server node to centrally manage the hierarchical protection strategy, and to view and monitor the strategy status and k8s cluster resource status in real time, which can effectively lower the user's usage threshold and technical threshold, greatly improve operation and maintenance efficiency, improve the high availability protection level of key applications, and shorten the data recovery time (Recovery Time Objective, RTO) caused by maintenance or failures.

[0170] It should be noted that, for the description of the same steps and the same contents in this embodiment as those in other embodiments, reference can be made to the description in other embodiments and will not be repeated here.

[0171] A resource management method provided by an embodiment of the present application, if it is monitored that the first working node is in a preset fault state, the master node determines the second working node with which each first container object carried by the first working node has an associated relationship in order from high to low based on the hierarchical level parameters specified in the container management policy, and sends a first eviction indication message to the first working node, so that each first container object is migrated to the corresponding second working node. In this way, when the master node monitors that the first working node is in a preset fault state, according to the container management policy and the hierarchical level parameters, the first working node is preferentially controlled to migrate the first container object with a high level to the corresponding second working node for which resources have been reserved in advance, ensuring that the first container object migrated to the corresponding second working node can start and run normally, solving the problem that the evicted pod or container may not start normally on the new node, and proposing a resource management method, shortening the data recovery time of the evicted pod or container on the new node, and ensuring the continuity of the application business of the evicted pod or container.

[0172] Based on the above embodiments, the embodiments of the present application provide a resource management device, which can be applied to Figures 1 to 5 In the resource management method provided in the corresponding embodiment, refer to Figure 7 As shown, the resource management device 3 may include: a determination unit 31 and a sending unit 32; wherein:

[0173] The determination unit 31 is used to determine, if it is monitored that the first working node is in a preset fault state, the second working node with which each first container object carried by the first working node has an associated relationship in descending order based on the hierarchical level parameters specified in the container management policy; wherein the second working node is a node predetermined by the master node based on the container management policy and for which resources are reserved in advance for each first container object;

[0174] The sending unit 32 is used to send first eviction indication information to the first working node, so that each first container object is migrated to the corresponding second working node; wherein the first eviction indication information is used to indicate the eviction of each first container object to the corresponding second working node.

[0175] In other embodiments of the present application, the preset fault state includes at least one of the following states: node maintenance state, downtime state, and the remaining operating resources of the node are less than or equal to a preset threshold.

[0176] In other embodiments of the present application, before the determining unit, the device further includes: a receiving unit; wherein:

[0177] A receiving unit, configured to receive a container management policy sent by a server node; wherein the container management policy is generated after the server node detects a configuration operation corresponding to a policy configuration interface displayed in a display area;

[0178] The sending unit is further used to send the container management policy to at least one working node managed by the master node; wherein the at least one working node includes a first working node and a second working node.

[0179] In other embodiments of the present application, the determining unit is further used to determine target level parameters of m second container objects included in the container management strategy; wherein m is a positive integer greater than 0;

[0180] The determining unit is further used to determine a corresponding second working node based on each second container object and a corresponding target level parameter;

[0181] The sending unit is further used to send reservation indication information for indicating to reserve resources for each second container object to the corresponding second working node.

[0182] In other embodiments of the present application, when the determination unit performs the step of determining the second working node based on each first container object and the corresponding target level parameter, it can be implemented by the following steps:

[0183] Determine n third container objects whose target level parameters are first level parameters from the m second container objects; wherein n is a positive integer less than or equal to m;

[0184] Determine a corresponding second working node for each third container object from at least one working node; wherein the second working node does not carry the container object specified in the container management policy, and a remaining resource parameter of the second working node is greater than an operating resource parameter required for the corresponding third container object to run;

[0185] Correspondingly, the reserved indication information is used to instruct each second working node to create a replica object corresponding to the corresponding third container object.

[0186] In other embodiments of the present application, when the determination unit performs the step of determining the second working node based on each first container object and the corresponding target level parameter, it can also be implemented by the following steps:

[0187] Determine p fourth container objects whose target level parameters are second level parameters from the m second container objects; wherein the importance of the second level parameters is lower than the importance of the first level parameters, and p is a positive integer less than or equal to m;

[0188] Grouping the p fourth container objects according to a preset number to obtain q groups of container objects; wherein q is a positive integer greater than or equal to 1;

[0189] Determine the reserved resource parameters corresponding to each group of container objects;

[0190] Determine a corresponding second working node for each group of container objects from at least one working node; wherein the second working node does not carry the container object specified in the container management policy, and a remaining resource parameter of the second working node is greater than a reserved resource parameter;

[0191] Correspondingly, the reservation indication information is used to instruct each second working node to create a replica object that matches the reserved resource parameters.

[0192] In other embodiments of the present application, when the determination unit executes the step of determining the reserved resource parameters corresponding to each group of container object groups, it can be specifically implemented by the following steps:

[0193] Calculate the sum of each resource sub-parameter corresponding to each group of container objects;

[0194] The ratio of the sum of each resource sub-parameter to the preset coefficient is calculated to obtain the reserved value of each resource sub-parameter in the reserved resource parameter.

[0195] In other embodiments of the present application, the device further includes: a monitoring unit; wherein:

[0196] A monitoring unit, configured to monitor the remaining resource parameters of at least one working node if there is a fifth container object whose hierarchical level parameter is a third level parameter in the first working node, and after each first container object is migrated to the corresponding second working node; wherein the importance of the third level parameter is lower than the importance of the second level parameter;

[0197] The sending unit is further configured to send second eviction indication information to the first working node if it is determined that the third working node has a remaining resource parameter greater than a preset resource threshold, so as to migrate the fifth container object to the third working node.

[0198] In other embodiments of the present application, the device further includes: a generating unit and a display unit; wherein:

[0199] A generating unit, configured to generate a prompt message for prompting that cluster resources are insufficient if the third working node is not determined to be obtained;

[0200] The display unit is used to display prompt information.

[0201] In other embodiments of the present application, after the sending unit executes the step of sending the first eviction indication information to the first working node, it is also used to send a recycling instruction for instructing the recycling of the replica object resources to the corresponding second working node if the corresponding second working node stores a replica object of the corresponding first container object, so that the second working node deletes the corresponding replica object.

[0202] In other embodiments of the present application, the determination unit is further used to determine a corresponding fourth working node for the first container object of the target level parameter after confirming that the first container object of the target level parameter is migrated to the second working node and started normally; wherein the target level parameter is the first level parameter or the second level parameter;

[0203] The sending unit is further used to send reservation indication information for indicating to reserve resources for the first container object of the target level parameter to the fourth working node.

[0204] It should be noted that the specific implementation process of the interaction between the units and modules in this embodiment can be referred to Figures 1 to 5 The implementation process of the resource management method provided in the corresponding embodiment will not be repeated here.

[0205] A resource management device provided by an embodiment of the present application, if it is monitored that the first working node is in a preset fault state, the master node determines the second working node with which each first container object carried by the first working node has an associated relationship in order from high to low based on the hierarchical level parameters specified in the container management strategy, and sends a first eviction indication message to the first working node, so that each first container object is migrated to the corresponding second working node. In this way, when the master node monitors that the first working node is in a preset fault state, according to the container management strategy and the hierarchical level parameters, the first working node is preferentially controlled to migrate the first container object with a high level to the corresponding second working node for which resources have been reserved in advance, thereby ensuring that the first container object migrated to the corresponding second working node can start and run normally, solving the problem that the evicted pod or container may not start normally on the new node, and proposing a resource management method, which shortens the data recovery time of the evicted pod or container on the new node, and ensures the continuity of the application business of the evicted pod or container.

[0206] Based on the above embodiments, the embodiments of the present application provide a resource management system, which can be applied to Figures 1 to 5 In the resource management method provided in the corresponding embodiment, refer to Figure 8 As shown, the resource management system 4 at least includes: a master node 41 and at least one working node 42; wherein:

[0207] At least one working node 42, used to host the pod;

[0208] The master node 41 is used to implement Figures 1 to 5 The implementation process of the resource management method provided in the corresponding embodiment will not be repeated here.

[0209] Based on the above embodiments, in other embodiments of the present application, refer to Figure 8 As shown, the resource management system also includes: a server node 43; wherein:

[0210] The server node 43 is used to provide an operation interface and a display area for the user to generate a container management policy according to the user's configuration operation.

[0211] Based on the foregoing embodiments, the embodiments of the present application provide a computer-readable storage medium, referred to as a storage medium, which stores one or more programs, and the one or more programs can be executed by one or more processors to implement reference Figures 1 to 5 The implementation process of the resource management method provided in the corresponding embodiment will not be repeated here.

[0212] Based on the foregoing embodiments, the present application also provides a computer program product, including a computer program, which can be executed by a master node to implement reference Figures 1 to 5 The implementation process of the resource management method provided in the corresponding embodiment will not be repeated here.

[0213] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of hardware embodiments, software embodiments, or embodiments in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) that contain computer-usable program code.

[0214] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0215] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0216] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0217] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application.

Claims

1. A resource management method, characterized in that: The method is applied to a master node, and the method comprises: If it is monitored that the first working node is in a preset fault state, based on the hierarchical level parameters specified in the container management policy, the second working node with which each first container object carried by the first working node has an associated relationship is determined in descending order of level; wherein the second working node is a node predetermined by the master node based on the container management policy and for which resources are reserved in advance for each first container object; Sending first eviction indication information to the first working node to migrate each of the first container objects to the corresponding second working node.

2. The method according to claim 1, characterized in that The preset fault state includes at least one of the following states: node maintenance state, downtime state, and the remaining operating resources of the node are less than or equal to a preset threshold.

3. The method according to claim 1, characterized in that If it is monitored that the first working node is in a preset fault state, before determining, in descending order of levels, the second working node with which each first container object hosted by the first working node has an associated relationship based on the hierarchical level parameters specified in the container management policy, the method further includes: Receiving a container management policy sent by a server node; wherein the container management policy is generated by the server node based on a configuration operation; The container management policy is sent to at least one working node managed by the master node; wherein the at least one working node includes the first working node and the second working node.

4. The method according to claim 3, characterized in that The method further comprises: Determine target level parameters of m second container objects included in the container management strategy; wherein m is a positive integer greater than 0; Based on each of the second container objects and the corresponding target level parameters, determining a corresponding second working node; Sending reservation indication information for indicating to reserve resources for each second container object to the corresponding second working node.

5. The method according to claim 4, characterized in that The determining the second working node based on each of the first container objects and the corresponding target level parameter includes: Determine, from the m second container objects, n third container objects whose target level parameters are first level parameters; wherein n is a positive integer less than or equal to m; Determine, from at least one of the working nodes, a corresponding second working node for each of the third container objects; wherein the second working node does not carry the container object specified in the container management policy, and a remaining resource parameter of the second working node is greater than an operating resource parameter required for the corresponding third container object to run; Correspondingly, the reserved indication information is used to instruct each of the second working nodes to create a replica object corresponding to the corresponding third container object.

6. The method according to claim 4, characterized in that The determining the second working node based on each of the first container objects and the corresponding target level parameter includes: Determine, from the m second-level container objects, p fourth container objects whose target level parameters are second-level parameters; wherein the importance of the second-level parameters is lower than the importance of the first-level parameters, and p is a positive integer less than or equal to m; Grouping the p fourth container objects according to a preset number to obtain q groups of container objects; wherein q is a positive integer greater than or equal to 1; Determine a reserved resource parameter corresponding to each group of the container object groups; Determine, from at least one of the working nodes, a corresponding second working node for each group of the container object groups; wherein the second working node does not carry the container object specified in the container management policy, and a remaining resource parameter of the second working node is greater than the reserved resource parameter; Correspondingly, the reservation indication information is used to instruct each of the second working nodes to create a replica object that matches the reserved resource parameters.

7. The method according to claim 6, characterized in that The determining of the reserved resource parameters corresponding to each group of the container object groups includes: Calculate the sum of each resource sub-parameter corresponding to each group of the container objects; The ratio of the sum of each resource sub-parameter to a preset coefficient is calculated to obtain a reserved value of each resource sub-parameter in the reserved resource parameter.

8. The method according to claim 1, characterized in that The method further comprises: If there is a fifth container object whose hierarchical level parameter is a third level parameter in the first working node, and after each of the first container objects is migrated to the corresponding second working node, the remaining resource parameter of at least one working node is monitored; wherein the importance of the third level parameter is lower than the importance of the second level parameter; If it is determined that a third working node whose remaining resource parameter is greater than a preset resource threshold is obtained, second eviction indication information is sent to the first working node to migrate the fifth container object to the third working node.

9. The method according to claim 8, characterized in that The method further comprises: If the third working node is not determined, prompt information of insufficient cluster resources is sent to the server node, so that the server node generates alarm information of insufficient cluster resources based on the prompt information and displays it.

10. The method according to claim 1, characterized in that After sending the first eviction indication information to the first working node, the method further includes: If the corresponding second working node stores a replica object of the corresponding first container object, a recycling instruction for instructing to recycle the replica object resources is sent to the corresponding second working node, so that the second working node deletes the corresponding replica object.

11. The method according to claim 1, characterized in that: The method further comprises: After confirming that the first container object of the target level parameter is migrated to the second working node and is started normally, determining a corresponding fourth working node for the first container object of the target level parameter; wherein the target level parameter is a first level parameter or a second level parameter; Sending reservation indication information for indicating to reserve resources for the first container object of the target level parameter to the fourth working node.

12. A resource management device, characterized in that: The device is mainly applied to a master node, and comprises: a determination unit and a sending unit; wherein: The determining unit is configured to determine, if it is monitored that the first working node is in a preset fault state, a second working node with which each first container object carried by the first working node has an associated relationship in descending order based on the hierarchical level parameters specified in the container management policy; wherein the second working node is a node predetermined by the master node based on the container management policy and for which resources are reserved in advance for each first container object; The sending unit is used to send first eviction indication information to the first working node, so that each of the first container objects is migrated to the corresponding second working node.

13. A resource management system, characterized in that: The system comprises: a master node and at least one working node; wherein: At least one of the working nodes is used to carry the container group pod; The master node is used to implement the steps of the resource management method according to any one of claims 1 to 11.

14. A storage medium, characterized in that: The storage medium stores a resource management program, and when the resource management program is executed by the processor, the steps of the resource management method according to any one of claims 1 to 11 are implemented.

15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the computer program implements the steps of the resource management method according to any one of claims 1 to 11.