Automatic migration capacity expansion method and system for multiple Kubernetes clusters

By using monitoring and reinforcement learning algorithms to select target clusters, the system achieves automated cross-cluster scaling and migration of Kubernetes clusters, solving the problem of application inaccessibility when the cluster is abnormal, improving system resource utilization and reliability, and reducing maintenance workload.

CN121858299APending Publication Date: 2026-04-14云鼎科技股份有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-27
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Kubernetes clusters have limited resources and cannot automatically scale and migrate across clusters when anomalies occur, resulting in application inaccessibility. Existing technologies lack automated processes, are time-consuming, and pose high risks.

Method used

By monitoring application and cluster status, anomalies are detected in real time. Reinforcement learning and multi-objective optimization algorithms are used to select target clusters, enabling automated cross-cluster scaling and migration. Address registration and updates are performed in conjunction with a service gateway.

Benefits of technology

It enables rapid cross-cluster migration and scaling of applications under abnormal conditions, improves resource utilization, enhances system resilience and reliability, reduces manual intervention, and improves operation and maintenance efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121858299A_ABST
    Figure CN121858299A_ABST
Patent Text Reader

Abstract

The invention relates to a multi-Kubernetes cluster-oriented automatic migration capacity expansion method and system, and aims to improve the resource utilization rate, the system elasticity and the operation and maintenance efficiency in a multi-cluster environment. The method comprises the following steps: pre-configuring a monitoring index threshold value, monitoring application and cluster states in real time, and sending an alarm notification when abnormality is detected; confirming validity after receiving the alarm, and selecting a target cluster from the available cluster resource pool; pulling the application backup configuration file, and automatically deploying on the target cluster; and after the deployment is completed, calling a service gateway Apix to update a service access address. The system comprises a monitoring module, a backup module, a service module and a gateway module, and full-process automatic management is achieved. Through intelligent scheduling, dynamic load balancing and reinforcement learning algorithms, resource allocation is optimized, system reliability and user experience are improved, operation cost is reduced, and the method is suitable for a complex and changeable cloud native environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of container orchestration and automated management technology, and in particular relates to an automated migration and scaling method and system for multiple Kubernetes clusters. Background Technology

[0002] Kubernetes, as a core technology in the cloud-native field, is now widely used in production across various industries. Kubernetes abstracts underlying computing, network, and storage resources to provide available resources to upper-layer applications on demand. However, Kubernetes cluster resources, capacity, and load are limited. Furthermore, if a Kubernetes cluster fails, applications become inaccessible. Ensuring rapid and automated cross-cluster scaling and migration of applications when the underlying Kubernetes cluster fails or reaches maximum load is a current challenge. While Kubernetes' own mechanisms enable rapid scaling of applications within a single cluster, it cannot automate rapid scaling and migration of applications across clusters. Currently, many enterprises use primary / standby clusters in production environments. However, primary / standby clusters are relatively fixed, requiring manual pre-configuration of applications. Critical scaling and migration processes are manual, lacking automation, and are time-consuming. Moreover, primary / standby clusters can fail in extreme cases, rendering applications inaccessible. Summary of the Invention

[0003] (a) Purpose of the invention To overcome the above shortcomings, the purpose of this invention is to provide an automated migration and scaling method and system for multiple Kubernetes clusters, so as to solve the above technical problems.

[0004] (II) Technical Solution To achieve the above objectives, the technical solution provided in this application is as follows: An automated migration and scaling method for multiple Kubernetes clusters includes the following steps: Step 1: Pre-configure application and cluster monitoring metric thresholds; Step 2: Monitor application and cluster status in real time; Step 3: When an anomaly is detected in the application or cluster, an alarm notification is sent. Step 4: After receiving the alarm notification, the status of the application and cluster is monitored in real time. If it is a false alarm, the relevant information is recorded and the processing flow ends. If the alarm is confirmed to be valid, an available cluster that meets the conditions is selected from the available cluster resource pool as the target cluster for expansion and migration. Step 5: Retrieve the latest backup configuration file of the application and perform automated deployment and installation on the target cluster; Step 6 detects that the application has been deployed on the target cluster. Based on the application migration or expansion operation, it calls the service gateway Apisix to register or update the service access address of the new cluster.

[0005] Preferably, the monitoring metrics in step 1 include application CPU, application memory, application node status, cluster CPU, cluster memory, cluster load, and cluster node status.

[0006] Preferably, in step 2, a monitoring service is deployed for each Kubernetes cluster.

[0007] Preferably, step 3 specifically includes: after monitoring the metrics of the application and the cluster, comparing them with the threshold of the corresponding metrics; if the threshold is not exceeded, no alarm is issued; if the threshold is exceeded, an alarm is issued.

[0008] Preferably, the available cluster resource pool in step 4 contains at least two Kubernetes available clusters, and the available clusters in the available cluster resource pool need to be pre-configured.

[0009] Preferably, step 4 specifically includes the following steps: S1 environment modeling, defining the state S of each cluster i Defined as a vector containing cluster resource utilization, load, and current connection count: Si = [CPU utilization i, memory utilization i, load i, number of connections i] Action A i This indicates that cluster i is selected as the target cluster for application deployment or migration; The reward function R aims to maximize resource utilization, minimize load imbalance, and minimize migration costs. The specific formula is as follows: Where α, β, and γ are weighting coefficients used to balance the priorities of different objectives; S2 multi-objective optimization uses an objective optimization algorithm to score clusters. The objectives include maximizing resource utilization, minimizing load imbalance, and minimizing migration cost. The scoring formula is: Calculate the comprehensive score P for each cluster i. i, The NSGA-II algorithm is used to perform a non-dominated sort of all clusters to select the Pareto optimal solution set; S3 Reinforcement Learning Decision Initialize the Q table, where Q(S) i A i) indicates that in state S i The expected reward for the next action selected by Ai; At each time step t, obtain the current cluster state S. t ; Using an ε-greedy strategy to select actions: ϵ is the exploration rate, used to balance exploration and exploitation; Perform the selected action A t Deploy the application to the target cluster i; Calculate the reward R(St,At) based on the reward function; Update the Q table using the Q-Learning update formula: Where α is the learning rate and γ is the discount factor; S4 dynamically adjusts and optimizes, periodically evaluates the convergence of the Q-table and the actual deployment effect, and dynamically adjusts the learning rate α, discount factor γ, and exploration rate ϵ based on the evaluation results. If it is found that some clusters are frequently selected as target clusters but the actual effect is not good, their weight coefficients α, β, γ can be adjusted, or the Q-table can be retrained.

[0010] Preferably, in step 5, there is a backup service in the cluster that periodically backs up the application configurations on the Kubernetes cluster.

[0011] Preferably, step 6 is performed as follows: If the application is performing a cross-cluster scaling operation, the Apisix service gateway will be invoked immediately to add the new cluster application access address and update the load balancer configuration. If the application is being migrated across clusters, the Apisix service gateway will be invoked immediately to first delete the old application access address, then add the new application access address, and update the load balancing configuration.

[0012] An automated migration and scaling system for multiple Kubernetes clusters includes the following modules: Monitoring module: Used to monitor the real-time status of applications and clusters, application and cluster resource usage, and application and cluster access status. It also configures the service module address and sends alarm information to the service module after detecting an alarm. Backup module: Initiates scheduled tasks to back up the application's current configuration according to the set backup strategy; Service module: Receives alarm information from various monitoring modules, performs secondary confirmation of alarms, configures available clusters to build cluster resource pools, configures backup module addresses, pulls application backup configuration information from backup modules, selects available clusters for automated deployment, and registers and updates the new cluster application access methods to the gateway after deployment. Gateway module: As the unified traffic entry point for application access, it is responsible for receiving load update requests from service modules, dynamically deleting deprecated configurations, adding access addresses for newly created applications, and updating the cluster access entry point in real time.

[0013] Beneficial effects: 1. Improve resource utilization: Through intelligent scheduling and multi-objective optimization algorithms, the system dynamically selects the optimal target cluster based on indicators such as cluster resource utilization, load, and connection count, avoiding resource waste and ensuring efficient resource utilization. The system regularly evaluates the effectiveness of resource allocation and dynamically adjusts resource allocation strategies to further optimize resource usage efficiency.

[0014] 2. Enhance system resilience and reliability by monitoring application and cluster status in real time. Immediately issue alerts and initiate automated processing upon detecting anomalies, minimizing the impact of failures on business operations. Regularly back up application configuration files to ensure rapid application recovery in the event of a failure, reducing the risk of data loss. Support cross-cluster migration and scaling operations; even if one cluster fails, applications can be quickly migrated to other available clusters, ensuring high service availability.

[0015] 3. Improve operational efficiency by automating the entire process from monitoring and alerting, resource scheduling, application deployment to service gateway updates, reducing manual intervention, workload, and human error. Reinforcement learning algorithms learn from historical data and operating patterns to make smarter decisions and adapt to complex multi-cluster environments. Integrate monitoring, backup, scheduling, and gateway management functions onto a single platform, providing a unified management interface to improve operational efficiency. Attached Figure Description

[0016] Figure 1 This is a flowchart of the present invention; Figure 2 This is a system architecture diagram according to one embodiment of the present invention. Detailed Implementation

[0017] To make the objectives, technical solutions, and advantages of this invention clearer, the following detailed embodiments are described in conjunction with the appendix. Figure 1-2 The present invention will be described in further detail below. It should be understood that these descriptions are merely exemplary and not intended to limit the scope of the invention. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concept of the invention.

[0018] This invention provides an automated migration and scaling method for multiple Kubernetes clusters, comprising the following steps: Step 1: Pre-configure the application and cluster monitoring metric thresholds. The monitoring metrics include application CPU, application memory, application node status, cluster CPU, cluster memory, cluster load, and cluster node status.

[0019] Step 2: Monitor application and cluster status in real time. Deploy a monitoring service for each Kubernetes cluster.

[0020] Step 3: When an anomaly is detected in the application or cluster, an alarm notification is sent. After monitoring the metrics of the application and cluster, they are compared with the corresponding thresholds. If the threshold is not exceeded, no alarm is issued. If the threshold is exceeded, an alarm is issued.

[0021] Step 4: After receiving the alarm notification, the status of the application and cluster is monitored in real time. If it is a false alarm, the relevant information is recorded and the processing flow ends. If the alarm is confirmed to be valid, an available cluster that meets the conditions is selected from the available cluster resource pool as the target cluster for expansion and migration. The available cluster resource pool contains at least two Kubernetes available clusters, and the available clusters in the available cluster resource pool need to be pre-configured.

[0022] Step 5: Pull the latest backup configuration file of the application and automatically deploy and install it on the target cluster. There is a backup service in the cluster, which backs up the application configuration on the Kubernetes cluster on a regular basis.

[0023] Step 6 detects that the application has been deployed on the target cluster. Based on the application migration or expansion operation, it calls the service gateway Apisix to register or update the service access address of the new cluster.

[0024] Preferably, step 4 specifically includes the following steps: S1 environment modeling, defining the state S of each cluster i Defined as a vector containing cluster resource utilization, load, and current connection count: Si = [CPU utilization i, memory utilization i, load i, number of connections i] Action A i This indicates that cluster i is selected as the target cluster for application deployment or migration; The reward function R aims to maximize resource utilization, minimize load imbalance, and minimize migration costs. The specific formula is as follows: Where α, β, and γ are weighting coefficients used to balance the priorities of different objectives; S2 multi-objective optimization uses an objective optimization algorithm to score clusters. The objectives include maximizing resource utilization, minimizing load imbalance, and minimizing migration cost. The scoring formula is: Calculate the comprehensive score P for each cluster i. i, The NSGA-II algorithm is used to perform a non-dominated sort of all clusters to select the Pareto optimal solution set; S3 Reinforcement Learning Decision Initialize the Q table, where Q(S) i A i ) indicates that in state S i The expected reward for the next action selected by Ai; At each time step t, obtain the current cluster state S. t ; Using an ε-greedy strategy to select actions: ϵ is the exploration rate, used to balance exploration and exploitation; Perform the selected action A t Deploy the application to the target cluster i; Calculate the reward R(St,At) based on the reward function; Update the Q table using the Q-Learning update formula: Where α is the learning rate and γ is the discount factor; S4 dynamically adjusts and optimizes, periodically evaluates the convergence of the Q-table and the actual deployment effect, and dynamically adjusts the learning rate α, discount factor γ, and exploration rate ϵ based on the evaluation results. If it is found that some clusters are frequently selected as target clusters but the actual effect is not good, their weight coefficients α, β, γ can be adjusted, or the Q-table can be retrained.

[0025] Preferably, step 6 is performed as follows: If the application is performing a cross-cluster scaling operation, the Apisix service gateway will be invoked immediately to add the new cluster application access address and update the load balancer configuration. If the application is being migrated across clusters, the Apisix service gateway will be invoked immediately to first delete the old application access address, then add the new application access address, and update the load balancing configuration.

[0026] An automated migration and scaling system for multiple Kubernetes clusters includes the following modules: Monitoring module: Used to monitor the real-time status of applications and clusters, application and cluster resource usage, and application and cluster access status. It also configures the service module address and sends alarm information to the service module after detecting an alarm. Backup module: Initiates scheduled tasks to back up the application's current configuration according to the set backup strategy; Service module: Receives alarm information from various monitoring modules, performs secondary confirmation of alarms, configures available clusters to build cluster resource pools, configures backup module addresses, pulls application backup configuration information from backup modules, selects available clusters for automated deployment, and registers and updates the new cluster application access methods to the gateway after deployment. Gateway module: As the unified traffic entry point for application access, it is responsible for receiving load update requests from service modules, dynamically deleting deprecated configurations, adding access addresses for newly created applications, and updating the cluster access entry point in real time.

[0027] Users pre-configure monitoring metric thresholds for the Kubernetes cluster and applications deployed within it. These metrics include application CPU, application memory, application node status, cluster CPU, cluster memory, cluster load, and cluster node status. The monitoring module performs real-time monitoring of the application and cluster status. Upon detecting a metric, it compares it to the corresponding threshold. If the threshold is not exceeded, no alarm is issued; otherwise, a detailed alarm is sent to the configured service module. Upon receiving the alarm notification from the monitoring module, the service module performs real-time monitoring of the application and cluster status based on the information. A second confirmation is performed. If the alarm is confirmed to be false, no action is taken. If the alarm is confirmed to be valid, an available cluster is selected from the configured available cluster resource pool as the target cluster for expansion and migration. The latest backup configuration file of the application is pulled from the backup module and automatically deployed and installed on the target cluster. After the application deployment is completed and access is available, if the application is a cross-cluster expansion operation, the service gateway is called in real time to add the new cluster application access address and update the load configuration. If the application is a cross-cluster migration, the service gateway is called in real time to first delete the old application access address, then add the new application access address, and update the load configuration.

[0028] This invention enables automated and rapid cross-cluster scaling and migration of applications when anomalies occur in a production Kubernetes cluster or application, thereby solving the problem of production service unavailability caused by the inability to automate and streamline the rapid self-migration and scaling of applications across clusters. This invention is simple, effective, and can achieve processing within seconds, significantly improving the availability of production systems.

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

[0030] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. An automated migration and scaling method for multiple Kubernetes clusters, characterized in that, Includes the following steps: Step 1: Pre-configure application and cluster monitoring metric thresholds; Step 2: Monitor application and cluster status in real time; Step 3: When an anomaly is detected in the application or cluster, an alarm notification is sent. Step 4: After receiving the alarm notification, the status of the application and cluster is monitored in real time. If it is a false alarm, the relevant information is recorded and the processing flow ends. If the alarm is confirmed to be valid, an available cluster that meets the conditions is selected from the available cluster resource pool as the target cluster for expansion and migration. Step 5: Retrieve the latest backup configuration file of the application and perform automated deployment and installation on the target cluster; Step 6 detects that the application has been deployed on the target cluster. Based on the application migration or expansion operation, it calls the service gateway Apisix to register or update the service access address of the new cluster.

2. The automated migration and scaling method for multiple Kubernetes clusters according to claim 1, characterized in that, The monitoring metrics in step 1 include application CPU, application memory, application node status, cluster CPU, cluster memory, cluster load, and cluster node status.

3. The automated migration and scaling method for multiple Kubernetes clusters according to claim 1, characterized in that, In step 2, a monitoring service is deployed for each Kubernetes cluster.

4. The automated migration and scaling method for multiple Kubernetes clusters according to claim 1, characterized in that, Step 3 specifically includes: after monitoring the metrics of the application and cluster, comparing them with the thresholds of the corresponding metrics; if the thresholds are not exceeded, no alarm is issued; if the thresholds are exceeded, an alarm is issued.

5. The automated migration and scaling method for multiple Kubernetes clusters according to claim 1, characterized in that, The available cluster resource pool in step 4 contains at least two Kubernetes available clusters, and the available clusters in the available cluster resource pool need to be pre-configured.

6. The automated migration and scaling method for multiple Kubernetes clusters according to claim 5, characterized in that, Step 4 specifically includes the following steps: S1 environment modeling, defining the state S of each cluster i Defined as a vector containing cluster resource utilization, load, and current connection count: Si = [CPU utilization i, memory utilization i, load i, number of connections i] Action A i This indicates that cluster i is selected as the target cluster for application deployment or migration; The reward function R aims to maximize resource utilization, minimize load imbalance, and minimize migration costs. The specific formula is as follows: Where α, β, and γ are weighting coefficients used to balance the priorities of different objectives; S2 multi-objective optimization uses an objective optimization algorithm to score clusters. The objectives include maximizing resource utilization, minimizing load imbalance, and minimizing migration cost. The scoring formula is: Calculate the comprehensive score P for each cluster i. i, The NSGA-II algorithm is used to perform a non-dominated sort of all clusters to select the Pareto optimal solution set; S3 Reinforcement Learning Decision Initialize the Q table, where Q(S) i A i ) indicates that in state S i The expected reward for the next action selected by Ai; At each time step t, obtain the current cluster state S. t ; Using an ε-greedy strategy to select actions: ϵ is the exploration rate, used to balance exploration and exploitation; Perform the selected action A t Deploy the application to the target cluster i; Calculate the reward R(St,At) based on the reward function; Update the Q table using the Q-Learning update formula: Where α is the learning rate and γ is the discount factor; S4 dynamically adjusts and optimizes, periodically evaluates the convergence of the Q-table and the actual deployment effect, and dynamically adjusts the learning rate α, discount factor γ, and exploration rate ϵ based on the evaluation results. If it is found that some clusters are frequently selected as target clusters but the actual effect is not good, their weight coefficients α, β, γ can be adjusted, or the Q-table can be retrained.

7. The automated migration and scaling method for multiple Kubernetes clusters according to claim 1, characterized in that, In step 5, there is a backup service in the cluster, which periodically backs up the application configuration on the Kubernetes cluster.

8. The automated migration and scaling method for multiple Kubernetes clusters according to claim 1, characterized in that, The specific operation of step 6 is as follows: If the application is performing a cross-cluster scaling operation, the Apisix service gateway will be invoked immediately to add the new cluster application access address and update the load balancer configuration. If the application is being migrated across clusters, the Apisix service gateway will be invoked immediately to first delete the old application access address, then add the new application access address, and update the load balancing configuration.

9. An automated migration and scaling system for multiple Kubernetes clusters, characterized in that, Includes the following modules: Monitoring module: Used to monitor the real-time status of applications and clusters, application and cluster resource usage, and application and cluster access status. It also configures the service module address and sends alarm information to the service module after detecting an alarm. Backup module: Initiates scheduled tasks to back up the application's current configuration according to the set backup strategy; Service module: Receives alarm information from various monitoring modules, performs secondary confirmation of alarms, configures available clusters to build cluster resource pools, configures backup module addresses, pulls application backup configuration information from backup modules, selects available clusters for automated deployment, and registers and updates the new cluster application access methods to the gateway after deployment. Gateway module: As the unified traffic entry point for application access, it is responsible for receiving load update requests from service modules, dynamically deleting deprecated configurations, adding access addresses for newly created applications, and updating the cluster access entry point in real time.