IaaS-based cluster capacity expansion and shrinkage method, system and device and storage medium

By monitoring application indicators in real time and adjusting resources automatically, the problem of expansion and expansion in the existing technology requires manual intervention and the number of nodes cannot be dynamically adjusted, and rapid and accurate cluster expansion and improvement of resource utilization and service stability are achieved.

CN119988125APending Publication Date: 2025-05-13浙江农村商业联合银行股份有限公司

Patent Information

Application Number
CN202411852232.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

The prior art requires manual intervention in the expansion and shrinkage process, and cannot quickly respond to the expansion requirements of peak traffic and the resource recovery requirements after the peak traffic. The number of expansion and shrinkage nodes cannot be dynamically adjusted, resulting in the expansion and shrinkage time and prone to misjudgment.

Method used

By reading application monitoring indicators in the service cluster in real time and comparing them with the preset capacity expansion threshold and capacity reduction threshold, the capacity expansion or capacity reduction process will be automatically triggered. Use the IaaS interface to automatically create and recycle resources and dynamically adjust the cluster size.

Benefits of technology

It achieves faster scaling, reduces scaling time, avoids misjudgment of manual operations, ensures the matching of cluster size and traffic, and improves resource utilization and service stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119988125A_ABST
    Figure CN119988125A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses an IaaS-based cluster capacity expansion and shrinkage method, system and device and a storage medium, the method is applied to an elastic resource management unit, the elastic resource management unit is deployed in a management cluster, and the method comprises the following steps: reading an application monitoring index in a service cluster in real time; comparing the application monitoring index value with a capacity expansion threshold value and a capacity reduction threshold value respectively; if the value exceeds a capacity expansion threshold value in a preset time period, executing application capacity expansion; and if the value is lower than the capacity reduction threshold value in the preset time period, executing application capacity reduction. According to the embodiment of the invention, by monitoring the cluster load index and calling the IaaS interface to automatically create and recycle the resources, manual operation is avoided, so that capacity expansion and shrinkage are carried out more quickly, and the capacity expansion and shrinkage time is effectively shortened. According to the capacity expansion and contraction strategy, the number of nodes for capacity expansion and contraction each time can be defined, the capacity expansion and contraction scale is automatically judged according to the monitoring index, the cluster scale and the flow are always kept matched, and the finer capacity expansion and contraction scale is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the technical field of cluster management, and in particular to a cluster expansion and contraction method, system, device and storage medium based on IaaS. Background Art

[0002] As the business grows, the number of users and the volume of requests may increase, requiring the system to be able to handle more concurrent requests. Capacity expansion can increase processing power to meet performance requirements during business peak periods.

[0003] Capacity expansion can improve the system's processing power and stability and prevent system overload. Capacity reduction can reduce resource usage during business downturns, avoid resource waste, and improve resource utilization.

[0004] By dynamically adjusting the cluster size, you can ensure that resources are fully utilized while avoiding idle or insufficient resources, ensuring service stability and reducing costs.

[0005] CN113626145A provides a method and system for dynamically scaling business virtual machines, which realizes dynamic expansion by monitoring the resource parameters of the business virtual machines of the business group and calculating the expansion factor of the business group. CN106325979A provides a method and device for deploying virtual machines and network function virtualization orchestration NVFO, which realizes the expansion or contraction of virtual machines by determining the deployment strategy and reserving the start time of deploying virtual machines.

[0006] However, the above method requires manual intervention during the expansion and contraction process, and cannot quickly respond to the expansion needs during traffic peaks and the resource recovery needs after the traffic peaks; the number of expansion nodes needs to be planned in advance and created at a specified time, which cannot cope with sudden traffic; and judging whether expansion is needed based on whether a pod (the smallest deployable computing unit that can be created and managed in Kubernetes) is in a pending state is prone to misjudgment. At the same time, it is difficult to accurately judge the actual load of the cluster, resulting in inaccurate expansion decisions. Summary of the invention

[0007] To this end, the embodiments of the present invention provide an IaaS-based cluster expansion and contraction method, system, device and storage medium to solve the technical problems in the prior art that the number of expansion nodes cannot be dynamically adjusted, expansion and contraction takes a long time, and expansion and contraction requirements are prone to misjudgment.

[0008] In order to achieve the above objectives, the embodiments of the present invention provide the following technical solutions:

[0009] According to a first aspect of an embodiment of the present invention, a cluster expansion and contraction method based on IaaS is provided, the method is applied to an elastic resource management unit, the elastic resource management unit is deployed in a management cluster, and the method includes:

[0010] Read application monitoring indicators in the business cluster in real time;

[0011] Compare the application monitoring indicator value with the expansion threshold set in the expansion strategy and the reduction threshold set in the reduction strategy respectively;

[0012] If the application monitoring indicator value is lower than the expansion threshold and exceeds the reduction threshold within the preset time period, the business cluster continues to be monitored;

[0013] If the application monitoring indicator value exceeds the expansion threshold within a preset period of time, the application expansion process is triggered;

[0014] If the application monitoring indicator value is lower than the reduction threshold value within a preset time period, it triggers the application reduction process.

[0015] Furthermore, the capacity expansion strategy includes an application capacity expansion strategy and a node capacity expansion strategy.

[0016] Furthermore, if the application monitoring indicator value exceeds the expansion threshold value within a preset period of time, the application expansion process is triggered, including:

[0017] Obtain the number of replicas and total resources required for application expansion based on the expansion strategy;

[0018] Get the amount of resources required by the application and the amount of currently idle resources;

[0019] Use the current amount of idle resources to determine whether the application expansion requirements are met;

[0020] If the requirements of the application expansion strategy are not met, the node expansion strategy is executed;

[0021] If the application expansion requirements are met, the application expansion strategy is executed.

[0022] Furthermore, the application expansion strategy is implemented, including:

[0023] Prepare the required resources and configure the new node, and add the new node to the existing cluster.

[0024] Furthermore, the node expansion strategy is executed, including:

[0025] The number of nodes required for expansion is calculated based on the application resource amount and the target cluster water level threshold;

[0026] Call the IaaS interface and create a cloud host of preset specifications in the VPC where the current cluster is located, and use the preset script to initialize the newly created host node;

[0027] Add the initialized host as a working node of the business cluster and specify the expansion node ID, complete the node expansion and execute the application expansion strategy;

[0028] After the application execution strategy is completed, continue to obtain cluster monitoring to detect whether the application monitoring indicators are lower than the expansion threshold;

[0029] If the capacity is lower than the expansion threshold, the expansion is terminated;

[0030] If it is higher than the expansion threshold, continue to expand.

[0031] Furthermore, if the application monitoring indicator value is lower than the reduction threshold value within a preset period of time, the application reduction process is triggered, including:

[0032] The expansion node information is obtained by querying the expansion node identifier, and the expansion batch number is scaled down in descending order using the preset scaling strategy;

[0033] The shrinking operation includes:

[0034] Obtain the node to be shrunk and add a NoExecute taint identifier to the node to be shrunk;

[0035] Evict the pods on the node to be scaled down and prevent new pods from being scheduled to the node;

[0036] After all pods on the node are expelled, delete the node from the business cluster;

[0037] Call the IaaS interface to terminate and recycle the node to complete the reduction.

[0038] Furthermore, the shrinking operation further includes:

[0039] Continue to obtain the monitoring indicators of the cluster. If they are still lower than the reduction threshold, continue to reduce the capacity; otherwise, stop reducing the capacity.

[0040] According to a second aspect of an embodiment of the present invention, a cluster expansion and contraction system based on IaaS is provided, the system comprising:

[0041] The monitoring module is used to perform the following steps:

[0042] Read application monitoring indicators in the business cluster in real time;

[0043] Compare the application monitoring indicator value with the expansion threshold set in the expansion strategy and the reduction threshold set in the reduction strategy respectively;

[0044] If the application monitoring indicator value is lower than the expansion threshold and exceeds the reduction threshold within the preset time period, the business cluster continues to be monitored;

[0045] The expansion module is used to trigger the application expansion process if the application monitoring indicator value exceeds the expansion threshold within a preset time period;

[0046] The shrinking module is used to trigger the application shrinking process if the application monitoring indicator value is lower than the shrinking threshold within a preset time period.

[0047] According to a third aspect of an embodiment of the present invention, there is provided an IaaS-based cluster expansion and contraction device, the device comprising: a processor and a memory;

[0048] The memory is used to store one or more program instructions;

[0049] The processor is used to run one or more program instructions to execute the steps of the IaaS-based cluster expansion and contraction method as described in any one of the above items.

[0050] According to a fourth aspect of an embodiment of the present invention, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of an IaaS-based cluster expansion and contraction method as described in any one of the above items are implemented.

[0051] The embodiments of the present invention have the following advantages:

[0052] The embodiment of the present invention monitors cluster load indicators and calls IaaS interfaces to automatically create and recycle resources, avoiding manual operations, thereby performing expansion and contraction more quickly and effectively reducing expansion and contraction time. The expansion and contraction strategy can define the number of nodes to be expanded and contracted each time, and automatically determine the expansion and contraction scale based on the monitoring indicators, so that the cluster scale and traffic are always matched, achieving a more refined expansion and contraction scale. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] In order to more clearly illustrate the implementation methods of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for the implementation methods or the description of the prior art. Obviously, the drawings in the following description are only exemplary, and for ordinary technicians in this field, other implementation drawings can be derived from the provided drawings without creative work.

[0054] The structures, proportions, sizes, etc. illustrated in this specification are only used to match the contents disclosed in the specification so as to facilitate understanding and reading by persons familiar with the technology. They are not used to limit the conditions under which the present invention can be implemented, and therefore have no substantial technical significance. Any structural modification, change in proportion or adjustment of size shall still fall within the scope of the technical contents disclosed in the present invention without affecting the effects and purposes that can be achieved by the present invention.

[0055] Figure 1 A schematic diagram of the logical structure of an IaaS-based cluster expansion and contraction system provided in an embodiment of the present invention;

[0056] Figure 2 A schematic diagram of a process flow of a cluster expansion and contraction method based on IaaS provided in an embodiment of the present invention;

[0057] Figure 3 A schematic diagram of a capacity expansion process in an IaaS-based cluster capacity expansion and contraction method provided in an embodiment of the present invention;

[0058] Figure 4 A schematic diagram of a capacity reduction process in an IaaS-based cluster capacity expansion and contraction method provided in an embodiment of the present invention;

[0059] Figure 5 The present invention provides an example schematic diagram of a loading and capacity expansion strategy in an IaaS-based cluster capacity expansion and contraction method provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0060] The following is a description of the implementation of the present invention by specific embodiments. People familiar with the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0061] Node expansion process:

[0062] Prepare resources: Apply for the corresponding resources from the cloud service provider and ensure the compatibility of the new node with the existing infrastructure. Configure the new node: Install the operating system and necessary software, configure network settings, and install and configure monitoring and management tools. Join the cluster: Join the new node to the existing cluster and schedule the workload to the new node.

[0063] Node scaling process:

[0064] Migrate workloads: Migrate workloads on a node to other nodes to ensure that applications and data run normally on other nodes. Remove nodes: Remove nodes from the load balancer and remove the node from the cluster. Release resources: Release the computing resources of the node. If it is a virtual machine of a cloud service provider, terminate the instance to release the cost.

[0065] Kubernetes is an open source platform for automating the deployment, scaling, and management of containerized applications.

[0066] However, the above method requires manual intervention during the expansion and contraction process, and cannot quickly respond to the expansion needs during traffic peaks and the resource recovery needs after the traffic peaks; the number of expansion nodes needs to be planned in advance and created at a specified time, which cannot cope with sudden traffic; and judging whether expansion is needed based on whether a pod (the smallest deployable computing unit that can be created and managed in Kubernetes) is in a pending state is prone to misjudgment. At the same time, it is difficult to accurately judge the actual load of the cluster, resulting in inaccurate expansion decisions.

[0067] In order to solve the technical problems that the number of expansion nodes cannot be adjusted dynamically, expansion and contraction takes a long time, and the expansion and contraction needs are prone to misjudgment.

[0068] refer to Figure 1 The embodiment of the present invention discloses a cluster expansion and contraction system based on IaaS, which includes: a monitoring module 1; an expansion module 2; and a contraction module 3.

[0069] Corresponding to the above-disclosed IaaS-based cluster expansion and contraction system, the embodiment of the present invention further discloses an IaaS-based cluster expansion and contraction method. The following describes in detail the IaaS-based cluster expansion and contraction method disclosed in the embodiment of the present invention in combination with the above-described IaaS-based cluster expansion and contraction system.

[0070] refer to Figure 2 The present invention discloses a cluster expansion and contraction method based on IaaS, the method is applied to an elastic resource management unit, the elastic resource management unit is deployed in a management cluster, the method comprises: reading application monitoring indicators in a business cluster in real time; comparing the application monitoring indicator value with the expansion threshold set in the expansion strategy and the contraction threshold set in the contraction strategy respectively; if the application monitoring indicator value is lower than the expansion threshold and exceeds the contraction threshold within a preset time period, the business cluster is continued to be monitored; if the application monitoring indicator value exceeds the expansion threshold within a preset time period, the application expansion process is triggered; if the application monitoring indicator value is lower than the contraction threshold within a preset time period, the application contraction process is triggered.

[0071] Deploy a scaling component in the management cluster to monitor the load status of each business cluster in real time. When the monitoring indicators meet the scaling conditions, the scaling operation is triggered.

[0072] When the component starts, the expansion strategy configuration is loaded. The expansion strategy is divided into application expansion strategy, including application monitoring indicators (CPU, memory usage, network inflow and outflow rate, etc.), expansion threshold and stabilization time; expansion node strategy, including cluster resource level, expansion node specifications, number of nodes for a single expansion, expansion node label settings, etc.

[0073] Furthermore, the capacity expansion strategy includes an application capacity expansion strategy and a node capacity expansion strategy.

[0074] The component periodically obtains application monitoring indicators in the business cluster and compares them with the expansion threshold set in the expansion policy. If the value exceeds the expansion threshold for a period of time, it triggers the application expansion process. Otherwise, it continues to obtain business cluster monitoring information periodically.

[0075] Further, refer to Figure 3 and Figure 5 If the application monitoring indicator value exceeds the expansion threshold within a preset time period, the application expansion process is triggered, including: obtaining the number of copies and the total amount of resources that need to be expanded for the application according to the expansion strategy; obtaining the amount of resources required by the application and the current amount of idle resources; using the current amount of idle resources to determine whether the application expansion requirements are met; if the requirements of the application expansion strategy are not met, executing the node expansion strategy; if the application expansion requirements are met, executing the application expansion strategy.

[0076] After entering the application expansion process, the number of replicas and total resources that need to be expanded for the application are confirmed based on the expansion strategy.

[0077] Furthermore, the application expansion strategy is executed, including: preparing the required resources and configuring the new node, and adding the new node to the existing cluster.

[0078] Check whether the business cluster has sufficient resources based on the amount of resources required by the application. If so, start the application expansion operation. After completion, the component continues to obtain cluster monitoring to check whether the application monitoring indicators drop to the threshold. If the cluster monitoring indicators still exceed the threshold after expansion, the expansion will continue. Otherwise, the expansion action will be terminated.

[0079] If the current idle resources of the cluster do not meet the application expansion requirements, the node expansion process will be entered to automatically calculate the required number of nodes for expansion based on the application resource volume and the target cluster water level threshold.

[0080] Furthermore, executing the node expansion strategy includes: calculating the number of nodes required for expansion according to the application resource amount and the target cluster water level threshold; calling the IaaS interface and creating a cloud host of preset specifications in the VPC where the current cluster is located and initializing the newly created host node using a preset script; adding the initialized host as a working node of the business cluster and specifying the expansion node identifier, completing the node expansion and executing the application expansion strategy; after the application execution strategy is completed, continuing to obtain cluster monitoring to detect whether the application monitoring indicator is lower than the expansion threshold; if it is lower than the expansion threshold, ending the expansion; if it is higher than the expansion threshold, continuing the expansion.

[0081] The component starts the node expansion operation, calls the IaaS interface, creates a cloud host of the specified specification in the VPC where the current cluster is located, and uses the preset script to initialize the created host node.

[0082] After the host is created, it is added as a working node of the business cluster and a corresponding expansion tag is added. The tag contains the expansion batch number, expansion number, and expansion quantity information for subsequent recycling.

[0083] After the node expansion is completed, the application expansion operation begins. After completion, the component continues to obtain cluster monitoring to check whether the application monitoring indicators drop to the threshold. If the cluster monitoring indicators still exceed the threshold after expansion, the expansion will continue, otherwise the expansion action will be terminated.

[0084] refer to Figure 5 For example, when loading the expansion strategy, the application expansion strategy is: CPU usage exceeds 60%, stabilization time is 3 minutes, and the expansion step is 5. The node expansion strategy is: cluster resource water level 75%, expansion node rule 16C32G, and the maximum number of word expansion is 5.

[0085] Read the application monitoring indicators. The application CPU usage exceeds 60% for 5 minutes. At this time, the application expansion is triggered. The number of expansion copies is 5 and the rule is 4C8G, requiring a total of 20C40G resources.

[0086] Check whether the cluster has sufficient resources. For example, the total capacity of the cluster is 100C200G, and the resource water level is 75%, that is, the stable allocatable value is 75C150G. Currently, 70C140G has been allocated and used, which does not meet the application expansion requirements. Enter the cluster expansion process.

[0087] Enter the cluster expansion process and calculate the number of nodes to be expanded according to the expansion strategy. 20C40G / 16C32 is rounded to 2, which means that the number of nodes required for expansion is 2.

[0088] Call the cluster management platform interface to obtain the label information of the cluster host where the application is currently located. It is found that the current host is in the APP VPC area, the subnet is test-net, and the latest expansion batch is 1. Call the corresponding IaaS platform API to create two cloud hosts in the APP VPC and classify them under the switch corresponding to the test-net subnet. Use the built-in script to initialize the cluster nodes.

[0089] Call the cluster management platform API again to add cluster nodes, set the current application cluster, fill in the two cloud host information and username and password just allocated, and start adding nodes.

[0090] After the nodes are added successfully, label the two newly expanded nodes with the label node-batch:2 to identify them as belonging to the second expansion batch.

[0091] After the cluster expansion is completed, the application expansion begins. The application management API is called to expand the application, 5 new replicas are added, and the application is ready to start.

[0092] After the replica is added, the component continues to observe the CPU usage of the application. If the CPU usage is less than 60% in the past 5 minutes, the application expansion is completed.

[0093] Further, refer to Figure 4 If the application monitoring indicator value is lower than the shrinking threshold within the preset time period, the application shrinking process is triggered, including: obtaining the expansion node information according to the expansion node identifier query, and using the preset shrinking strategy to perform shrinking operations in order from large to small according to the expansion batch number.

[0094] When the component starts, the scaling-in policy configuration is loaded, which mainly includes monitoring indicators (CPU, memory usage, etc.) and their thresholds, duration, number of nodes to scale down each time, labels of nodes to scale up, etc.

[0095] The business cluster monitoring indicators are read in real time and compared with the conditions configured in the scaling-in policy. If the monitoring indicators are lower than the set threshold and the duration meets the set requirements, the scaling-in action is triggered. Otherwise, the business cluster continues to be monitored.

[0096] If the scaling-in conditions are met, the scaling-in node information is queried based on the scaling-in node label, and then scaling-in operations are performed in descending order according to the scaling-in batch numbers based on the scaling-in policy settings.

[0097] The scaling-down operation includes: obtaining the node to be scaled down and adding a NoExecute taint identifier to the node to be scaled down; expelling the pod on the node to be scaled down and preventing new pods from being scheduled to the node; after all pods on the node are expelled, deleting the node from the business cluster; calling the IaaS interface to terminate and recycle the node to complete the scaling-down.

[0098] When scaling down, first add the NoExecute taint label to the node to be scaled down, evict the Pod on the node, and prevent new Pods from being scheduled to the node. Check whether the Pod on the node has been evicted, and delete the node from the cluster after completion. Call the IaaS interface to terminate and recycle the node.

[0099] Furthermore, the scaling-in operation further includes: continuing to obtain the monitoring indicator of the cluster, and if it is still lower than the scaling-in threshold, continuing the scaling-in, otherwise ending the scaling-in.

[0100] Continue to obtain the monitoring indicators of the cluster. If it is still below the threshold, continue to scale in, otherwise end the scaling action.

[0101] Save the scaling policy configuration to ConfigMap, and then deploy the scaling component to the management cluster. Use jmeter to import stress test traffic into the business cluster and observe the cluster load changes. When the monitoring indicator exceeds the threshold and lasts for the specified time, the scaling component starts to create a new virtual machine node and add it to the business cluster. Then, the cluster load begins to drop to the expected value. After stopping the jmeter stress test, when the cluster monitoring indicator continues to be lower than the scaling threshold for a period of time, the scaling component starts to scale in, adds the NoExecute taint label to the node to be scaled in, evicts the Pod that is already running on the node, and after all Pods are evicted, deletes the node from the cluster, and then calls the IaaS interface to terminate and recycle the node.

[0102] The embodiment of the present invention determines whether the cluster needs to be expanded or reduced by monitoring the cluster's load indicators (CPU / memory occupancy rate, etc.), automatically expands the capacity in batches, and joins the container cluster; automatically reduces the capacity in batches, and recycles node resources. By monitoring the cluster load indicators, the IaaS interface is called to automatically create and recycle resources, avoiding manual operations, thereby expanding or reducing capacity more quickly and effectively reducing the expansion or reduction time. The expansion or reduction strategy can define the number of nodes to be expanded or reduced each time, and automatically determine the expansion or reduction scale based on the monitoring indicators, so that the cluster scale and traffic are always matched, and a more refined expansion or reduction scale is achieved.

[0103] In addition, an embodiment of the present invention also provides an IaaS-based cluster expansion and contraction device, the device comprising: a processor and a memory; the memory is used to store one or more program instructions; the processor is used to run one or more program instructions to execute the steps of an IaaS-based cluster expansion and contraction method as described in any of the above items.

[0104] In addition, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of an IaaS-based cluster expansion and contraction method as described in any of the above items are implemented.

[0105] In the embodiment of the present invention, the processor may be an integrated circuit chip having the signal processing capability. The processor may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0106] The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present invention can be directly embodied as a hardware decoding processor for execution, or can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The processor reads the information in the storage medium and completes the steps of the above method in combination with its hardware.

[0107] The storage medium may be a memory, which may be, for example, a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memory.

[0108] Among them, the non-volatile memory can be a read-only memory (ROM), a programmable ROM (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory.

[0109] The volatile memory may be a random access memory (RAM) which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDRSDRAM), enhanced synchronous DRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus DRAM (DRRAM).

[0110] The storage media described in the embodiments of the present invention are intended to include, but are not limited to, these and any other suitable types of memory.

[0111] Those skilled in the art will appreciate that in one or more of the above examples, the functions described in the present invention can be implemented using a combination of hardware and software. When software is used, the corresponding functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any media that facilitates the transmission of computer programs from one place to another. Storage media can be any available media that can be accessed by general or special-purpose computers.

[0112] Although the present invention has been described in detail above by general description and specific embodiments, it is obvious to those skilled in the art that some modifications or improvements can be made to the present invention. Therefore, these modifications or improvements made without departing from the spirit of the present invention all belong to the scope of protection claimed by the present invention.

Claims

1. A cluster expansion and contraction method based on IaaS, characterized in that: The method is applied to an elastic resource management unit, and the elastic resource management unit is deployed in a management cluster. The method includes: Read application monitoring indicators in the business cluster in real time; Compare the application monitoring indicator value with the expansion threshold set in the expansion strategy and the reduction threshold set in the reduction strategy; If the application monitoring indicator value is lower than the expansion threshold and exceeds the reduction threshold within the preset time period, the business cluster continues to be monitored; If the application monitoring indicator value exceeds the expansion threshold within a preset period of time, the application expansion process is triggered; If the application monitoring indicator value is lower than the reduction threshold value within a preset time period, it triggers the application reduction process.

2. The IaaS-based cluster expansion and contraction method according to claim 1, characterized in that: The capacity expansion strategy includes an application capacity expansion strategy and a node capacity expansion strategy.

3. The IaaS-based cluster expansion and contraction method according to claim 2, characterized in that: If the application monitoring indicator value exceeds the expansion threshold within the preset time period, the application expansion process is triggered, including: Obtain the number of replicas and total resources required for application expansion based on the expansion strategy; Get the amount of resources required by the application and the amount of currently idle resources; Use the current amount of idle resources to determine whether the application expansion requirements are met; If the requirements of the application expansion strategy are not met, the node expansion strategy is executed; If the application expansion requirements are met, the application expansion strategy is executed.

4. The IaaS-based cluster expansion and contraction method according to claim 3, characterized in that: Execute application expansion strategies, including: Prepare the required resources and configure the new node, and add the new node to the existing cluster.

5. The IaaS-based cluster expansion and contraction method according to claim 4, characterized in that: Execute node expansion strategies, including: The number of nodes required for expansion is calculated based on the application resource amount and the target cluster water level threshold; Call the IaaS interface and create a cloud host of preset specifications in the VPC where the current cluster is located, and use the preset script to initialize the newly created host node; Add the initialized host as a working node of the business cluster and specify the expansion node ID, complete the node expansion and execute the application expansion strategy; After the application execution strategy is completed, continue to obtain cluster monitoring to detect whether the application monitoring indicators are lower than the expansion threshold; If the capacity is lower than the expansion threshold, the expansion is terminated; If it is higher than the expansion threshold, continue to expand.

6. The IaaS-based cluster expansion and contraction method according to claim 5, characterized in that: If the application monitoring indicator value is lower than the reduction threshold value within the preset period, the application reduction process is triggered, including: The expansion node information is obtained by querying the expansion node identifier, and the expansion batch number is scaled down in descending order using the preset scaling strategy; The shrinking operation includes: Obtain the node to be shrunk and add a NoExecute taint identifier to the node to be shrunk; Evict the pods on the node to be scaled down and prevent new pods from being scheduled to the node; After all pods on the node are expelled, delete the node from the business cluster; Call the IaaS interface to terminate and recycle the node to complete the reduction.

7. The IaaS-based cluster expansion and contraction method according to claim 6, characterized in that: The shrinking operation further includes: Continue to obtain the monitoring indicators of the cluster. If they are still lower than the reduction threshold, continue to reduce the capacity; otherwise, stop reducing the capacity.

8. A cluster expansion and contraction system based on IaaS, characterized in that: The system comprises: The monitoring module is used to perform the following steps: Read application monitoring indicators in the business cluster in real time; Compare the application monitoring indicator value with the expansion threshold set in the expansion strategy and the reduction threshold set in the reduction strategy; If the application monitoring indicator value is lower than the expansion threshold and exceeds the reduction threshold within the preset time period, the business cluster continues to be monitored; The expansion module is used to trigger the application expansion process if the application monitoring indicator value exceeds the expansion threshold within a preset time period; The shrinking module is used to trigger the application shrinking process if the application monitoring indicator value is lower than the shrinking threshold within a preset time period.

9. A cluster expansion and contraction device based on IaaS, characterized in that: The device comprises: a processor and a memory; The memory is used to store one or more program instructions; The processor is used to run one or more program instructions to execute the steps of the IaaS-based cluster expansion and contraction method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the IaaS-based cluster expansion and contraction method are implemented as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • A virtual machine deploying method and device and a network functions virtualised orchestrator (NVFO)

    CN106325979A

  • Method and system for dynamically expanding quantity of service virtual machines

    CN113626145A

Cited By

  • Method for realizing computing power virtualization elastic capacity expansion and contraction under large model reasoning framework

    CN120631561A

  • Method and device for automatically expanding Kubernetes static Pod

    CN121255366A

  • A method and device for automatically expanding Kubernetes static pods

    CN121255366B

  • Task execution resource capacity expansion and shrinkage method and device based on Jenkins and K8s and medium

    CN122152392A