Kubernetes clusters, node handling methods, and computer-readable storage media

By introducing a division of labor between master and slave nodes in the Kubernetes cluster, along with monitoring and adjustment mechanisms, the application continuity problem under the slave node issue is solved, achieving high availability and continuous operation of the application.

CN115373792BActive Publication Date: 2026-11-17CHINA MOBILE GROUP ZHEJIANG +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110547834.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-19
Publication Date
2026-11-17
Estimated Expiration
2041-05-19

AI Technical Summary

Technical Problem

In existing technologies, Kubernetes clusters cannot adjust nodes when a slave node encounters a problem, resulting in a loss of application continuity.

Method used

Introducing a master node and multiple slave nodes into a Kubernetes cluster, including active slave nodes and standby slave nodes, allows the master node to deploy applications to the active and standby slave nodes respectively and monitor the running status of the slave nodes. When an application encounters a problem, the master node adjusts its running mode to ensure the continuous operation of the application.

Benefits of technology

By monitoring and adjusting the mode of the slave nodes from the master node, the system can quickly switch to a backup slave node when a slave node fails, malfunctions, or experiences a bottleneck, ensuring continuous application operation and solving the application continuity problem in Kubernetes clusters when slave node issues arise.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115373792B_ABST
    Figure CN115373792B_ABST
Patent Text Reader

Abstract

This invention provides a Kubernetes cluster, a node processing method, and a computer-readable storage medium. The Kubernetes cluster includes a master node and multiple slave nodes, with active slave nodes and standby slave nodes. The node processing method includes: the master node deploying each application to the active and standby slave nodes respectively; monitoring the running status of the applications on the active slave nodes; and adjusting the running modes of the active and standby slave nodes when a problem is detected in the application's operation, so that the slave nodes can continuously run the application. Therefore, this invention can adjust the running modes of the active and standby slave nodes when a problem occurs in the application's running status, thereby resolving the application's running problems and ensuring continuous application operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of cloud computing, and in particular to a Kubernetes cluster, a node processing method, and a computer-readable storage medium. Background Technology

[0002] Kubernetes is an open-source platform that automates the operation of Linux containers. It helps users avoid many manual deployment and scaling steps in the application containerization process. In other words, users can aggregate multiple groups of hosts running Linux containers, which are then efficiently managed by Kubernetes. Furthermore, these clusters can be deployed across public, private, or hybrid clouds. Therefore, Kubernetes is an ideal managed platform for cloud-native applications that require rapid scaling (such as real-time data streaming with Apache Kafka).

[0003] Application deployment in Kubernetes clusters differs from traditional application deployment. Traditional application deployment is done on a given machine, knowing how to access other machines' IP addresses. However, in a Kubernetes cluster, IP addresses can change, making traditional deployment methods ineffective—you can't specify an IP address to access a specific application. On one hand, Kubernetes provides access to the external network and pod network through servers; external networks can access each other through the server. On the other hand, Kubernetes connects to a group of pods, allowing load balancing across these pods via the server. This solves the IP change issue mentioned earlier, provides a unified access point for service discovery, and also allows external network access, resolving communication between different pods and providing a unified access address.

[0004] Kubernetes servers expose services to the external network through load balancing, and all traffic destined for the specified port (VIP:VIPPORT) will be forwarded to the corresponding service.

[0005] Kubernetes clusters offer high availability for their components: Kubernetes consists of master nodes and slave nodes. The master node runs control plane programs such as kube-apiserver (the API service in Kubernetes, a unified interface for system management commands), Etcd (storage), kube-scheduler (responsible for scheduling pods to appropriate nodes), and kube-controller-manager (the controller), all of which have multi-replica high availability features. Pods in a Kubernetes cluster run on various slave nodes, naturally possessing multi-replica characteristics.

[0006] However, the inventors discovered that existing Kubernetes servers do not consider the high availability of load balancing itself, and cannot adjust nodes to ensure application continuity when problems occur with slave nodes. Summary of the Invention

[0007] The main technical problem solved by the embodiments of the present invention is to provide a method for processing Kubernetes clusters and nodes, as well as a computer-readable storage medium, which can adjust the slave nodes when problems occur in the slave nodes where applications are deployed in Kubernetes, so as to ensure the continuity of applications.

[0008] To address the aforementioned technical problems, one technical solution adopted in this embodiment of the invention is: providing a method for processing nodes in a Kubernetes cluster, wherein the Kubernetes cluster includes a master node and multiple slave nodes, the multiple slave nodes including active slave nodes and standby slave nodes, and the node processing method includes: the master node deploying each application to the active slave node and the standby slave node respectively; monitoring the running status of the applications in the active slave node; and when a problem is detected in the running of the application, adjusting the running mode of the active slave node and the standby slave node so that the slave node can continuously run the application.

[0009] In one alternative approach, the number of active slave nodes is N, and the number of standby slave nodes is M, wherein M ≥ N, and N and M are positive integers.

[0010] In an alternative approach, the master node deploys each application to both the active slave node and the standby slave node:

[0011] For each application, the master node deploys a floating address on both the active slave node and the standby slave node.

[0012] In one alternative approach, problems with the operation of the application include malfunctions, anomalies, or bottlenecks.

[0013] In one alternative approach, each of the aforementioned activities has at least one application deployed on each node;

[0014] When a problem is detected in the operation of the application, adjusting the operating modes of the active slave node and the standby slave node so that the slave node can continuously run the application includes:

[0015] If the application encounters a malfunction or anomaly, the floating address of the problematic application on the active slave node will be switched to the floating address of the application corresponding to the backup slave node; or

[0016] If the application encounters a malfunction or an anomaly, the floating addresses of all applications on the active slave node containing the problematic application will be switched to the floating address of the application corresponding to the backup slave node.

[0017] In one alternative approach, adjusting the operating modes of the active slave node and the standby slave node when a problem is detected in the operation of the application, so that the slave node can continuously run the application, includes:

[0018] If the application encounters a bottleneck, the ratio of the number of active slave nodes to the number of backup slave nodes will be adjusted based on the current active slave node metric, the expected active slave node metric, the current number of active slave nodes, and the tolerance metric.

[0019] In one alternative approach, the step of adjusting the ratio of the number of active slave nodes to the number of standby slave nodes based on the metrics of the currently active slave nodes, the metrics of the desired active slave nodes, the number of currently active slave nodes, and the tolerance metric includes:

[0020] Expected number of slave nodes = [Currently active slave nodes * (Currently active slave node metrics / Expected active slave node metrics)] * Tolerance metric, where the current active slave node metrics are calculated as follows:

[0021] Where i is the number of applications deployed on the active slave node, Ci is the metric of the applications deployed on the active slave node, and N is the number of active slave nodes.

[0022] To address the aforementioned technical problems, this invention also provides a Kubernetes cluster, comprising a master node and multiple slave nodes. The master node includes an application deployment module, a monitoring module, and an adjustment module. The multiple slave nodes include active slave nodes and standby slave nodes, wherein:

[0023] The application deployment module is used to deploy each application to the active slave node and the standby slave node respectively;

[0024] The monitoring module is used to monitor the running status of the activities applied from the nodes;

[0025] The adjustment module is used to adjust the operating mode of the active slave node and the standby slave node when a problem is detected in the operation of the application, so that the slave node can run the application continuously.

[0026] To address the aforementioned technical problems, this invention also provides a Kubernetes cluster, which includes a processor and a memory. The processor is coupled to the memory, and the memory stores a computer program. When the processor is working, it executes the computer program to implement the aforementioned node processing method in the Kubernetes cluster.

[0027] To address the aforementioned technical problems, embodiments of the present invention also provide a computer-readable storage medium storing a computer program thereon, the computer program being executed by a processor to implement the aforementioned method for processing nodes in a Kubernetes cluster.

[0028] The beneficial effects of this invention are as follows: Unlike existing technologies, in this invention, the master node in the Kubernetes cluster deploys each application to both active and standby slave nodes. It further monitors the running status of applications on the active slave nodes and adjusts the running modes of the active and standby slave nodes when problems are detected, ensuring continuous application operation. Therefore, this invention can adjust the running modes of the active and standby slave nodes when application running issues arise, thereby resolving the problems and ensuring continuous application operation.

[0029] The above description is merely an overview of the technical solutions of the embodiments of the present invention. In order to better understand the technical means of the embodiments of the present invention and to implement them in accordance with the contents of the specification, and to make the above and other objects, features and advantages of the embodiments of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description

[0030] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:

[0031] Figure 1 This is a flowchart illustrating a method for processing nodes in a Kubernetes cluster, as provided in an embodiment of the present invention.

[0032] Figure 2 This is a schematic diagram illustrating the principle and structure of deploying applications from nodes;

[0033] Figure 3 This is a schematic diagram of the structure of a Kubernetes cluster provided in this embodiment of the invention;

[0034] Figure 4 This is a schematic block diagram of a Kubernetes cluster provided in an embodiment of the present invention;

[0035] Figure 5 This is a schematic block diagram of an embodiment of a computer-readable storage medium provided in this invention. Detailed Implementation

[0036] Exemplary embodiments of the invention will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be implemented in various forms and should not be limited to the embodiments set forth herein.

[0037] Please see Figure 1 , Figure 1 This invention provides a method for processing nodes in a Kubernetes cluster. The Kubernetes cluster includes a master node and multiple slave nodes, with the slave nodes including active slave nodes and standby slave nodes, such as... Figure 1 As shown, the node processing method in this embodiment includes the following steps:

[0038] Step S1: The master node deploys each application to the active slave node and the standby slave node respectively.

[0039] Step S2: Monitor the running status of activities applied from the nodes.

[0040] Step S3: When problems are detected in the operation of the application, adjust the operating mode of the active slave node and the standby slave node so that the slave node can run the application continuously.

[0041] Therefore, this embodiment further monitors the running status of applications on the active slave node by deploying each application to both the active and standby slave nodes. When problems are detected in the application's operation, the operating modes of the active and standby slave nodes are adjusted to ensure continuous application operation. Thus, when application running issues arise, the operating modes of the active and standby slave nodes can be adjusted to resolve the problems and ensure continuous application operation.

[0042] In step S1: The master node is the control node in the Kubernetes cluster, which can deploy, monitor, and adjust the work of the slave nodes. In this embodiment, the master node mainly deploys applications to the slave nodes through pods.

[0043] For each application, it is deployed on both the active slave node and the standby slave node. The deployment process can be simultaneous or sequential, for example, deploying the application on the active slave node first, and then deploying the corresponding application on the standby slave node.

[0044] Please see Figure 2 , Figure 2This is a schematic diagram illustrating the principle structure of an application being deployed to a slave node. For example... Figure 2 As shown, at least one floating address can be deployed for each slave node, and the floating address can be written in the form of a stack. Each application can correspond to a unique floating address, which is used to access the application. For each application, the master node deploys a floating address on both the active slave node and the standby slave node. In one embodiment, the active slave node and the standby slave node can be one-to-one when deploying applications. For example, multiple active slave nodes are named A1, A2, A3...AN, and multiple standby slave nodes are named B1, B2, B3...BN. The floating addresses in the active slave node A1 and the standby slave node B1 are one-to-one. For example, the floating addresses of 10 applications P1-P10 are deployed sequentially in the active slave node A1, and the floating addresses of the same 10 applications P1-P10 are also deployed sequentially in the standby slave node B1. And so on, the floating addresses of the active slave node A2 and the standby slave node B2 are one-to-one, the floating addresses of the active slave node A3 and the standby slave node B2 are one-to-one, and so on, the floating addresses of the active slave node AN and the standby slave node BN are one-to-one. Therefore, when a problem occurs in the application on the active slave node, it can be quickly switched to the application on the corresponding backup slave node.

[0045] Under normal circumstances, applications run on the active slave node to provide application services. In this embodiment, each application is deployed on both the active slave node and the standby slave node. This ensures that if an application on the active slave node encounters a problem, the standby slave node can take over and run the problematic application, thus guaranteeing the continuity of application operation.

[0046] In one embodiment, the number of active slave nodes is N, and the number of standby slave nodes is M, where M ≥ N, and M and N are positive integers. The number of standby slave nodes M is not less than the number of active slave nodes N, to ensure that each application can be deployed to either active or standby slave nodes.

[0047] In step S3: problems with the application's operation include application malfunctions, anomalies, or bottlenecks.

[0048] The problem is that the application fails to respond to user input. This could be caused by a faulty hardware device on the active slave node or a defect in the application itself.

[0049] An exception is a situation where the application can respond but fails to provide feedback, resulting in an abnormal freeze.

[0050] The bottleneck problem is that the application's running capacity has reached its limit, making it difficult to run other applications.

[0051] Let's take a webpage access example to illustrate the differences between fault problems, anomaly problems, and bottleneck problems: When a user accesses a webpage and enters its URL, a fault problem means the application fails to respond to the user's URL input; an anomaly problem means the application can respond to the user's URL input, but cannot display the page corresponding to the URL correctly; a bottleneck problem means that although the application can respond to the URL and display the page, the response time is very slow.

[0052] In this embodiment, different adjustment methods can be adopted to adjust the operating mode of the active slave node and the standby slave node according to the different problems encountered in the application operation.

[0053] Specifically, if the application encounters malfunctions or abnormalities, adjustments can be made in the following ways:

[0054] The first method involves switching the floating address of the problematic application from the active slave node to the floating address of the application corresponding to the backup slave node. If an application experiences a malfunction or anomaly, only the floating address of the problematic application needs to be switched to the backup slave node. First, the active slave node containing the malfunctioning application is obtained. Then, based on the correspondence described above, the corresponding backup slave node is found. Finally, the floating address of the problematic application is located within the found backup slave node, and this floating address is used as the subsequent access address for the application. This method involves less switching and is relatively simple and convenient.

[0055] The second method involves switching the floating addresses of all applications on the active slave node containing the problematic application to the floating address of the application on the standby slave node. This is a collective switchover mode, where the addresses of all active slave nodes containing the problematic application are switched to the addresses of the corresponding standby slave nodes. This method saves the trouble of searching for the floating addresses of the problematic application.

[0056] The above describes the node handling method when the application encounters a fault or anomaly. By switching the address of the problematic application to the corresponding floating address in the standby slave node, the application can be run by replacing the active slave node with the standby slave node, thereby ensuring the continuity of application operation.

[0057] If the application encounters a bottleneck issue, the slave node can be handled in the following ways:

[0058] The ratio of active to standby slave nodes is adjusted based on current active slave node metrics, expected active slave node metrics, current active slave node count, and tolerance metrics. Metrics can be defined as CPU utilization of application slave nodes or client latency when applications are running on slave nodes. Active slave node metrics can be collected through corresponding devices. Tolerance metrics represent the allowable expansion or contraction of the reserved tolerance space; that is, the amount of slave nodes that can be expanded or contracted based on the user's tolerable CPU utilization or latency.

[0059] Expected number of slave nodes = [Current active slave node count * (Current active slave node metric / Expected active slave node metric)] * Tolerance metric, where the current active slave node metric is calculated as follows:

[0060] Where i is the number of applications deployed on the active slave node, Ci is the metric of the applications deployed on the active slave node, and N is the number of active slave nodes.

[0061] In other words, when the number of active slave nodes is insufficient and causes a bottleneck in the application, the problem can be solved by adjusting the number of active slave nodes.

[0062] In summary, embodiments of the present invention can enable the slave nodes to run the application continuously by adjusting the operating modes of the active slave node and the standby slave node.

[0063] The following issues were resolved: First, the active slave node failure issue: the Kubernetes cluster was unaware of the active slave node's status, and when an active slave node failed, the Kubernetes cluster could not coordinate with the active slave node to perform node failover operations. Second, the active slave node performance bottleneck issue: when an active slave node experienced a performance bottleneck, the Kubernetes cluster could not coordinate with the active slave node to perform application service high-availability failover and restore business continuity. Third, the active slave node abnormal crash issue: when an active slave node abnormally crashed, the Kubernetes cluster could not coordinate with the active slave node to perform application service high-availability failover and restore business continuity.

[0064] This invention also provides a Kubernetes cluster for executing the node processing method described above. Please refer to... Figure 3 , Figure 3 This is a schematic diagram of the structure of a Kubernetes cluster provided in an embodiment of the present invention. Figure 3 As shown, the Kubernetes cluster 20 includes a master node 21 and multiple slave nodes 22. The master node 21 includes an application deployment module 211, a monitoring module 212, and an adjustment module 213. The multiple slave nodes 22 include an active slave node 221 and a standby slave node 222.

[0065] The application deployment module 211 is used to deploy each application to the active slave node 211 and the standby slave node 222 respectively. The application deployment module 211 mainly deploys applications to the slave node 22 through pods.

[0066] For each application, it is deployed on both the active slave node 221 and the standby slave node 222. The deployment process can be simultaneous or sequential, for example, deploying the application on the active slave node first, and then deploying the corresponding application on the standby slave node.

[0067] Specifically, at least one floating address can be deployed for each slave node 22, and the floating address can be written in the form of a stack. Each application can correspond to a unique floating address, which is used to access the application. For each application, the application deployment module 211 deploys a floating address on the active slave node 21 and the standby slave node 222 respectively. In one embodiment, the active slave node 221 and the standby slave node 222 can correspond one-to-one when deploying applications. For example, multiple active slave nodes 212 can be named A1, A2, A3...AN, and multiple standby slave nodes 222 can be named B1, B2, B3...BN. The floating addresses in the active slave node A1 and the floating addresses in the standby slave node B1 correspond one-to-one. For example, the floating addresses of 10 applications P1-P10 can be deployed sequentially in the active slave node A1, and the floating addresses of the same 10 applications P1-P10 can also be deployed sequentially in the standby slave node B1. Similarly, the floating addresses of active slave node A2 and standby slave node B2 correspond one-to-one, the floating addresses of active slave node A3 and standby slave node B2 correspond one-to-one, and so on, the floating addresses of active slave node AN and standby slave node BN correspond one-to-one. Therefore, when a problem occurs in the application on active slave node 221, it can be quickly redirected to the application on the corresponding standby slave node 222.

[0068] Under normal circumstances, the application runs on the active slave node 221, providing application services. In this embodiment, each application is deployed on both the active slave node 221 and the backup slave node 222. This ensures that if an application on the active slave node 221 encounters a problem, the backup slave node 222 can take over and run the problematic application, thus guaranteeing the continuity of application operation.

[0069] In one embodiment, the number of active slave nodes 221 is N, and the number of standby slave nodes 222 is M, where M ≥ N, and M and N are positive integers. The number of standby slave nodes 222, M, is not less than the number of active slave nodes 221, so as to ensure that each application can be deployed on both active slave nodes 221 and standby slave nodes 222.

[0070] The master node 21 also includes a storage module 214, which stores the floating addresses of the active slave node 221 and the standby slave node 222. In other words, all the results of the application deployment module 211 deploying slave nodes are registered and stored in the storage module 214.

[0071] Monitoring module 212 is used to monitor the running status of activities applied from node 221.

[0072] The adjustment module 213 is used to adjust the operating mode of the active slave node 221 and the standby slave node 212 when a problem is detected in the operation of the application, so that the slave node 22 can run the application continuously.

[0073] Problems with application operation include application malfunctions, anomalies, or bottlenecks.

[0074] The problem is that the application failed to respond to user input. This could be caused by a hardware failure on the active slave node 221 or by a defect in the application itself.

[0075] An exception is an issue where the application can respond but fails to provide feedback.

[0076] The bottleneck problem is that the application's running capacity has reached its limit, making it difficult to run other applications.

[0077] Let's take a webpage access example to illustrate the differences between fault problems, anomaly problems, and bottleneck problems: When a user accesses a webpage and enters its URL, a fault problem means the application fails to respond to the user's URL input; an anomaly problem means the application can respond to the user's URL input, but cannot display the page corresponding to the URL correctly; a bottleneck problem means that although the application can respond to the URL and display the page, the response time is very slow.

[0078] In one embodiment, the monitoring module 212 can be equipped with different monitoring devices depending on the monitoring content. For example, if it is necessary to monitor whether an active slave node has a fault, a separate hardware monitoring device can be set up. If it is necessary to monitor whether an active slave node has a deadlock anomaly, the slave node can be configured as a monitoring function module. Of course, any monitoring content can be implemented by setting up a separate hardware monitoring device.

[0079] In one embodiment, the operating modes of active slave node 221 and standby slave node 222 can be adjusted in different ways depending on the problems encountered during application operation.

[0080] Specifically, if the application encounters malfunctions or abnormalities, adjustments can be made in the following ways:

[0081] The first method involves switching the floating address of the problematic application from active slave node 221 to the floating address of the application corresponding to the backup slave node 222. If an application experiences a malfunction or anomaly, only the floating address of the problematic application needs to be switched to the backup slave node 222. First, the active slave node 221 containing the malfunctioning application is retrieved. Then, based on the aforementioned correspondence, the corresponding backup slave node 222 is found. Finally, the floating address of the problematic application is located within the found backup slave node 222, and this floating address is used as the subsequent access address for the application. This method involves less switching and is relatively simple and convenient.

[0082] The second method involves switching the floating addresses of all applications on node 221 containing the problematic application to the floating address of the application on the backup node 222. This is a collective switchover mode, where the addresses of all applications on node 221 containing the problematic application are switched to the addresses of the corresponding backup node 222. This method saves the troubleshooting step of searching for the floating address of the problematic application.

[0083] The above describes the handling method for slave node 22 when the application encounters a fault or an anomaly. By switching the address of the problematic application to the corresponding floating address in the standby slave node 222, the standby slave node 222 is used to replace the active slave node 221 to run the application, thereby ensuring the continuity of application operation.

[0084] If the application encounters a bottleneck problem, the following methods can be used to process node 22:

[0085] The ratio of active slave nodes 221 to standby slave nodes 222 is adjusted based on current active slave node metrics, expected active slave node metrics, current active slave node count, and tolerance metrics. The metrics can include the CPU utilization of slave node 22 when an application is running on it, or the client latency when an application is running on slave node 22. Active slave node metrics can be collected through corresponding devices. Tolerance metrics represent the appropriately reserved tolerance space, i.e., the amount of CPU utilization or latency that the user can tolerate, which is used to expand or shrink the slave node space.

[0086] The purpose of adjusting the ratio of active slave node 221 to standby slave node 222 based on the current active slave node metric, the expected active slave node metric, the current number of active slave nodes, and the tolerance metric is to obtain the expected number of active slave nodes in order to solve the performance bottleneck problem of active slave nodes.

[0087] Specifically, the expected number of active slave nodes = [current active slave node count * (current active slave node metric / expected active slave node metric)] * tolerance metric, where the current active slave node metric is calculated as follows:

[0088] Where i is the number of applications deployed on the active slave node, Ci is the metric of the applications deployed on the active slave node, and N is the number of active slave nodes.

[0089] In other words, when the number of active slave nodes is insufficient and causes a bottleneck in the application, the problem can be solved by adjusting the number of active slave nodes.

[0090] In summary, embodiments of the present invention can enable the slave nodes to run the application continuously by adjusting the operating modes of the active slave node and the standby slave node.

[0091] See Figure 4 , Figure 4 This is a schematic block diagram of a Kubernetes cluster embodiment provided by the present invention. The Kubernetes cluster in this embodiment includes a processor 310 and a memory 320. The memory 320 stores a computer program. The processor 310 is coupled to the memory 320. When the processor 310 is working, it executes the computer program to implement the Kubernetes cluster node processing method in any of the above embodiments.

[0092] The processor 310 can also be referred to as a CPU (Central Processing Unit). The processor 310 may be an integrated circuit chip with signal processing capabilities. The processor 310 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The general-purpose processor can be a microprocessor or any conventional processor, but is not limited to these.

[0093] See Figure 5 , Figure 5 This is a schematic block diagram of a computer-readable storage medium embodiment provided in this invention. The computer-readable storage medium in this embodiment stores a computer program 410, which can be executed by a processor to implement the Kubernetes cluster node processing method in any of the above embodiments.

[0094] Optionally, the readable storage medium can be any medium capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, or a terminal device such as a computer, server, mobile phone, or tablet.

[0095] This invention provides a Kubernetes cluster for executing the processing method of nodes in the Kubernetes cluster described above.

[0096] This invention provides a computer program that can be called by a processor to cause a Kubernetes cluster to execute the node processing methods in any of the above method embodiments.

[0097] This invention provides a computer program product, which includes a computer program stored on a computer-readable storage medium. The computer program includes program instructions that, when executed on a computer, cause the computer to perform the node processing method in the Kubernetes cluster described in any of the above method embodiments.

[0098] The algorithms or displays provided herein are not inherently related to any particular computer, virtual system, or other device. Various general-purpose systems can also be used in conjunction with the teachings herein. The required structure for constructing such systems is apparent from the above description. Furthermore, the embodiments of the present invention are not directed to any particular programming language. It should be understood that the content of the invention described herein can be implemented using various programming languages, and the above description of specific languages ​​is for the purpose of disclosing the best mode of implementation of the invention.

[0099] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.

[0100] Similarly, it should be understood that, in order to streamline the invention and aid in understanding one or more of the various aspects of the invention, features of the embodiments of the invention are sometimes grouped together in a single embodiment, figure, or description thereof in the above description of exemplary embodiments of the invention. However, this disclosure should not be construed as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim.

[0101] Those skilled in the art will understand that modules in the device of the embodiments can be adaptively changed and placed in one or more devices different from that embodiment. Modules, units, or components in the embodiments can be combined into a single module, unit, or component, and can be divided into multiple sub-modules, sub-units, or sub-components. Except where at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all processes or units of any method or device so disclosed. Unless expressly stated otherwise, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.

[0102] It should be noted that the above embodiments are illustrative of the invention and not restrictive, and that those skilled in the art can devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names. The steps in the above embodiments, unless otherwise specified, should not be construed as limiting the order of execution.

Claims

1. A method for processing nodes in a Kubernetes cluster, characterized in that, The Kubernetes cluster includes a master node and multiple slave nodes, the multiple slave nodes including active slave nodes and standby slave nodes, and the node processing method includes: The master node deploys each application to the active slave node and the standby slave node respectively; for each application, the master node deploys a floating address on the active slave node and the standby slave node respectively, and the floating address in the active slave node and the floating address in the standby slave node correspond one-to-one. Monitor the running status of the activities applied from the nodes; When a problem is detected in the operation of the application, the operating modes of the active slave node and the backup slave node are adjusted to ensure that the slave node can continuously run the application. Specifically, if the application experiences a failure or anomaly, the floating address of the problematic application in the active slave node is switched to the floating address of the application corresponding to the backup slave node; or, if the application experiences a failure or anomaly, the floating addresses of all applications in the active slave node containing the problematic application are switched to the floating address of the application corresponding to the backup slave node; if the application experiences a bottleneck, the ratio of the number of active slave nodes to the number of backup slave nodes is adjusted according to the current active slave node metrics, the expected active slave node metrics, the current number of active slave nodes, and the tolerance metrics.

2. The method for processing nodes in a Kubernetes cluster according to claim 1, characterized in that, The number of active slave nodes is N, and the number of standby slave nodes is M, wherein M ≥ N, and N and M are positive integers.

3. The method for processing nodes in a Kubernetes cluster according to claim 1, characterized in that, The master node deploys each application to the active slave node and the standby slave node, respectively, including: For each application, the master node deploys a floating address on both the active slave node and the standby slave node.

4. The method for processing nodes in a Kubernetes cluster according to claim 3, characterized in that, Problems encountered during application operation include application malfunctions, anomalies, or bottlenecks.

5. The method for processing nodes in a Kubernetes cluster according to claim 1, characterized in that, The step of adjusting the ratio of active slave nodes to standby slave nodes based on the current active slave node index, the expected active slave node index, the current number of active slave nodes, and the tolerance index includes: Expected number of slave nodes = [Current number of active slave nodes] (Current activity node metrics / Expected activity node metrics) The tolerance index, wherein the current active node index is calculated as follows: Current activity from node metrics = ,in, i The number of applications deployed on the active slave node, Ci For application metrics deployed on the active slave node, N The number of nodes for the activity.

6. A Kubernetes cluster, characterized in that, The Kubernetes cluster includes a master node and multiple slave nodes. The master node includes an application deployment module, a monitoring module, and a tuning module. The multiple slave nodes include active slave nodes and standby slave nodes, wherein: The application deployment module is used to deploy each application to the active slave node and the standby slave node respectively; for each application, the application deployment module deploys a floating address on the active slave node and the standby slave node respectively, and the floating address in the active slave node and the floating address in the standby slave node correspond one-to-one; The monitoring module is used to monitor the running status of the activities applied from the nodes; The adjustment module is used to adjust the operating mode of the active slave node and the backup slave node when a problem is detected in the operation of the application, so that the slave node can run the application continuously. Specifically, if the application experiences a failure or anomaly, the floating address of the application with the problem in the active slave node is switched to the floating address of the application corresponding to the backup slave node; or, if the application experiences a failure or anomaly, the floating addresses of all applications in the active slave node containing the application with the problem are switched to the floating address of the application corresponding to the backup slave node; if the application experiences a bottleneck, the ratio of the number of active slave nodes to the number of backup slave nodes is adjusted according to the current active slave node index, the expected active slave node index, the current number of active slave nodes, and the tolerance index.

7. A Kubernetes cluster, characterized in that, The Kubernetes cluster includes a processor and a memory, the processor being coupled to the memory, the memory storing a computer program, and the processor executing the computer program during operation to implement the method as described in any one of claims 1-5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, The computer program is executed by a processor to implement the method as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Instance control method, node, terminal and distributed storage system

    CN111385352A

  • Data backup and recovery system and method based on distributed service cluster

    CN111949444A