Kubernetes downtime rapid migration method and device and medium

CN118939401AActive Publication Date: 2024-11-12GUANGZHOU BINGO SOFTWARE
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411058056.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-02
Publication Date
2024-11-12
Estimated Expiration
2044-08-02

AI Technical Summary

Technical Problem

[0002]现有Kuberentes集群在进行宕机迁移时,需要经过控制面和数据面的多次交互,其中触发宕机事件后,需要经过副本控制器产生新的容器副本、调度器对新容器副本进行调度、选择合适的节点、节点控制器监听事件以及本地部署新的副本等环节,这些环节需要多次与ETCD数据库进行交互,均产生一定的耗时

Benefits of technology

[0028] The invention discloses a kubernetes downtime fast migration method, equipment and media. The method includes: preparing container copies in a cold standby state at each alternative node in advance; and performing real-time dynamic downtime on each node in the cluster. Scheduling prediction; when a node in the cluster goes down, IP traffic is switched from the down node to an alternative node based on the dynamic downtime scheduling prediction. The container copy switches from the cold standby state to the hot standby state, and the alternative node becomes the working node; the method proposed by the present invention analyzes the entire migration scheduling process, and uses distributed redundant copy pre-provisioning, dynamic downtime scheduling prediction and Atomic-level scheduling significantly optimizes and reduces the actual migration process. It can optimize the time of cluster outage migration to less than 200ms, significantly improving the Kubernetes cluster performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118939401A_ABST
    Figure CN118939401A_ABST
Patent Text Reader

Abstract

The invention discloses a kubernetes downtime rapid migration method and device and a medium. The method comprises the steps that container copies in a cold standby state are prepared at all alternative nodes in advance; performing real-time dynamic downtime scheduling prediction on each node in the cluster; and when a node in the cluster is down, switching the IP flow from the down node to a certain alternative node according to a dynamic down scheduling prediction condition, switching a container copy of the alternative node from a cold standby state to a hot standby state, and enabling the alternative node to become a working node. According to the method, the whole migration scheduling process is analyzed, the actual migration process is greatly optimized and reduced through distributed redundant copy presetting, dynamic downtime scheduling prediction and atomic scheduling, the time consumed by cluster downtime migration can be optimized to be within 200 ms, and the kubernetes cluster performance is remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of Kubernetes, and in particular relates to a Kubernetes downtime rapid migration method, device and medium. Background Art

[0002] When the existing Kuberentes cluster is performing downtime migration, it needs to go through multiple interactions between the control plane and the data plane. After the downtime event is triggered, it needs to go through the steps of generating a new container copy through the replica controller, scheduling the new container copy through the scheduler, selecting a suitable node, the node controller listening to events, and locally deploying a new copy. These steps require multiple interactions with the ETCD database, which takes a certain amount of time.

[0003] The process after the above-mentioned downtime event takes too long: The current migration scheduling process involves multiple data interactions among multiple components, which makes the migration scheduling process lengthy and takes more than 1 second. It cannot meet the requirements in measurement, control systems, industrial automation, edge computing, industrial simulation, and some business scenarios that pursue extreme performance. Summary of the invention

[0004] In order to overcome the above technical defects, the present invention provides a Kubernetes downtime fast migration method, device and medium, which analyzes the entire migration scheduling process and greatly optimizes and reduces the actual migration process through distributed redundant replica pre-provisioning, dynamic downtime scheduling prediction and atomic-level scheduling.

[0005] In order to solve the above problems, in a first aspect, the present invention provides a Kubernetes downtime rapid migration method, comprising:

[0006] Provision cold standby container replicas on each candidate node in advance;

[0007] Perform real-time dynamic downtime scheduling prediction for each node in the cluster;

[0008] When a node in the cluster goes down, the IP traffic is switched from the down node to a candidate node based on the dynamic downtime scheduling prediction. The container replica of the candidate node is switched from the cold standby state to the hot standby state, and the candidate node becomes a working node.

[0009] Furthermore, the step of pre-provisioning a container replica in a cold standby state on each candidate node includes:

[0010] The replica controller generates both hot standby container replicas and cold standby container replicas.

[0011] The scheduler schedules the hot standby container replicas to the working nodes and the cold standby container replicas to the candidate nodes according to the normal scheduling logic.

[0012] The node controller of the candidate node starts the container replica in the cold standby state and keeps the container replica in a silent state;

[0013] The SDN controller of the candidate node adds redundant SDN flow table data to the container replica in the cold standby state, keeps the flow table rules silent, and does not access IP traffic.

[0014] Furthermore, the step of pre-provisioning a container replica in a cold standby state on each candidate node further includes:

[0015] The node controller of the working node starts the container replica in hot standby state and assigns it an IP address;

[0016] The SDN controller of the working node adds SDN flow table data to the container replica in the hot standby state and connects the IP traffic to the container replica in the hot standby state.

[0017] Furthermore, the real-time dynamic downtime scheduling prediction for each node in the cluster includes:

[0018] The pre-scheduling controller establishes a dynamic downtime scheduling prediction table;

[0019] Each node controller listens to the API-Server to obtain the container data that may be migrated to this node and the current running nodes of these containers, and maintains a local downtime monitoring table;

[0020] When the operating relationship between nodes and containers in the cluster changes, the pre-scheduling controller adjusts the data in the dynamic downtime scheduling prediction table, and each node controller synchronously adjusts the data in the local downtime monitoring table to change the monitoring behavior.

[0021] Furthermore, when a node in the cluster goes down, according to the dynamic downtime scheduling prediction, IP traffic is switched from the downtime node to a candidate node, and the container copy of the candidate node is switched from a cold standby state to a hot standby state, and the candidate node becomes a working node, including:

[0022] The node controller of a candidate node performs downtime monitoring on several target nodes according to the local downtime monitoring table;

[0023] When a target node is detected to be down, the node controller of the candidate node switches the local container replica from cold standby to hot standby based on the predicted container deployment requirements it carries.

[0024] The node controller notifies the SDN controller to switch the flow table data and switch the IP traffic on the down node to the container copy in hot standby state on this node.

[0025] In a second aspect, the present invention provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.

[0026] In a third aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the above method when executed by a processor.

[0027] Compared with the prior art, the present invention has the following beneficial effects:

[0028] The present invention discloses a Kubernetes downtime fast migration method, device and medium. The method comprises: pre-provisioning a container copy in a cold standby state at each candidate node; performing real-time dynamic downtime scheduling prediction on each node in the cluster; when a node in the cluster goes down, according to the dynamic downtime scheduling prediction, switching IP traffic from the downtime node to a candidate node, switching the container copy of the candidate node from a cold standby state to a hot standby state, and the candidate node becomes a working node; the method proposed by the present invention analyzes the entire migration scheduling process, and greatly optimizes and reduces the actual migration process through distributed redundant copy pre-provisioning, dynamic downtime scheduling prediction and atomic scheduling, and can optimize the time consumption of cluster downtime migration to within 200ms, thereby significantly improving the Kubernetes cluster performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] The specific embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings, wherein:

[0030] Figure 1 This is a flowchart of the Kubernetes downtime rapid migration method described in Example 1;

[0031] Figure 2 This is a schematic diagram of step S2 of the Kubernetes downtime rapid migration method described in Example 1;

[0032] Figure 3 This is a schematic diagram of the structure of the computer device described in Example 2. DETAILED DESCRIPTION

[0033] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.

[0034] Example 1

[0035] This embodiment discloses a Kubernetes downtime rapid migration method, such as Figure 1 ,include:

[0036] S1. Prepare cold standby container replicas on each candidate node in advance.

[0037] Specifically, step S1 includes:

[0038] The replica controller generates both hot standby container replicas and cold standby container replicas.

[0039] The scheduler schedules the hot standby container replicas to the working nodes and the cold standby container replicas to the candidate nodes according to the normal scheduling logic.

[0040] The node controller of the working node starts the container replica in the hot standby state according to the normal scheduling logic and assigns it an IP address.

[0041] The SDN controller of the working node adds SDN flow table data to the container replica in the hot standby state and connects the IP traffic to the container replica in the hot standby state.

[0042] The node controller of the candidate node starts the cold standby container replica and keeps the container replica in a silent state. The node controller of the candidate node also assigns an IP address to the cold standby container replica, which is consistent with the IP address obtained by the hot standby container replica in the working node.

[0043] The SDN controller of the candidate node adds redundant SDN flow table data to the container replica in the cold standby state, keeps the flow table rules silent, and does not access IP traffic.

[0044] S2. Perform real-time dynamic downtime scheduling prediction for each node in the cluster to provide real-time scheduling decision reference for the scheduling of subsequent node downtime.

[0045] In one embodiment, if Figure 2 , step S2 comprises:

[0046] S21, the pre-scheduling controller establishes a dynamic downtime scheduling prediction table. Specifically, the pre-scheduling controller monitors the distribution data of each container replica in the cluster in real time, calculates the containers that need to be migrated when each working node goes down in the current deployment state, and the migration target nodes that these containers can schedule.

[0047] S22. Each node controller monitors the API-Server, obtains the container data that may be migrated to the node and the current running nodes of these containers, and maintains a local downtime monitoring table.

[0048] S23. Each node controller monitors the status of the corresponding node according to the local downtime monitoring table.

[0049] S24. When the operating relationship between nodes and containers in the cluster changes, the pre-scheduling controller adjusts the data in the dynamic downtime scheduling prediction table, and each node controller synchronously adjusts the data in the local downtime monitoring table to change the monitoring behavior. For example, when a candidate node is no longer a candidate node for all containers on a working node, the node controller of the candidate node adjusts the local downtime monitoring table and no longer monitors the working node; similarly, if a candidate node is added as a candidate node for any container on a new node that has not been monitored before, the node controller of the candidate node adjusts the local downtime monitoring table and adds monitoring of this node.

[0050] S3. When a node in the cluster goes down, the IP traffic is switched from the down node to a candidate node based on the dynamic downtime scheduling prediction. The container copy of the candidate node is switched from the cold standby state to the hot standby state, and the candidate node becomes the working node.

[0051] Specifically, step S3 includes:

[0052] The node controller of a candidate node performs downtime monitoring on several target nodes according to the local downtime monitoring table.

[0053] When a target node is detected to be down, the node controller of the candidate node switches the local container copy from the cold standby state to the hot standby state based on the predicted container deployment requirements it carries.

[0054] The node controller notifies the SDN controller to switch the flow table data and switch the IP traffic on the down node to the container copy in hot standby state on this node.

[0055] The downtime monitoring and downtime scheduling in the open source solution are both monitored and operated by the control plane. The method provided by the present invention completes the monitoring of downtime nodes, the scheduling triggering and scheduling execution of downtime nodes through the node controller at the bottom level of cluster scheduling, realizes atomic-level scheduling, and reduces the paths of downtime monitoring and downtime scheduling.

[0056] Compared with the multiple scheduling processes from the control plane to the data plane in the existing downtime migration events, the method provided by the present invention completes the scheduling process at the node level, realizes atomic-level scheduling, and achieves a significant optimization of the time consumption of the entire migration process. By adopting distributed redundant replica pre-provisioning, dynamic downtime scheduling prediction and atomic-level scheduling, a more efficient and rapid downtime migration capability is achieved, so that the time required for downtime migration is only the time for switching container replicas and switching flow table data in atomic-level scheduling, and the downtime migration time of more than 1s can be reduced to within 200ms, significantly improving the performance of kubernetes.

[0057] In addition, container replicas in cold standby state are provisioned in advance on each candidate node, which does not occupy actual resources and does not incur additional resource overhead.

[0058] Example 2

[0059] This embodiment provides a computer device, which may be a server or terminal integrated with a scheduler, and its internal structure diagram may be as follows: Figure 3 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data such as the mapping relationship between the shared video memory area and the virtual machine, the total load of the virtual machine, etc. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a Kubernetes downtime rapid migration method is implemented.

[0060] Those skilled in the art will understand that Figure 3 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0061] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0062] Provision cold standby container replicas on each candidate node in advance;

[0063] Perform real-time dynamic downtime scheduling prediction for each node in the cluster;

[0064] When a node in the cluster goes down, the IP traffic is switched from the down node to a candidate node based on the dynamic downtime scheduling prediction. The container replica of the candidate node is switched from the cold standby state to the hot standby state, and the candidate node becomes a working node.

[0065] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0066] The replica controller generates both hot standby container replicas and cold standby container replicas.

[0067] The scheduler schedules the hot standby container replicas to the working nodes and the cold standby container replicas to the candidate nodes according to the normal scheduling logic.

[0068] The node controller of the candidate node starts the container replica in the cold standby state and keeps the container replica in a silent state;

[0069] The SDN controller of the candidate node adds redundant SDN flow table data to the container replica in the cold standby state, keeps the flow table rules silent, and does not access IP traffic.

[0070] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0071] The node controller of the working node starts the container replica in hot standby state and assigns it an IP address;

[0072] The SDN controller of the working node adds SDN flow table data to the container replica in the hot standby state and connects the IP traffic to the container replica in the hot standby state.

[0073] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0074] The pre-scheduling controller establishes a dynamic downtime scheduling prediction table;

[0075] Each node controller listens to the API-Server to obtain the container data that may be migrated to this node and the current running nodes of these containers, and maintains a local downtime monitoring table;

[0076] When the running relationship between nodes and containers in the cluster changes, the pre-scheduling controller adjusts the data in the dynamic downtime scheduling prediction table, and each node controller synchronously adjusts the data in the local downtime monitoring table to change the monitoring behavior.

[0077] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0078] The node controller of a candidate node performs downtime monitoring on several target nodes according to the local downtime monitoring table;

[0079] When a target node is detected to be down, the node controller of the candidate node switches the local container replica from cold standby to hot standby based on the predicted container deployment requirements it carries.

[0080] The node controller notifies the SDN controller to switch the flow table data and switch the IP traffic on the down node to the container copy in hot standby state on this node.

[0081] Example 3

[0082] This embodiment provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:

[0083] Provision cold standby container replicas on each candidate node in advance;

[0084] Perform real-time dynamic downtime scheduling prediction for each node in the cluster;

[0085] When a node in the cluster goes down, the IP traffic is switched from the down node to a candidate node based on the dynamic downtime scheduling prediction. The container replica of the candidate node is switched from the cold standby state to the hot standby state, and the candidate node becomes a working node.

[0086] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0087] The replica controller generates both hot standby container replicas and cold standby container replicas.

[0088] The scheduler schedules the hot standby container replicas to the working nodes and the cold standby container replicas to the candidate nodes according to the normal scheduling logic.

[0089] The node controller of the candidate node starts the container replica in the cold standby state and keeps the container replica in a silent state;

[0090] The SDN controller of the candidate node adds redundant SDN flow table data to the container replica in the cold standby state, keeps the flow table rules silent, and does not access IP traffic.

[0091] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0092] The node controller of the working node starts the container replica in hot standby state and assigns it an IP address;

[0093] The SDN controller of the working node adds SDN flow table data to the container replica in the hot standby state and connects the IP traffic to the container replica in the hot standby state.

[0094] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0095] The pre-scheduling controller establishes a dynamic downtime scheduling prediction table;

[0096] Each node controller listens to the API-Server to obtain the container data that may be migrated to this node and the current running nodes of these containers, and maintains a local downtime monitoring table;

[0097] When the operating relationship between nodes and containers in the cluster changes, the pre-scheduling controller adjusts the data in the dynamic downtime scheduling prediction table, and each node controller synchronously adjusts the data in the local downtime monitoring table to change the monitoring behavior.

[0098] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0099] The node controller of a candidate node performs downtime monitoring on several target nodes according to the local downtime monitoring table;

[0100] When a target node is detected to be down, the node controller of the candidate node switches the local container replica from cold standby to hot standby based on the predicted container deployment requirements it carries.

[0101] The node controller notifies the SDN controller to switch the flow table data and switch the IP traffic on the down node to the container copy in hot standby state on this node.

[0102] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0103] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0104] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the present application. It should be noted that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

[0105] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Therefore, any modification, equivalent change and modification made to the above embodiment based on the technical essence of the present invention without departing from the technical solution of the present invention are still within the scope of the technical solution of the present invention.

Claims

1. A Kubernetes downtime rapid migration method, characterized in that: include: Provision cold standby container replicas on each candidate node in advance; Perform real-time dynamic downtime scheduling prediction for each node in the cluster; When a node in the cluster goes down, the IP traffic is switched from the down node to a candidate node based on the dynamic downtime scheduling prediction. The container replica of the candidate node is switched from the cold standby state to the hot standby state, and the candidate node becomes a working node.

2. The Kubernetes downtime rapid migration method according to claim 1, characterized in that: The step of pre-provisioning a container replica in a cold standby state on each candidate node includes: The replica controller generates both hot standby container replicas and cold standby container replicas. The scheduler schedules the hot standby container replicas to the working nodes and the cold standby container replicas to the candidate nodes according to the normal scheduling logic. The node controller of the candidate node starts the container replica in the cold standby state and keeps the container replica in a silent state; The SDN controller of the candidate node adds redundant SDN flow table data to the container replica in the cold standby state, keeps the flow table rules silent, and does not access IP traffic.

3. The Kubernetes downtime rapid migration method according to claim 2 is characterized in that: The step of pre-provisioning a container replica in a cold standby state on each candidate node also includes: The node controller of the working node starts the container replica in hot standby state and assigns it an IP address; The SDN controller of the working node adds SDN flow table data to the container replica in the hot standby state and connects the IP traffic to the container replica in the hot standby state.

4. The Kubernetes downtime rapid migration method according to claim 3 is characterized in that: The real-time dynamic downtime scheduling prediction for each node in the cluster includes: The pre-scheduling controller establishes a dynamic downtime scheduling prediction table; Each node controller listens to the API-Server to obtain the container data that may be migrated to this node and the current running nodes of these containers, and maintains a local downtime monitoring table; When the operating relationship between nodes and containers in the cluster changes, the pre-scheduling controller adjusts the data in the dynamic downtime scheduling prediction table, and each node controller synchronously adjusts the data in the local downtime monitoring table to change the monitoring behavior.

5. The Kubernetes downtime rapid migration method according to claim 4 is characterized in that: When a node in the cluster goes down, according to the dynamic downtime scheduling prediction, IP traffic is switched from the downtime node to a candidate node, and the container copy of the candidate node is switched from a cold standby state to a hot standby state, and the candidate node becomes a working node, including: The node controller of a candidate node performs downtime monitoring on several target nodes according to the local downtime monitoring table; When a target node is detected to be down, the node controller of the candidate node switches the local container replica from cold standby to hot standby based on the predicted container deployment requirements it carries. The node controller notifies the SDN controller to switch the flow table data and switch the IP traffic on the down node to the container copy in hot standby state on this node.

6. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Backup method and device and server cluster system

    CN113472556A

  • Container cluster protection method and device and storage medium

    CN115952019A

  • Node switching method and device

    CN116319281A

  • Kubernetes dynamic high-availability method, medium and device

    CN117009148A

  • Distributed hot-spare storage in a storage cluster

    US8010829B1