Elastic capacity expansion and contraction method and device based on cloud native dynamic cluster, and storage medium

By adopting the elastic expansion capacity method in the Yunyuan Biological Dynamic Cluster, the dynamic management of the resources of the Yun native system, the problem of low resource utilization rate in the existing technology has been solved, and the smooth utilization of resources and the smoothness of the expansion capacity.

CN119383085APending Publication Date: 2025-01-28中国太平洋人寿保险股份有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411660295.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-20
Publication Date
2025-01-28

AI Technical Summary

Technical Problem

In the cloud-native system of large companies, it is difficult to effectively improve the utilization rate of basic resource facilities, resulting in waste of hardware resources.

Method used

Using the elastic expansion capacity of Yunyuan Biological Dynamic Cluster, by determining the CPU usage situation and traffic request of the cluster, dynamically expand or reduce cluster resources, give priority to using BUFF nodes and IaaS interfaces to generate new nodes to achieve flexible management of resources for resources Essence

Benefits of technology

It reduces the initialization rate of cluster resources, improves the utilization of resource utilization, realizes the smoothness of capacity expansion and contraction, and avoids waste of hardware resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119383085A_ABST
    Figure CN119383085A_ABST
Patent Text Reader

Abstract

The invention relates to an elastic capacity expansion and shrinkage method based on a cloud native dynamic cluster, which comprises the following steps: S1, judging whether the current cluster needs to be expanded or shrunk, if so, executing S2, if so, executing S4, and if not, repeating the step; s2, judging whether a node meeting a capacity expansion condition exists in the current cluster or not, if so, realizing capacity expansion by adopting the node in the cluster, and if not, executing a step S3; s3, when the cluster needs to be expanded, judging whether a BUFF node exists or not, if so, realizing expansion by using the BUFF node, and if not, generating a new computing node and adding the new computing node into the cluster to realize expansion; s4, after the Pod in the node needing capacity reduction is migrated to other nodes, the Pod is added into the list to be subjected to capacity reduction; and S5, for the nodes in the list to be subjected to capacity reduction, carrying out capacity reduction in a manner that empty nodes are preferential and non-empty nodes are second. The method has the advantages of reducing the initialization rate of the cluster, being smooth in capacity expansion and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer networks, and in particular to a method, device, and storage medium for elastic expansion and contraction based on cloud-native dynamic clusters. Background Art

[0002] The cloud-native technology system provides a complete cloud solution for large companies. Its technical features include containerized deployment, microservice architecture, devops, and continuous release, which greatly improves the stability, scalability, and contraction of the system.

[0003] However, large companies have many systems and consume a lot of hardware resources such as CPU storage. How to improve the utilization rate of basic resource facilities and how to avoid the waste of infrastructure and hardware resources are important criteria for the success of system cloud migration. Summary of the invention

[0004] The purpose of the present invention is to overcome the defects of the above-mentioned prior art and provide an elastic scaling method, device, and storage medium based on cloud-native dynamic clusters to solve or partially solve the problem of high cluster resource initialization rate.

[0005] The purpose of the present invention can be achieved by the following technical solutions:

[0006] One aspect of the present invention provides a method for elastic expansion and contraction based on a cloud-native dynamic cluster, comprising the following steps:

[0007] Step S1, determine whether the current cluster needs to be expanded or reduced. If it needs to be expanded, execute step S2; if it needs to be reduced, execute step S4; if it does not need to be expanded or reduced, repeat this step;

[0008] Step S2, determining whether there are nodes in the current cluster that meet the expansion conditions, if so, using the nodes in the cluster to achieve expansion, if not, executing step S3;

[0009] Step S3, when the cluster needs to be expanded, determine whether there is a BUFF node, if so, use the BUFF node to achieve expansion, if not, generate a new computing node and add it to the cluster to achieve expansion;

[0010] Step S4: After migrating the Pod of the node that needs to be shrunk to other nodes, add it to the list to be shrunk;

[0011] Step S5, scaling down the nodes in the to-be-shrunk list with empty nodes being prioritized and non-empty nodes being second.

[0012] As a preferred technical solution, in step S1, whether capacity expansion or contraction is required is determined based on CPU usage and traffic request volume.

[0013] As a preferred technical solution, in step S5, the process of achieving capacity reduction includes the following steps:

[0014] Step S501: Add the NoSchedule taint to the target scale-down node and evict non-DaemonSet Pods;

[0015] Step S502, in response to the completion of Pod eviction, delete the target shrinking node through the Provider interface, clean up the corresponding Machine and Node resources in the cluster, and complete the shrinking.

[0016] As a preferred technical solution, in the shrinking process of step S5, shrinking is performed on multiple empty nodes at one time, and for non-empty nodes, only one non-empty node is shrunk each time.

[0017] As a preferred technical solution, in step S2, a new node is generated by calling an IaaS interface.

[0018] As a preferred technical solution, when there is at least one empty node in the list to be shrunk, the waiting time of the non-empty nodes is reset; when there is no empty node in the list to be shrunk, the waiting time of the non-empty nodes is started, and when the waiting time exceeds the preset time, the shrinkage of the non-empty nodes is triggered.

[0019] As a preferred technical solution, the preset time is 5-20 minutes.

[0020] As a preferred technical solution, the elastic expansion and contraction method is applied to the PaaS platform.

[0021] Another aspect of the present invention provides an electronic device, including: one or more processors and a memory, wherein the memory stores one or more programs, and the one or more programs include instructions for executing the aforementioned elastic scaling method based on cloud-native dynamic clusters.

[0022] Another aspect of the present invention provides a computer-readable storage medium, comprising one or more programs for execution by one or more processors of an electronic device, wherein the one or more programs include instructions for executing the aforementioned elastic scaling method based on cloud-native dynamic clusters.

[0023] Compared with the prior art, the present invention has at least one of the following beneficial effects:

[0024] (1) Reducing the initialization rate of the cluster: To address the problem of high resource occupancy and unclear utilization improvement in the current scaling solution, the present invention combines elastic scaling with a method of rapidly increasing resources within the cluster to reduce the initialization rate of cluster resources, thereby effectively improving resource utilization.

[0025] (2) Smooth capacity expansion: The present invention introduces the Buff mechanism to preferentially generate a number of Buff nodes, making capacity expansion smoother. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 It is a flowchart of the elastic expansion and contraction method based on cloud-native dynamic cluster in the embodiment;

[0027] Figure 2 Schematic diagram of the scaling determination process in the embodiment. DETAILED DESCRIPTION

[0028] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are 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 should fall within the scope of protection of the present invention.

[0029] Example 1

[0030] In view of the problems existing in the above-mentioned prior art, this embodiment provides an elastic expansion and contraction method based on cloud native dynamic cluster, and the method mainly includes the following steps:

[0031] Step S1, set the conditions for expansion and contraction, and set the library expansion and contraction strategy, such as CPU and traffic request. Set the value of the cluster's buff node. When the actual available resources are less than the buffer value, the Buffer node is used first for expansion (this condition is optional, 1-buffer = packing rate, the default buffer is 0).

[0032] Step S2: When the system is running, check whether expansion is needed, mainly based on CPU, traffic request, etc.

[0033] Step S3, determine whether there are nodes in the currently running cluster that meet the expansion requirements. If so, use the nodes in the cluster. If not, call the IaaS interface and temporarily join the cluster.

[0034] Step S4: If the cluster needs to be expanded, the BUFF node is used first. If the BUFF node cannot meet the expansion requirements, the underlying IaaS platform interface is mobilized to generate computing nodes, and the nodes are added to the cluster to expand the capacity. Among them, the BUFF node is a certain number of spare nodes that are pre-determined in the current cluster. When the cluster resources are almost exhausted, but the time to mobilize the IaaS platform interface to generate new computing nodes and then add them is too slow, resulting in the system being unable to expand quickly. At this time, the BUFF node is used first to respond to some expansion requests.

[0035] Step S5: When the system is running, check whether the reduction condition has been triggered. The main judgment basis is CPU, traffic request, etc.

[0036] Step S6: Migrate the node that needs to be shrunk to other nodes and add it to the waiting list for shrunk;

[0037] Step S7, the nodes in the waiting list for shrinking, after waiting for a certain period of time (the default is 10 minutes, which can be adjusted within the range of 5-20 minutes), still meet the shrinking conditions, and then start to shrink;

[0038] Step S8: When there are both empty nodes and non-empty nodes in the waiting list for shrinking, the waiting time of the non-empty nodes will be reset to ensure that the empty nodes are shrunk first. After the empty nodes are shrunk, the waiting time of the non-empty nodes will start.

[0039] Step S9: When the scaling down is triggered, the node is tainted with NoSchedule, and then non-DaemonSet Pods are evicted.

[0040] Step S10: After the Pod is expelled, the Provider interface is called to delete the node, and the corresponding Machine and Nod== resources in the K8s cluster are cleaned up to complete the node scaling operation;

[0041] In step S11, multiple empty nodes are scaled down at once, and non-empty nodes are scaled down one at a time to ensure that pod migration does not go wrong.

[0042] See also Figure 2 In actual applications, when there are nodes waiting to be scheduled and the buffer resources are insufficient, call Figure 1 The elastic scaling method shown initiates and schedules a new node.

[0043] Among them, see Figure 1During the expansion process, first, through the pending Pods pre-scheduled in memory, select the appropriate scaling group, call the IaaS expansion interface to expand, then call the PaaS platform interface, and finally, when the pending Pods or remaining resources are less than the resource reservation threshold, register the K8s Node. During the reduction process, first, through the pre-scheduled Pods on the nodes to be reduced in memory, ensure that they can be scheduled successfully, evict the reduced Pods, then call the PaaS platform to delete the nodes, and finally, when the remaining resources exceed the set threshold, delete the K8s Node.

[0044] Specifically, the same cluster can import multiple deployment groups, but the same elastic scaling group can only import one cluster. Determine the node specifications of the elastic scaling according to the scaling group configuration, inject the script into the cloudinit userdata, and call the interface to add nodes.

[0045] Considering the scope of elastic expansion and contraction, it is to automatically expand the capacity within a fixed cluster by judging the traffic, CPU and memory usage. Although this reduces the resource usage of system initialization, the cluster resources cannot be further reduced. If the cluster initialization resources are still very high, the utilization rate will not be significantly improved. This method combines elastic expansion and contraction, and reduces the initialization rate of cluster resources by quickly increasing the resource mode within the cluster. Considering that it takes a long time to generate a node in real time through the IaaS platform, this method introduces the Buff mechanism to give priority to generating several Buff nodes, making the expansion smoother.

[0046] Example 2

[0047] This embodiment provides an electronic device, including: one or more processors and a memory, wherein the memory stores one or more programs, and the one or more programs include instructions for executing the elastic scaling method based on cloud-native dynamic cluster as described in Example 1.

[0048] In a typical configuration, an electronic device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0049] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0050] Example 3

[0051] This embodiment provides a computer-readable storage medium, including one or more programs for execution by one or more processors of an electronic device, wherein the one or more programs include instructions for executing the elastic scaling method based on a cloud-native dynamic cluster as described in Example 1.

[0052] 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 including 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.

[0053] 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.

[0054] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0055] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A method for elastic expansion and contraction based on cloud-native dynamic clusters, characterized in that: The steps include: Step S1, determine whether the current cluster needs to be expanded or reduced. If it needs to be expanded, execute step S2; if it needs to be reduced, execute step S4; if it does not need to be expanded or reduced, repeat this step; Step S2, determining whether there are nodes in the current cluster that meet the expansion conditions, if so, using the nodes in the cluster to achieve expansion, if not, executing step S3; Step S3, when the cluster needs to be expanded, determine whether there is a BUFF node, if so, use the BUFF node to achieve expansion, if not, generate a new computing node and add it to the cluster to achieve expansion; Step S4: After migrating the Pod of the node that needs to be shrunk to other nodes, add it to the list to be shrunk; Step S5, scaling down the nodes in the to-be-shrunk list with empty nodes being prioritized and non-empty nodes being second.

2. According to claim 1, a method for elastic expansion and contraction based on cloud native dynamic clusters is characterized in that: In the step S1, whether the capacity needs to be expanded or reduced is determined based on the CPU usage and the traffic request amount.

3. According to claim 1, a method for elastic expansion and contraction based on cloud native dynamic clusters is characterized in that: In step S5, the process of achieving capacity reduction includes the following steps: Step S501: Add the NoSchedule taint to the target scale-down node and evict non-DaemonSet Pods; Step S502, in response to the completion of Pod eviction, delete the target shrinking node through the Provider interface, clean up the corresponding Machine and Node resources in the cluster, and complete the shrinking.

4. According to claim 1, a method for elastic expansion and contraction based on cloud native dynamic clusters is characterized in that: In the shrinking process of step S5, shrinking is performed on multiple empty nodes at one time, and for non-empty nodes, only one non-empty node is shrunk each time.

5. According to the method of elastic expansion and contraction based on cloud native dynamic clusters according to claim 1, it is characterized in that: In the step S2, a new node is generated by calling the IaaS interface.

6. According to the method of elastic expansion and contraction based on cloud native dynamic clusters according to claim 1, it is characterized in that: When there is at least one empty node in the list to be shrunk, the waiting time of the non-empty nodes is reset; when there is no empty node in the list to be shrunk, the waiting time of the non-empty nodes is started, and when the waiting time exceeds the preset time, the shrinkage of the non-empty nodes is triggered.

7. The elastic expansion and contraction method based on cloud native dynamic cluster according to claim 6 is characterized in that: The preset time is 5-20 minutes.

8. The elastic expansion and contraction method based on cloud native dynamic cluster according to claim 1 is characterized in that: The elastic expansion and contraction method is applied to the PaaS platform.

9. An electronic device, characterized in that: include: One or more processors and a memory, wherein the memory stores one or more programs, and the one or more programs include instructions for executing the elastic scaling method based on a cloud-native dynamic cluster as described in any one of claims 1-8.

10. A computer-readable storage medium, characterized in that: It includes one or more programs for execution by one or more processors of an electronic device, and the one or more programs include instructions for executing the elastic expansion and contraction method based on a cloud-native dynamic cluster as described in any one of claims 1-8.