A cloud-native service zero-scaling method and system

By integrating monitoring, machine learning and Kubernetes controllers in a cloud-native environment, precise zeroing and dynamic expansion of service resources are achieved, the problem of insufficient resource utilization in the existing technology is solved, and the high availability and cost efficiency of the system are improved.

CN118819742BActive Publication Date: 2025-05-02SHANDONG INSPUR SCI RES INST CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411303211.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-19
Publication Date
2025-05-02
Estimated Expiration
2044-09-19

AI Technical Summary

Technical Problem

Existing cloud-native automatic scaling methods are difficult to cope with complex and changeable business loads, especially in the absence of precise release of resources during low load or idle periods, resulting in waste of resources and increased costs.

Method used

Through monitoring components, collect resource indicators and custom business indicators, use machine learning algorithms to train load prediction models, and combine with Kubernetes controllers to dynamically adjust the number of service instances to achieve accurate zeroing and dynamic expansion of service resources.

Benefits of technology

It achieves the maximum utilization of resources while ensuring service quality, avoids resource waste and unnecessary cost expenditures, and improves the high availability and response speed of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118819742B_ABST
    Figure CN118819742B_ABST
Patent Text Reader

Abstract

The present invention discloses a cloud-native-based service zeroing and scaling method and system, which belongs to the field of cloud computing and cloud-native technology. The method collects resource indicators through monitoring components, integrates custom business indicators, collects data to the monitoring data collection program service for unified processing, and performs persistent storage; collects stored historical data, uses machine learning algorithms to train historical data, deploys the trained model to the k8s cluster, and regularly updates the model to reflect the latest load conditions; predicts the system load in the future time period, and outputs the prediction results for use by the zeroing and scaling controller; the zeroing and scaling controller is used to monitor the system load and prediction data, and dynamically adjusts the number of service instances according to the strategy; combined with the service grid, realizes advanced traffic management and security policy configuration between microservices. The present invention realizes accurate zeroing and dynamic expansion of service resources, and maximizes the utilization of resources while ensuring service quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of cloud computing and cloud native technology, and in particular to a cloud native-based service zero scaling method and system. Background Art

[0002] With the rapid development of cloud computing technology, cloud-native architecture has attracted widespread attention due to its efficient resource utilization and flexible scalability. However, most existing cloud-native automatic scaling methods rely on preset rules or simple threshold judgments, which are difficult to cope with complex and changing business loads. Especially during low load or idle periods, these methods often fail to accurately release resources, resulting in resource waste and increased costs. Therefore, a more intelligent service zero-scaling method is needed to maximize resource utilization while ensuring service quality. Summary of the invention

[0003] The technical task of the present invention is to address the above shortcomings and provide a cloud-native based service zeroing and scaling method and system, which can realize the precise zeroing and dynamic expansion of service resources, while ensuring the service quality and maximizing the utilization of resources.

[0004] The technical solution adopted by the present invention to solve its technical problem is:

[0005] A cloud-native-based service zero-scaling method, the implementation of which includes:

[0006] Collect resource indicators, including CPU and memory, through monitoring components, and integrate custom business indicators (such as QPS). Collect data to the monitoring data collection program service for unified processing and persistent storage.

[0007] Collect and store historical data, use machine learning algorithms to train historical data, deploy the trained model to the k8s cluster, and regularly update the model to reflect the latest load conditions; predict the system load in the future time period, and output the prediction results for use by the zero scaling controller;

[0008] The zero scaling controller is a Kubernetes controller that monitors system load and forecast data and dynamically adjusts the number of service instances according to policies. The controller listens to the data source of the monitoring system and makes decisions based on real-time load and forecast results: During low-load or idle periods, the controller automatically reduces useless service instances to a minimum (zero) or stops them completely through the Kubernetes API; when the load increases, the controller automatically expands service instances based on load forecasts to ensure service quality.

[0009] Combined with service mesh, advanced traffic management and security policy configuration between microservices can be achieved.

[0010] This method combines the cloud-native Horizontal Pod Autoscaler (HPA) function, the zero-scaling controller component, the machine learning prediction component, and the monitoring component to complete the automatic scaling service, achieving precise zeroing and dynamic expansion of service resources.

[0011] Furthermore, the specific implementation steps of this method are as follows:

[0012] S1. Prepare the basic environment for cloud-native applications and deploy a highly available Kubernetes cluster.

[0013] S2. Split the monolithic application into multiple microservices that can be scaled independently;

[0014] S3. Configure monitoring services and customize indicator monitoring;

[0015] S4, collect historical data and build a load forecasting model;

[0016] S5. Create a zero scaling controller;

[0017] S6. Configure traffic inlet and deploy service mesh.

[0018] Kubernetes clusters can use Kubernetes services provided by cloud service providers (such as Alibaba Cloud and Tencent Cloud), or you can build them yourself;

[0019] Furthermore, the step S2 is specifically implemented as follows:

[0020] Analyze existing applications, determine their functional modules and corresponding microservice divisions; write Docker images for each microservice and deploy them to the Kubernetes cluster.

[0021] Furthermore, the step S3 is specifically implemented as follows:

[0022] S3.1. Install helm in Kubernetes, add the Prometheus repository, and use helm to install the Prometheus service. By default, Prometheus will collect basic resource indicators such as CPU and memory.

[0023] S3.2. Create a microservice for collecting custom indicators. You can use Java programs to operate it. First, introduce the client dependency of Prometheus. Then define custom indicators (such as requests per second and queue length) in the code, build a docker image with the code program, create a k8s Deployment to reference this docker image, and deploy the image to the cluster. At the same time, create a Service to expose the deployment for external applications to access. Finally, use the Prometheus Scraping configuration to crawl custom indicators from the application. You can set it to crawl every 10 seconds to collect custom indicators.

[0024] S3.3. Develop a custom monitoring data collection program and deploy it in the Kubernetes cluster to collect monitoring data in real time. Like the microservice for custom indicator collection, first write code to periodically obtain various indicators from the Prometheus system and then store them in the database. Then build the code program into a docker image, use K8S deployment to reference this image and deploy it to the cluster. At the same time, create a Service to expose the deployment for external applications to access.

[0025] Furthermore, the step S4 is specifically implemented as follows:

[0026] S4.1, collect the persistent data collected by the monitoring service in step S3, perform data normalization and feature processing on the collected data, and then use the data set for model training and tuning;

[0027] S4.2. After training the model, build it and the corresponding dependencies into a docker image, copy the model file in the dockerfile, install the necessary python libraries, etc.; then use k8s deployment to reference the built docker image to build a pod; at the same time, create a Kubernetes Service object and expose the Deployment for access by external or internal applications.

[0028] Furthermore, the step S5 is specifically implemented as follows:

[0029] S5.1. Use Operator to initialize a project, define a custom resource to represent the load and forecast data to be monitored, define the CRD of laodscalers.example.com in the config / crd folder, including the configuration of the maximum number of instances, the minimum number of instances, and the CPU threshold for instance scaling, and then use the kubectl command to deploy the CRD in the cluster.

[0030] S5.2. Use the Operator SDK to create a controller. Use the operator-sdk create command to generate a basic operator framework, including basic code and files, for monitoring and managing custom Kubernetes resources. Then implement the Reconcile function, write the controller logic, obtain the loadScaler instance, deployment, obtain monitoring indicators, and obtain the results of the model inference service through the API, and calculate the expected number of replicas based on the specific values ​​obtained. Finally, update the number of replicas of the deployment through the API call.

[0031] S5.3. Build the controller code into a docker image, then compile the k8s deployment and service yaml files, and use the built controller image to deploy it to the k8s cluster.

[0032] Furthermore, the step S6 is specifically implemented as follows:

[0033] To install and deploy the istio service grid, first download the istio CLI tool, install it using the istio default configuration, edit the yaml file of VirtualService, deploy VirtualService to manage traffic between microservices, and set traffic routing policies.

[0034] The present invention also claims a cloud-native-based service zero-scaling system, comprising:

[0035] The data collection and custom monitoring indicator module is used to collect resource indicators such as CPU and memory through monitoring components, integrate custom business indicators (such as QPS), collect data to the monitoring data collection program service for unified processing, and perform persistent storage;

[0036] The machine learning prediction module is used to collect and store historical data, use machine learning algorithms to train historical data, deploy the trained model to the k8s cluster, and regularly update the model to reflect the latest load conditions; predict the system load in the future time period, and output the prediction results for use by the zero scaling controller;

[0037] Zero scaling controller, write a Kubernetes controller to monitor system load and forecast data, and dynamically adjust the number of service instances according to the policy; the controller listens to the data source of the monitoring system and makes decisions based on the real-time load and forecast results: during low load or idle periods, the controller automatically reduces useless service instances to the minimum (zero) or stops them completely through the Kubernetes API; when the load increases, the controller automatically expands the service instances according to the load forecast to ensure service quality;

[0038] Configure the traffic entry module to combine with the service grid to achieve advanced traffic management and security policy configuration between microservices;

[0039] The system achieves service zero scaling through the above-mentioned cloud-native-based service zero scaling method.

[0040] The present invention also claims a cloud-native-based service zero-scaling device, comprising: at least one memory and at least one processor;

[0041] The at least one memory is used to store a machine-readable program;

[0042] The at least one processor is used to call the machine-readable program to implement the above method.

[0043] The present invention also claims protection for a computer-readable medium having computer instructions stored thereon, which implement the above method when executed by a processor.

[0044] Compared with the prior art, the cloud-native-based service zero-scaling method and system of the present invention has the following beneficial effects:

[0045] The present invention realizes accurate scheduling and dynamic adjustment of resources by combining machine learning prediction and cloud native services, greatly improving the high availability and response speed of the system. During low-load or idle periods, service instances can be intelligently reduced to a minimum or stopped completely, avoiding waste of resources and unnecessary cost expenditures. Secondly, through the introduction of custom monitoring indicators, the invention can more comprehensively reflect the actual business load situation and improve the accuracy and efficiency of automatic scaling. The application of machine learning algorithms further enhances the system's ability to predict future loads, making resource allocation more intelligent and forward-looking.

[0046] From the perspective of application value, this cloud-native service zero-scaling method can be widely used in various scenarios that require dynamic resource management, such as Internet applications, e-commerce platforms, big data processing, Internet of Things (IoT) systems, etc. These scenarios usually have unstable loads and highly volatile user access patterns, so a method that can efficiently and intelligently adjust resources is needed to cope with sudden traffic peaks and idle periods. In addition, the invention can also significantly reduce the cost of using cloud computing resources, while improving resource utilization and service quality, enabling enterprises to provide more stable and reliable services at a lower cost. Overall, this invention provides an innovative solution for the management and optimization of cloud computing resources, with broad market potential and application prospects. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 The present invention is a flowchart of a cloud-native service zero scaling process provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0048] The present invention will be further described below in conjunction with specific embodiments.

[0049] An embodiment of the present invention provides a cloud-native-based service zero-scaling method, the implementation of which includes:

[0050] Data collection and custom monitoring indicators: Collect resource indicators such as CPU and memory through monitoring components, and integrate custom business indicators (such as QPS). Collect this data into the monitoring data collection program service for unified processing and persistent storage.

[0051] Implement machine learning prediction: collect and store historical data, use appropriate machine learning algorithms to train historical data, deploy the trained model to the k8s cluster, and regularly update the model to reflect the latest load conditions; predict the system load for a period of time in the future, and output the prediction results for use by the zero scaling controller.

[0052] The zero-scaling controller: write a Kubernetes controller to monitor system load and forecast data, and dynamically adjust the number of service instances according to the policy; the controller listens to the data source of the monitoring system and makes decisions based on the real-time load and forecast results: during low-load or idle periods, the controller automatically reduces useless service instances to the minimum (zero) or stops them completely through the Kubernetes API; when the load increases, the controller automatically expands the service instances based on the load forecast to ensure service quality.

[0053] Configure traffic inlet: Combined with service mesh, implement advanced traffic management and security policy configuration between microservices.

[0054] This method combines the cloud-native Horizontal Pod Autoscaler (HPA) function, the zero-scaling controller component, the machine learning prediction component, and the monitoring component to complete the automatic scaling service, achieving precise zeroing and dynamic expansion of service resources.

[0055] The specific implementation steps of this method are as follows:

[0056] S1. Prepare the basic environment for cloud-native applications.

[0057] To deploy a highly available Kubernetes cluster, you can use the Kubernetes service provided by a cloud service provider (such as Alibaba Cloud and Tencent Cloud), or you can build it yourself.

[0058] S2. Split the monolithic application into multiple microservices that can be scaled independently.

[0059] Analyze existing applications, determine their functional modules and corresponding microservice divisions; write Docker images for each microservice and deploy them to the Kubernetes cluster.

[0060] S3. Configure monitoring services and customize indicator monitoring.

[0061] S3.1. Install helm in Kubernetes, add the Prometheus repository, and use helm to install the Prometheus service. By default, Prometheus will collect basic resource indicators such as CPU and memory.

[0062] S3.2. Create a microservice for collecting custom indicators. This time, a Java program is used. First, introduce the client dependency of Prometheus; then define custom indicators (such as requests per second and queue length) in the code; then build a docker image with the code program, create a k8s Deployment to reference this docker image, and deploy the image to the cluster; at the same time, create a Service to expose the deployment for external applications to access; finally, use the Prometheus Scraping configuration to crawl custom indicators from the application, set it to crawl every 10 seconds, and thus collect custom indicators.

[0063] S3.3. Develop a custom monitoring data collection program and deploy it in the Kubernetes cluster to collect monitoring data in real time. As with the microservice for custom indicator collection, first write code to periodically obtain various indicators from the Prometheus system and then store them in the database. Then build the code program into a docker image, use K8S deployment to reference this image and deploy it to the cluster. At the same time, create a Service to expose the deployment for external applications to access.

[0064] S4. Collect historical data and build a load prediction model.

[0065] S4.1. Collect the persistent data collected by the monitoring service in step S3, perform data normalization and feature processing on the collected data, and then use the data set for model training and tuning.

[0066] S4.2. After training the model, build it and the corresponding dependencies into a docker image, copy the model file in the dockerfile, install the necessary python libraries, etc. Then use k8s deployment to reference the built docker image to build a pod; at the same time, create a Kubernetes Service object and expose the Deployment for external or internal application access.

[0067] S5. Create a zero scaling controller.

[0068] S5.1. Use Operator to initialize a project, define a custom resource to represent the load and forecast data to be monitored, define the CRD of laodscalers.example.com in the config / crd folder, including the configuration of the maximum number of instances, the minimum number of instances, and the CPU threshold for instance scaling, and then use the kubectl command to deploy the CRD in the cluster.

[0069] S5.2. Use the Operator SDK to create a controller. Use the operator-sdk create command to generate a basic operator framework, including basic code and files, for monitoring and managing custom Kubernetes resources. Then implement the Reconcile function, write the controller logic, obtain the loadScaler instance, deployment, obtain monitoring indicators, and obtain the results of the model inference service through the API, and calculate the expected number of replicas based on the specific values ​​obtained. Finally, update the number of replicas of the deployment through the API call.

[0070] S5.3. Build the controller code into a docker image, then compile the k8s deployment and service yaml files, and use the built controller image to deploy it to the k8s cluster.

[0071] S6. Configure traffic inlet and deploy service mesh.

[0072] To install and deploy the istio service grid, first download the istio CLI tool, install it using the istio default configuration, edit the yaml file of VirtualService, deploy VirtualService to manage traffic between microservices, and set traffic routing policies.

[0073] This method dynamically adjusts cloud resources in an efficient and intelligent manner to achieve high availability of services, cost optimization, and efficient resource utilization.

[0074] The embodiment of the present invention further provides a cloud-native-based service zero-scaling system, including:

[0075] The data collection and custom monitoring indicator module is used to collect resource indicators such as CPU and memory through monitoring components, and integrate custom business indicators (such as QPS), collect these data to the monitoring data collection program service for unified processing, and perform persistent storage;

[0076] The machine learning prediction module is used to collect and store historical data, use appropriate machine learning algorithms to train the historical data, deploy the trained model to the k8s cluster, and regularly update the model to reflect the latest load conditions; predict the system load for a period of time in the future, and output the prediction results for use by the zero scaling controller;

[0077] Zero scaling controller: Write a Kubernetes controller to monitor system load and forecast data, and dynamically adjust the number of service instances according to the policy. The controller listens to the data source of the monitoring system and makes decisions based on the real-time load and forecast results: During low-load or idle periods, the controller automatically reduces useless service instances to the minimum (zero) or stops them completely through the Kubernetes API. When the load increases, the controller automatically expands the service instances according to the load forecast to ensure service quality.

[0078] Configure the traffic inlet module to combine with the service grid to achieve advanced traffic management and security policy configuration between microservices.

[0079] The system implements service zero scaling through the cloud-native-based service zero scaling method described in the above embodiment. The specific implementation is as follows:

[0080] S1. Prepare the basic environment for cloud-native applications.

[0081] To deploy a highly available Kubernetes cluster, you can use the Kubernetes service provided by a cloud service provider (such as Alibaba Cloud and Tencent Cloud), or you can build it yourself.

[0082] S2. Split the monolithic application into multiple microservices that can be scaled independently.

[0083] Analyze existing applications, determine their functional modules and corresponding microservice divisions; write Docker images for each microservice and deploy them to the Kubernetes cluster.

[0084] S3. Configure monitoring services and customize indicator monitoring.

[0085] S3.1. Install helm in Kubernetes, add the Prometheus repository, and use helm to install the Prometheus service. By default, Prometheus will collect basic resource indicators such as CPU and memory.

[0086] S3.2. Create a microservice for collecting custom indicators. This time, a Java program is used. First, introduce the client dependency of Prometheus; then define custom indicators (such as requests per second and queue length) in the code; then build a docker image with the code program, create a k8s Deployment to reference this docker image, and deploy the image to the cluster; at the same time, create a Service to expose the deployment for external applications to access; finally, use the Prometheus Scraping configuration to crawl custom indicators from the application, set it to crawl every 10 seconds, and thus collect custom indicators.

[0087] S3.3. Develop a custom monitoring data collection program and deploy it in the Kubernetes cluster to collect monitoring data in real time. As with the microservice for custom indicator collection, first write code to periodically obtain various indicators from the Prometheus system and then store them in the database. Then build the code program into a docker image, use K8S deployment to reference this image and deploy it to the cluster. At the same time, create a Service to expose the deployment for external applications to access.

[0088] S4. Collect historical data and build a load prediction model.

[0089] S4.1. Collect the persistent data collected by the monitoring service in step S3, perform data normalization and feature processing on the collected data, and then use the data set for model training and tuning.

[0090] S4.2. After training the model, build it and the corresponding dependencies into a docker image, copy the model file in the dockerfile, install the necessary python libraries, etc. Then use k8s deployment to reference the built docker image to build a pod; at the same time, create a Kubernetes Service object and expose the Deployment for external or internal application access.

[0091] S5. Create a zero scaling controller.

[0092] S5.1. Use Operator to initialize a project, define a custom resource to represent the load and forecast data to be monitored, define the CRD of laodscalers.example.com in the config / crd folder, including the configuration of the maximum number of instances, the minimum number of instances, and the CPU threshold for instance scaling, and then use the kubectl command to deploy the CRD in the cluster.

[0093] S5.2. Use the Operator SDK to create a controller. Use the operator-sdk create command to generate a basic operator framework, including basic code and files, for monitoring and managing custom Kubernetes resources. Then implement the Reconcile function, write the controller logic, obtain the loadScaler instance, deployment, obtain monitoring indicators, and obtain the results of the model inference service through the API, and calculate the expected number of replicas based on the specific values ​​obtained. Finally, update the number of replicas of the deployment through the API call.

[0094] S5.3. Build the controller code into a docker image, then compile the k8s deployment and service yaml files, and use the built controller image to deploy it to the k8s cluster.

[0095] S6. Configure traffic inlet and deploy service mesh.

[0096] To install and deploy the istio service grid, first download the istio CLI tool, install it using the istio default configuration, edit the yaml file of VirtualService, deploy VirtualService to manage traffic between microservices, and set traffic routing policies.

[0097] An embodiment of the present invention further provides a cloud-native-based service zero-scaling device, comprising: at least one memory and at least one processor;

[0098] The at least one memory is used to store a machine-readable program;

[0099] The at least one processor is used to call the machine-readable program to implement the cloud-native-based service zero scaling method described in the above embodiment.

[0100] The embodiment of the present invention also provides a computer-readable medium, on which computer instructions are stored, and when the computer instructions are executed by a processor, the processor executes the cloud-native-based service zero scaling method described in the above embodiment. Specifically, a system or device equipped with a storage medium can be provided, on which software program codes for implementing the functions of any of the above embodiments are stored, and a computer (or CPU or MPU) of the system or device reads and executes the program code stored in the storage medium.

[0101] In this case, the program code itself read from the storage medium can realize the function of any one of the above-mentioned embodiments, and thus the program code and the storage medium storing the program code constitute a part of the present invention.

[0102] The storage medium embodiments for providing the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disk (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), a magnetic tape, a non-volatile memory card, and a ROM. Alternatively, the program code can be downloaded from a server computer via a communication network.

[0103] In addition, it should be clear that the functions of any of the above embodiments can be implemented not only by executing the program code read by the computer, but also by enabling an operating system operating on the computer to complete part or all of the actual operations based on instructions from the program code.

[0104] In addition, it can be understood that the program code read from the storage medium is written to a memory provided in an expansion board inserted into the computer or written to a memory provided in an expansion unit connected to the computer, and then based on the instructions of the program code, a CPU installed on the expansion board or the expansion unit is enabled to perform part or all of the actual operations, thereby realizing the functions of any of the above-mentioned embodiments.

[0105] The present invention is shown and described in detail above through the accompanying drawings and preferred embodiments. However, the present invention is not limited to these disclosed embodiments. Based on the above multiple embodiments, those skilled in the art can know that the code review methods in the above different embodiments can be combined to obtain more embodiments of the present invention, and these embodiments are also within the protection scope of the present invention.

Claims

1. A cloud-native service zero-scaling method, characterized in that: The implementation of this method includes: Collect resource indicators through monitoring components, integrate custom business indicators, collect data to the monitoring data collection program service for unified processing, and perform persistent storage; Collect and store historical data, use machine learning algorithms to train historical data, deploy the trained model to the k8s cluster, and regularly update the model to reflect the latest load conditions; predict the system load in the future time period, and output the prediction results for use by the zero scaling controller; The zero-scaling controller is a Kubernetes controller that monitors system load and forecast data and dynamically adjusts the number of service instances according to policies. The controller listens to the data source of the monitoring system and makes decisions based on real-time load and forecast results: During low-load or idle periods, the controller automatically reduces useless service instances to a minimum or stops them completely through the Kubernetes API; when the load increases, the controller automatically expands service instances based on load forecasts. Combined with service mesh, advanced traffic management and security policy configuration between microservices can be achieved; The specific implementation steps of this method are as follows: S1. Prepare the basic environment for cloud-native applications and deploy a highly available Kubernetes cluster. S2. Split the monolithic application into multiple microservices that can be scaled independently; S3. Configure monitoring services and customize indicator monitoring; S4, collect historical data and build a load forecasting model; S5. Create a zero scaling controller; S6. Configure traffic inlet and deploy service grid. The step S3 is specifically implemented as follows: S3.

1. Install helm in Kubernetes, add the Prometheus repository, and use helm to install the Prometheus service. S3.

2. Create a microservice for collecting custom metrics. First, introduce the client dependency of Prometheus. Then define the custom metrics in the code, build a docker image for the code program, create a k8s Deployment to reference the docker image, and deploy the image to the cluster. At the same time, create a Service to expose the deployment for external applications to access. Finally, use the Prometheus Scraping configuration to crawl custom metrics from the application to collect custom metrics. S3.

3. Develop a custom monitoring data collection program and deploy it in the Kubernetes cluster to collect monitoring data in real time. First, write code to periodically obtain various indicators from the Prometheus system and store them in the database. Then build the code program into a Docker image, use K8S deployment to reference this image and deploy it to the cluster. At the same time, create a Service to expose the deployment for external applications to access. The step S5 is specifically implemented as follows: S5.

1. Use Operator to initialize a project, define a custom resource to represent the load and forecast data to be monitored, define the CRD of laodscalers.example.com in the config / crd folder, including the configuration of the maximum number of instances, the minimum number of instances, and the CPU threshold for instance scaling, and then use the kubectl command to deploy the CRD in the cluster. S5.

2. Use the Operator SDK to create a controller. Use the operator-sdk create command to generate a basic operator framework, including basic code and files, for monitoring and managing custom Kubernetes resources. Then implement the Reconcile function, write the controller logic, obtain the loadScaler instance, deployment, obtain monitoring indicators, and obtain the results of the model inference service through the API, and calculate the expected number of replicas based on the specific values ​​obtained. Finally, update the number of replicas of the deployment through the API call. S5.

3. Build the controller code into a docker image, then compile the k8s deployment and service yaml files, and use the built controller image to deploy it to the k8s cluster.

2. The cloud-native service zero-scaling method according to claim 1, characterized in that: The step S2 is specifically implemented as follows: Analyze existing applications, determine their functional modules and corresponding microservice divisions; write Docker images for each microservice and deploy them to the Kubernetes cluster.

3. The cloud-native-based service zero-scaling method according to claim 1, characterized in that: The step S4 is specifically implemented as follows: S4.1, collect the persistent data collected by the monitoring service in step S3, perform data normalization and feature processing on the collected data, and then use the data set for model training and tuning; S4.

2. After training the model, build it and the corresponding dependencies into a docker image, copy the model file in the dockerfile, and install the necessary python libraries; then use k8s deployment to reference the built docker image to build a pod; at the same time, create a Kubernetes Service object and expose the Deployment for access by external or internal applications.

4. The cloud-native-based service zero-scaling method according to claim 1, characterized in that: The step S6 is specifically implemented as follows: To install and deploy the istio service grid, first download the istio CLI tool, install it using the istio default configuration, edit the yaml file of VirtualService, deploy VirtualService to manage traffic between microservices, and set traffic routing policies.

5. A cloud-native service zero-scaling system, characterized in that: include: The data collection and custom monitoring indicator module is used to collect resource indicators through monitoring components, integrate custom business indicators, collect data to the monitoring data collection program service for unified processing, and store it persistently; The machine learning prediction module is used to collect and store historical data, use machine learning algorithms to train historical data, deploy the trained model to the k8s cluster, and regularly update the model to reflect the latest load conditions; predict the system load in the future time period, and output the prediction results for use by the zero scaling controller; Zero scaling controller, write a Kubernetes controller to monitor system load and forecast data, and dynamically adjust the number of service instances according to the policy; the controller listens to the data source of the monitoring system and makes decisions based on the real-time load and forecast results: during low load or idle periods, the controller automatically reduces useless service instances to the minimum or stops them completely through the Kubernetes API; when the load increases, the controller automatically expands the service instances according to the load forecast; Configure the traffic entry module to combine with the service grid to achieve advanced traffic management and security policy configuration between microservices; The system achieves service zero scaling through the cloud-native based service zero scaling method described in any one of claims 1 to 4.

6. A cloud-native service zero-scaling device, characterized in that: include: at least one memory and at least one processor; The at least one memory is used to store a machine-readable program; The at least one processor is used to call the machine-readable program to implement the method described in any one of claims 1 to 4.

7. A computer-readable medium, characterized in that The computer readable medium stores computer instructions, and when the computer instructions are executed by a processor, the method according to any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Method for deploying resources of storage system by learning workload in execution

    CN107179944A

  • Online application dynamic capacity expansion and shrinkage method based on micro-service call dependence perception

    CN112199150A