A method, system, device, and storage medium for flexible stretching

By registering elastic scaling policies and obtaining custom monitoring metrics in the container cloud platform, the problem of inflexible resource adjustment in existing technologies has been solved, achieving stable business operation and cost optimization.

CN113867892BActive Publication Date: 2025-10-31GUANGDONG INSPUR BIG DATA RES CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111137843.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-27
Publication Date
2025-10-31
Estimated Expiration
2041-09-27

AI Technical Summary

Technical Problem

Existing methods for scaling up/down container cloud platforms rely on CPU and memory usage, which cannot accurately and promptly reflect the pressure on business systems, leading to unstable business operations.

Method used

The elastic scaling strategy is registered to the Kubernetes APIServer through a declarative API, custom monitoring metrics are obtained and formatted, and then exposed through the API interface and compared with the set thresholds to control the elastic scaling operation of resources.

Benefits of technology

It enables flexible resource adjustments based on business needs, ensuring smooth business operations and reducing operating costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113867892B_ABST
    Figure CN113867892B_ABST
Patent Text Reader

Abstract

This application discloses an elastic scaling method, system, device, and storage medium applied to a container cloud platform. The method includes: registering a pre-configured elastic scaling policy to a Kubernetes API Server via a declarative API; periodically obtaining custom monitoring metrics for business applications according to the elastic scaling policy and formatting the obtained custom monitoring metrics; exposing the formatted custom monitoring metrics to the outside world via an API aggregation device of the API Server; periodically obtaining the real-time values ​​of the formatted custom monitoring metrics through the API interface, comparing the real-time values ​​with a set threshold, and controlling the elastic scaling operation of corresponding resources based on the comparison result. This supports monitoring custom monitoring metrics for business applications and configuring elastic scaling policies, allowing the number of cloud servers to automatically change with business load, ensuring stable and healthy business operation, and reducing operating costs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of container cloud technology, and in particular to a method, system, device and storage medium for elastic scaling. Background Technology

[0002] With the popularization of cloud computing, cloud-native applications need to have the ability to automatically adjust their business resources through strategies, as well as the advantages of cost savings, improved availability and fault tolerance.

[0003] Currently, most container cloud platforms scale up or down based on memory or CPU resource utilization. However, in real-world business scenarios, CPU and memory usage often fail to accurately or promptly reflect the pressure on the business system, leading to unstable business operations.

[0004] Therefore, how to easily and flexibly expand / shrink container cloud platforms is a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0005] In view of this, the purpose of this invention is to provide a method, system, device, and storage medium for elastic scaling, which can more simply and flexibly adjust corresponding resources automatically to achieve elastic scaling operations and ensure stable and healthy business operation. The specific solution is as follows:

[0006] An elastic scaling method applied to a container cloud platform, the method comprising:

[0007] Register the pre-configured elastic scaling strategy to the k8s APIServer using a declarative API.

[0008] According to the elastic scaling strategy, custom monitoring metrics of business applications are periodically obtained, and the obtained custom monitoring metrics are formatted.

[0009] The formatted custom monitoring metrics are exposed to the outside world via API interfaces through the API aggregation device of ApiServer.

[0010] The system periodically retrieves the real-time values ​​of the formatted custom monitoring metrics via an API interface, compares these real-time values ​​with a set threshold, and controls the elastic scaling of the corresponding resources based on the comparison result.

[0011] Preferably, in the elastic scaling method provided in the embodiments of the present invention, before registering the pre-configured elastic scaling strategy to the k8s APIServer in a declarative API manner, the method further includes:

[0012] When deploying a cloud platform environment or managing other container platforms through a cloud platform, choose to enable the custom monitoring metrics elastic scaling function;

[0013] Based on the business type and corresponding resource requirements, pre-configure elastic scaling strategies that support custom monitoring metrics for business applications.

[0014] Preferably, in the elastic scaling method provided in the embodiments of the present invention, the elastic scaling strategy supports both custom monitoring metrics for business applications and all metrics for cloud monitoring.

[0015] Preferably, in the elastic scaling method provided in the embodiments of the present invention, while periodically obtaining the real-time value of the formatted custom monitoring indicator through the API interface, it further includes:

[0016] Get real-time values ​​of all cloud monitoring metrics on a regular schedule.

[0017] Preferably, in the elastic scaling method provided in the embodiments of the present invention, the step of controlling the elastic scaling operation of the corresponding container resources according to the comparison result includes:

[0018] If the real-time value exceeds the set threshold, it is determined whether the corresponding resources need to be expanded or reduced; if so, the business application is controlled to perform the expansion or reduction operation.

[0019] If the real-time value does not exceed the set threshold, a cooling-off period will begin, waiting for the next polling.

[0020] Preferably, the elastic stretching method provided in the embodiments of the present invention further includes:

[0021] Verify the final number of business applications launched. If the expected value for elastic scaling is not reached, repeat the steps described above to determine whether the corresponding resources need to be expanded or reduced.

[0022] Preferably, in the elastic scaling method provided in the embodiments of the present invention, the elastic scaling strategy can be modified at any time.

[0023] This invention also provides an elastic scaling system applied to a cloud container platform, the system comprising:

[0024] A custom metric configuration device is used to register pre-configured elastic scaling policies with the k8s APIServer via a declarative API.

[0025] A monitoring adaptation device is used to periodically obtain custom monitoring metrics of business applications according to the elastic scaling strategy, and to format the obtained custom monitoring metrics.

[0026] API aggregation device, used to expose the formatted custom monitoring metrics to the outside world via API interface;

[0027] The elastic scaling control device is used to periodically obtain the real-time values ​​of the formatted custom monitoring indicators through the API interface, compare the real-time values ​​with a set threshold, and control the elastic scaling operation of the corresponding resources based on the comparison result.

[0028] This invention also provides an electronic device, including a processor and a memory, wherein the processor executes a computer program stored in the memory to implement the elastic scaling method described above in this invention.

[0029] This invention also provides a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the elastic scaling method described above in this invention.

[0030] As can be seen from the above technical solution, the elastic scaling method provided by the present invention is applied to a container cloud platform. The method includes: registering a pre-configured elastic scaling strategy to the k8s ApiServer in a declarative API manner; periodically obtaining custom monitoring metrics of business applications according to the elastic scaling strategy, and formatting the obtained custom monitoring metrics; exposing the formatted custom monitoring metrics to the outside world through the API aggregation device of the ApiServer via an API interface; periodically obtaining the real-time values ​​of the formatted custom monitoring metrics through the API interface, comparing the real-time values ​​with a set threshold, and controlling the elastic scaling operation of the corresponding resources based on the comparison result.

[0031] The elastic scaling method provided by this invention can more easily and flexibly adjust computing resources automatically according to user business needs and preset strategies. It also supports business applications to customize monitoring indicators and configure elastic scaling strategies. This achieves elastic scaling operations, so that the number of cloud servers automatically increases with the growth of business load and decreases with the decrease of business load, ensuring the stable operation of all business applications running in the container cloud platform and reducing operating costs accordingly.

[0032] Furthermore, the present invention also provides a corresponding system, device, and computer-readable storage medium for the elastic stretching method, further making the above method more practical. The system, device, and computer-readable storage medium have corresponding advantages. Attached Figure Description

[0033] To more clearly illustrate the technical solutions in the embodiments of the present invention or related technologies, the drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0034] Figure 1 A flowchart of the elastic stretching method provided in the embodiments of the present invention;

[0035] Figure 2 This is a schematic diagram of the structure of the elastic telescopic system provided in an embodiment of the present invention;

[0036] Figure 3 This is a schematic diagram illustrating the elastic stretching process of the elastic stretching system provided in an embodiment of the present invention. Detailed Implementation

[0037] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0038] This invention provides an elastic stretching method, such as... Figure 1 As shown, applied to a cloud container platform, this method includes the following steps:

[0039] S101. Register the pre-configured elastic scaling strategy to the k8sApiServer using a declarative API.

[0040] In practical applications, because CPU and memory usage often fail to accurately or promptly reflect the load on the business system in real-world business scenarios, users need to customize monitoring metrics more closely related to the application's needs. Therefore, the scaling up / down mechanism of the cloud container platform in this invention is based on business monitoring metrics, including any custom monitoring metrics defined by the business application. The pre-configured elastic scaling strategy in the above steps can support custom monitoring metrics for business applications. In specific implementations, this elastic scaling strategy can be modified at any time; that is, this invention supports declarative API creation and real-time modification of custom elastic scaling strategies.

[0041] S102. According to the elastic scaling strategy, periodically obtain the custom monitoring metrics of business applications, and format the obtained custom monitoring metrics.

[0042] Specifically, this step can be performed by the monitoring adapter, which periodically obtains custom monitoring metric data exposed by the user's business through the monitoring agent. When it receives a request for elastic scaling policy created and modified by the user, the monitoring adapter will format the metric into a standard Kubernetes metric format.

[0043] S103. Expose the formatted custom monitoring metrics to the outside world via API interface through the API aggregation device of ApiServer.

[0044] S104. Periodically obtain the real-time values ​​of formatted custom monitoring metrics through the API interface, compare the real-time values ​​with the set thresholds, and control the elastic scaling operation of the corresponding resources based on the comparison results.

[0045] Specifically, this step can be performed by the elastic scaling control device, which loads the strategy from the custom metric configuration device and periodically obtains real-time values ​​related to user application metrics through the Kubernetes API.

[0046] It should be noted that this invention combines Kubernetes API aggregation and the Prometheus Operator framework, allowing users to configure elastic scaling strategies through a container cloud platform. This enables business applications to monitor and configure custom metrics to ensure the normal operation of the service system.

[0047] In the elastic scaling method provided in the embodiments of the present invention, computing resources can be automatically adjusted more simply and flexibly according to the user's business needs and preset strategies. It also supports business applications to monitor and configure elastic scaling strategies by customizing monitoring indicators. This achieves elastic scaling operations, so that the number of cloud servers automatically increases with the growth of business load and decreases with the decrease of business load, ensuring the stable and healthy operation of the business and reducing operating costs accordingly.

[0048] Furthermore, in specific implementations, the elastic scaling method provided in this embodiment of the invention supports not only custom monitoring metrics for business applications but also all cloud monitoring metrics (i.e., cloud-native metrics). This allows for the customization of different elastic scaling strategies based on different business systems, ensuring the normal operation of service systems and further reducing operating costs. The cloud monitoring metrics here include conventional metrics such as CPU, memory, and network. In other words, through a declarative API, flexible elastic scaling strategies can be pre-configured based on the business type and corresponding resource requirements. These elastic scaling strategies support application-defined metrics as well as conventional metrics such as CPU, storage, and network.

[0049] In practical implementation, while performing step S104 to periodically obtain the real-time values ​​of formatted custom monitoring metrics via the API interface, the process can also include periodically obtaining the real-time values ​​of all cloud monitoring metrics. These real-time values ​​can then be compared with corresponding set thresholds, and the elastic scaling of the relevant resources can be controlled based on the comparison results.

[0050] Furthermore, in specific implementation, in the above-mentioned elastic scaling method provided in the embodiments of the present invention, before executing step S101 to register the pre-configured elastic scaling strategy to k8sApiServer in the manner of declarative API, it may also include: when deploying a cloud platform environment or managing other container platforms through the cloud platform, selecting to start the custom monitoring indicator elastic scaling function; and pre-configuring the elastic scaling strategy according to the business type and corresponding resource requirements.

[0051] This allows users to enable or disable application elastic scaling when creating or modifying business applications through the cloud platform, and to configure elastic scaling strategies based on CPU, memory, and other custom metrics. After a user submits an application creation request with an elastic scaling strategy configuration, the elastic scaling strategy is saved to the custom metric configuration device for the elastic scaling control device to access and read.

[0052] It should be noted that when users enable the custom monitoring metric elastic scaling function through the container cloud platform, the container cloud platform deploys the necessary runtime environment and corresponding components for the custom monitoring, including: a custom metric configuration device, an API aggregation device, a monitoring adapter, and an elastic scaling control device. After the environment deployment is complete, users can configure flexible custom monitoring metric elastic scaling strategies. Specifically, the monitoring adapter formats monitoring metrics other than CPU and memory, including custom monitoring metrics; the API aggregation device exposes API interfaces externally, meaning it exposes the formatted custom metrics through the Kubernetes standard API for other services to call. The elastic scaling control device periodically checks the real-time values ​​of relevant metrics, including monitoring API data, through the Kubernetes API server interface based on the user-configured custom monitoring metrics, thereby determining whether to scale up / down the corresponding resources. If the real-time value exceeds the configured threshold, the corresponding elastic scaling operation is performed.

[0053] In specific implementation, in the above-mentioned elastic scaling method provided in the embodiments of the present invention, step S104 controls the elastic scaling operation of the corresponding container resources according to the comparison result, which may specifically include: if the real-time value exceeds the set threshold, it is determined whether the corresponding resources need to be expanded or reduced; if so, the business application is controlled to perform expansion or reduction operation; if the real-time value does not exceed the set threshold, it enters the cooling period and waits for the next polling.

[0054] In specific implementation, the above-mentioned elastic scaling method provided in the embodiments of the present invention may further include: verifying the final number of business applications launched; if the expected value of elastic scaling is not reached, then repeatedly determining whether the corresponding resources need to be expanded or reduced.

[0055] It is important to note that this invention is based on the native elastic scaling framework of Kubernetes, which can be extended to support all collectable native metrics, and even custom metrics defined by business applications. This enables the determination of real-time usage of container resources such as CPU, memory, and custom metrics under high traffic conditions. For those exceeding the normal set threshold, automatic scaling up is performed to transfer the business load to the scaled-up container and reduce container pressure. When the traffic decreases, automatic scaling down is performed, thereby reducing business operating costs.

[0056] Based on the same inventive concept, this invention also provides an elastic stretching system. Since the principle of this system in solving the problem is similar to that of the aforementioned elastic stretching method, the implementation of this system can refer to the implementation of the elastic stretching method, and the repeated parts will not be described again.

[0057] In practical implementation, the elastic scaling system provided in this embodiment of the invention is applied to a cloud container platform, such as... Figure 2 and Figure 3 As shown, the system specifically includes:

[0058] Custom metric configuration device 11 is used to register pre-configured elastic scaling strategies to the k8s APIServer in a declarative API manner;

[0059] The monitoring adapter 12 is used to periodically obtain custom monitoring metrics of business applications according to the elastic scaling strategy, and to format the obtained custom monitoring metrics.

[0060] API aggregation device 13 is used to expose formatted custom monitoring metrics to the outside world via API interfaces.

[0061] The elastic scaling control device 14 is used to periodically obtain the real-time values ​​of formatted custom monitoring indicators through the API interface, compare the real-time values ​​with the set thresholds, and control the elastic scaling operation of the corresponding resources based on the comparison results.

[0062] In the elastic scaling system provided in the embodiments of the present invention, the interaction of the above four devices can more simply and flexibly adjust computing resources automatically according to the user's business needs and preset strategies. It also supports business applications to monitor and configure elastic scaling strategies by customizing monitoring indicators. This achieves elastic scaling operation, so that the number of cloud servers automatically increases with the growth of business load and decreases with the decrease of business load, ensuring the stable and healthy operation of the business and reducing operating costs accordingly.

[0063] For more detailed information on the operation of the aforementioned devices, please refer to the relevant content disclosed in the foregoing embodiments, which will not be repeated here.

[0064] Accordingly, embodiments of the present invention also disclose an electronic device, including a processor and a memory; wherein, when the processor executes a computer program stored in the memory, it implements the elastic scaling method disclosed in the foregoing embodiments.

[0065] For more detailed information on the above methods, please refer to the relevant content disclosed in the foregoing embodiments, which will not be repeated here.

[0066] Furthermore, the present invention also discloses a computer-readable storage medium for storing a computer program; when the computer program is executed by a processor, it implements the aforementioned elastic scaling method.

[0067] For more detailed information on the above methods, please refer to the relevant content disclosed in the foregoing embodiments, which will not be repeated here.

[0068] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the systems, devices, and storage media disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple; relevant parts can be referred to the method section.

[0069] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0070] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0071] In summary, the elastic scaling method provided by this invention, applied to a container cloud platform, includes: registering a pre-configured elastic scaling strategy to the k8sApiServer via a declarative API; periodically acquiring custom monitoring metrics of business applications according to the elastic scaling strategy, and formatting the acquired custom monitoring metrics; exposing the formatted custom monitoring metrics to the outside world via the API aggregation device of the ApiServer; periodically acquiring the real-time values ​​of the formatted custom monitoring metrics through the API interface, comparing the real-time values ​​with a set threshold, and controlling the elastic scaling operation of the corresponding resources based on the comparison result. This method can more simply and flexibly automatically adjust computing resources according to user business needs and preset strategies, and supports monitoring and configuring elastic scaling strategies for custom monitoring metrics of business applications. This enables elastic scaling operations, allowing the number of cloud servers to automatically increase with business load and decrease with business load, ensuring stable and healthy business operation and correspondingly reducing operating costs. Furthermore, this invention also provides a corresponding system, device, and computer-readable storage medium for the elastic scaling method, further enhancing the practicality of the method. This system, device, and computer-readable storage medium have corresponding advantages.

[0072] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0073] The above provides a detailed description of the elastic stretching method, system, device, and storage medium provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A method for elastic stretching, characterized in that, Applied to a container cloud platform, the method includes: When deploying a cloud platform environment or managing other container platforms through a cloud platform, select to enable the custom monitoring metrics elastic scaling function; Based on the business type and corresponding resource requirements, pre-configure elastic scaling strategies to support custom monitoring metrics for business applications. The pre-configured elastic scaling policy is registered to the Kubernetes API Server via a declarative API; the elastic scaling policy supports custom monitoring metrics for business applications; the elastic scaling policy can be modified at any time. According to the elastic scaling strategy, custom monitoring metrics of business applications are periodically obtained, and the obtained custom monitoring metrics are formatted to format them into the k8s metric format. The formatted custom monitoring metrics are exposed to the outside world via API interfaces through the API aggregation device of ApiServer. The system periodically retrieves the real-time values ​​of the formatted custom monitoring metrics via an API interface, compares these real-time values ​​with a set threshold, and controls the elastic scaling of corresponding resources based on the comparison result. If the real-time value does not exceed the set threshold, the system enters a cooling-off period, waiting for the next polling.

2. The elastic stretching method according to claim 1, characterized in that, The elastic scaling strategy supports custom monitoring metrics for business applications, as well as all metrics for cloud monitoring.

3. The elastic stretching method according to claim 2, characterized in that, In addition to periodically obtaining the formatted real-time values ​​of the custom monitoring metrics via the API interface, the method also includes: Get real-time values ​​of all cloud monitoring metrics on a regular schedule.

4. The elastic stretching method according to claim 3, characterized in that, The elastic scaling operation of the corresponding container resources based on the comparison result includes: If the real-time value exceeds the set threshold, it is determined whether the corresponding resources need to be expanded or reduced; if so, the business application is controlled to perform the expansion or reduction operation.

5. The elastic stretching method according to claim 4, characterized in that, Also includes: Verify the final number of business applications launched. If the expected value for elastic scaling is not reached, repeat the steps described above to determine whether the corresponding resources need to be expanded or reduced.

6. A flexible telescopic system, characterized in that, The system, applied to a cloud container platform, includes: A custom metric configuration device is used to select and enable the custom monitoring metric elastic scaling function when deploying a cloud platform environment or managing other container platforms through the cloud platform. Based on the business type and corresponding resource requirements, it pre-configures elastic scaling policies that support custom monitoring metrics for business applications. The pre-configured elastic scaling policies are registered to the k8s APIServer via a declarative API. These elastic scaling policies support custom monitoring metrics for business applications and can be modified at any time. The monitoring adaptation device is used to periodically obtain custom monitoring metrics of business applications according to the elastic scaling strategy, and to format the obtained custom monitoring metrics into the format of Kubernetes metrics. The API aggregation device is used to expose the formatted custom monitoring metrics to external API interfaces. The elastic scaling control device is used to periodically obtain the real-time values ​​of the formatted custom monitoring indicators through the API interface, compare the real-time values ​​with a set threshold, and control the elastic scaling operation of the corresponding resources based on the comparison result; if the real-time value does not exceed the set threshold, it enters a cooling-off period and waits for the next polling.

7. An electronic device, characterized in that, It includes a processor and a memory, wherein the processor implements the elastic scaling method as described in any one of claims 1 to 5 when executing a computer program stored in the memory.

8. A computer-readable storage medium, characterized in that, Used to store a computer program, wherein the computer program, when executed by a processor, implements the elastic scaling method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • API Gateway automatic scaling method and device

    CN109067862A