A node migration method, device, apparatus and storage medium

By migrating the container group information of the first cluster to the second cluster in the cloud environment, and intercepting and processing container group creation requests in the second cluster, the problem of business interruption caused by edge node migration was solved, and smooth migration of edge nodes and business continuity were achieved.

CN119814854BActive Publication Date: 2025-11-04CHINA TELECOM CLOUD TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411782305.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2025-11-04
Estimated Expiration
2044-12-05

AI Technical Summary

Technical Problem

In cloud environments, the problem of service interruption during edge node migration in existing technologies is mainly due to the deletion of old single-machine service container Pods after the machine is taken off the rack, and the creation of new single-machine service container Pods when the machine is put back on the rack, resulting in the interruption of online services.

Method used

The container platform sends container group information from the first cluster to the second cluster, establishes a network connection, adds the container to the firewall whitelist, backs up certificates and configuration files, restarts the container group management component, and intercepts and processes container group creation requests in the second cluster to ensure that the container group runs normally on the target node.

Benefits of technology

It enables smooth migration of edge nodes, ensuring uninterrupted business operations and maintaining the load performance of the edge cluster. Through the interception and processing of container group management components, it avoids the deletion and creation of Pods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119814854B_ABST
    Figure CN119814854B_ABST
Patent Text Reader

Abstract

Embodiments of the present application relate to the technical field of cloud computing, in particular to a node migration method and device, equipment and storage medium, aiming to realize node migration while ensuring normal operation of pods. The method comprises: a container platform sends container group information of a container group in a target node in a first cluster to a second cluster; the container platform migrates the target node from the first cluster to the second cluster; a controller in the second cluster sends a container group creation request to a central node of the second cluster according to the container group information, listens to a container group operation initiated by the container platform, and performs a corresponding operation; a container group management component intercepts the container group creation request and receives the container group operation; and the container group management component processes the container group operation according to an operation target and an operation type of the container group operation, so that the container group normally operates in the target node.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the technical field of cloud computing, in particular, relate to a node migration method, device, equipment and storage medium. BACKGROUND

[0002] There are multiple clusters in a cloud environment, different clusters are located in different regions and have different numbers of edge nodes. Due to business reasons, it is often necessary to transfer edge nodes in one cluster to another cluster. In the prior art, a managed edge machine wants to access another cluster, and the conventional operation is to first take the machine offline, delete the node from the original cluster, the old single-machine business container Pod is also deleted, and then the machine is reinstalled in the new cluster to create a new single-machine business container Pod. In the prior art, the machine is first taken offline and then reinstalled, which causes the pod on the edge node to be deleted and then created, resulting in an interruption of online business. SUMMARY

[0003] Embodiments of the present application provide a node migration method, device, equipment and storage medium, aiming to realize node migration while ensuring normal operation of the pod.

[0004] The first aspect of the embodiments of the present application provides a node migration method, the method comprising:

[0005] The container platform sends container group information of a container group in a target node in a first cluster to a second cluster;

[0006] The container platform migrates the target node from the first cluster to the second cluster;

[0007] A controller in the second cluster sends a container group creation request for the target node to a center node of the second cluster according to the container group information, and listens to a container group operation initiated by the container platform and performs corresponding operations;

[0008] A container group management component in the center node intercepts the container group creation request and receives the container group operation;

[0009] The container group management component processes the container group operation according to the operation target and operation type of the container group operation, so that the container group normally operates in the target node.

[0010] Optionally, before the controller in the second cluster sends a container group creation request for the target node to the center node of the second cluster according to the container group information, the method further comprises:

[0011] The container platform queries the corresponding label of the target node in the first cluster from the database of the first cluster;

[0012] The container platform adds the label to the target node in the second cluster;

[0013] The controller determines that the target node joins the second cluster when the label is detected.

[0014] Optionally, the method further comprises: the target node reports container group state information to the center node when migrating to the second cluster;

[0015] The center node queries the corresponding data of the container group in the database of the second cluster according to the container group name contained in the container group state information;

[0016] The center node issues a deletion command to the target node when the corresponding data cannot be found in the database of the second cluster;

[0017] The container group management component intercepts the deletion command.

[0018] Optionally, the container platform sends container group information of a container group in a target node in a first cluster to a second cluster, comprising:

[0019] The container platform stores the container group information in a container group configuration file, and the container group information at least includes each container group name in the target node and the corresponding node name, each container group name in the target node and the corresponding container group number, and all container group names corresponding to the target node;

[0020] The container platform sends the container group configuration file to the second cluster.

[0021] Optionally, the container platform migrates the target node from the first cluster to the second cluster, comprising:

[0022] The container platform establishes network connection between the target node and the second cluster;

[0023] The container platform adds the target node to the white list of the firewall of the second cluster;

[0024] The container platform backs up the certificate and configuration file of the target node in the first cluster;

[0025] The container platform obtains authentication information from the second cluster;

[0026] In a case where the container platform obtains the authentication information, a network address of the center node of the second cluster is written into the configuration file;

[0027] The container platform restarts a container group management component in the target node, and migrates the target node from the first cluster to the second cluster.

[0028] Optionally, the controller in the second cluster sends, according to the container group information, a container group creation request for the target node to a center node of the second cluster, and listens to a container group operation initiated by the container platform, and performs a corresponding operation, including:

[0029] The controller determines whether a node name of the target node matches a node name stored in the container group information in a case where the target node joins the second cluster is detected;

[0030] The controller determines whether the container group creation request has been sent for the target node in a case where the node name of the target node matches the node name stored in the container group information;

[0031] The controller queries a container group name corresponding to the target node in the container group information in a case where it is determined that the container group creation request has not been sent for the target node;

[0032] The controller sends the container group creation request to the center node, and a name field in the container group creation request is the container group name;

[0033] The controller determines whether a deletion timestamp corresponding to the container group is nil in a case where it is listened that the container group operation is an update operation;

[0034] The controller deletes the container group information in a case where the deletion timestamp is not nil;

[0035] The controller deletes the container group information in a case where it is listened that the container group operation is a deletion operation.

[0036] Optionally, the container group management component processes the container group operation according to an operation target and an operation type of the container group operation, including:

[0037] The container group management component determines whether the operation target of the container group operation is a container group in the target node according to the container group information in a case where the operation type of the container group operation is an update operation;

[0038] The container group management component determines whether the deletion timestamp corresponding to the container group is nil when the operation target is the container group in the target node;

[0039] The container group management component replaces the container group number in the container group operation with the container group number corresponding to the container group when the deletion timestamp is not nil;

[0040] The container group management component determines whether the operation target of the container group operation is the container group in the target node according to the container group information when the operation type of the container group is a deletion operation;

[0041] The container group management component replaces the container group number in the container group operation with the container group number corresponding to the container group when the operation target is the container group in the target node;

[0042] The container group management component delivers the container group operation to the target node;

[0043] The container group management component releases the container group operation when the operation target is not the container group in the target node.

[0044] The second aspect of the embodiment of the present application provides a node migration device, and the device comprises:

[0045] A container group information sending module is configured to send container group information of a container group in a target node in a first cluster to a second cluster by a container platform;

[0046] A node migration module is configured to migrate the target node from the first cluster to the second cluster by the container platform;

[0047] A controller operation module is configured to send a container group creation request for the target node to a center node of the second cluster according to the container group information by a controller in the second cluster, and listen to a container group operation initiated by the container platform and perform a corresponding operation;

[0048] An operation interception module is configured to intercept the container group creation request by a container group management component in the center node, and receive the container group operation;

[0049] A container group manager operation module is configured to process the container group operation according to an operation target and an operation type of the container group operation by the container group management component, so that the container group normally runs in the target node.

[0050] Optionally, the device further comprises:

[0051] a label obtaining module, configured to query, by the container platform, a corresponding label of the target node in the first cluster from a database of the first cluster;

[0052] a label adding module, configured to add, by the container platform, the label to the target node in the second cluster;

[0053] a node determining module, configured to determine, by the controller, that the target node is added to the second cluster when the label is detected.

[0054] Optionally, the apparatus further comprises an information reporting module, configured to report, by the target node, container group state information to the central node when the target node is migrated to the second cluster;

[0055] a data querying module, configured to query, by the central node, corresponding data of the container group in a database of the second cluster according to a container group name contained in the container group state information;

[0056] a deletion command issuing module, configured to issue, by the central node, a deletion command to the target node when the corresponding data cannot be found in the database of the second cluster;

[0057] a deletion command intercepting module, configured to intercept, by the container group management component, the deletion command.

[0058] Optionally, the container group information sending module comprises:

[0059] an information storing submodule, configured to store, by the container platform, the container group information in a container group configuration file, the container group information at least comprising each container group name in the target node and a corresponding node name, each container group name in the target node and a corresponding container group number, and all container group names corresponding to the target node;

[0060] a file sending submodule, configured to send, by the container platform, the container group configuration file to the second cluster.

[0061] Optionally, the node migration module comprises:

[0062] a network connection establishing submodule, configured to establish, by the container platform, a network connection between the target node and the second cluster;

[0063] a whitelist submodule, configured to add, by the container platform, the target node to a whitelist of a firewall of the second cluster;

[0064] a certificate obtaining submodule, configured to backup, by the container platform, a certificate and a configuration file of the target node in the first cluster;

[0065] an authentication information obtaining submodule, configured to obtain, by the container platform, authentication information from the second cluster;

[0066] a network address writing submodule, configured to write, by the container platform, a network address of the center node of the second cluster into the configuration file in a case where the authentication information is obtained;

[0067] a restarting submodule, configured to restart, by the container platform, a container group management component in the target node, and migrate the target node from the first cluster to the second cluster.

[0068] Optionally, the controller operation module comprises:

[0069] a first controller operation submodule, configured to determine, by the controller, whether a node name of the target node matches a node name stored in the container group information in a case where it is detected that the target node joins the second cluster;

[0070] a second controller operation submodule, configured to determine, by the controller, whether the container group creation request has been sent for the target node in a case where the node name of the target node matches the node name stored in the container group information;

[0071] a third controller operation submodule, configured to query, by the controller, a container group name corresponding to the target node in the container group information in a case where it is determined that the container group creation request has not been sent for the target node;

[0072] a fourth controller operation submodule, configured to send, by the controller, the container group creation request to the center node, and the name field in the container group creation request is the container group name;

[0073] a fifth controller operation submodule, configured to determine, by the controller, whether a deletion timestamp corresponding to the container group is nil in a case where it is listened that the container group operation is an update operation;

[0074] a sixth controller operation submodule, configured to delete, by the controller, the container group information in a case where the deletion timestamp is not nil;

[0075] a seventh controller operation submodule, configured to delete, by the controller, the container group information in a case where it is listened that the container group operation is a deletion operation.

[0076] Optionally, the container group manager operation module comprises:

[0077] The first container group manager operation submodule is configured to determine, by the container group management component, whether the operation target of the container group operation is a container group in the target node according to the container group information when the operation type of the container group operation is an update operation.

[0078] The second container group manager operation submodule is configured to determine, by the container group management component, whether the deletion timestamp corresponding to the container group is nil when the operation target is a container group in the target node.

[0079] The third container group manager operation submodule is configured to replace, by the container group management component, the container group number in the container group operation with the container group number corresponding to the container group when the deletion timestamp is not nil.

[0080] The fourth container group manager operation submodule is configured to determine, by the container group management component, whether the operation target of the container group operation is a container group in the target node according to the container group information when the operation type of the container group is a deletion operation.

[0081] The fifth container group manager operation submodule is configured to replace, by the container group management component, the container group number in the container group operation with the container group number corresponding to the container group when the operation target is a container group in the target node.

[0082] The sixth container group manager operation submodule is configured to pass, by the container group management component, the container group operation to the target node.

[0083] The seventh container group manager operation submodule is configured to release, by the container group management component, the container group operation when the operation target is not a container group in the target node.

[0084] The third aspect of the embodiments of the present application provides a readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the steps in the method of the first aspect of the present application.

[0085] The fourth aspect of the embodiments of the present application provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor executes the computer program to implement the steps of the method of the first aspect of the present application.

[0086] The node migration method provided in the application is adopted, the container group information of the container group in the target node in the first cluster is sent to the second cluster by the container platform; the container platform migrates the target node from the first cluster to the second cluster; the controller in the second cluster sends a container group creation request for the target node to the center node of the second cluster according to the container group information, and listens to the container group operation initiated by the container platform and performs corresponding operation; the container group management component in the center node intercepts the container group creation request and receives the container group operation; the container group management component processes the container group operation according to the operation target and the operation type of the container group operation, so that the container group normally runs in the target node.

[0087] In the method, the container group information in the first cluster is sent to the second cluster, the target node in the first cluster is migrated to the second cluster, the container group creation operation of the controller is intercepted by the container group management component, and the container group operation of the container platform for the target node is processed, so that the container group will not create a new container group in the target node, while ensuring that the container group operation of the container platform for the target node can be mapped to the original container group of the target node, so as to ensure that the container group in the target node can normally run, thereby ensuring that the corresponding business of the container group does not interrupt, and realizing smooth migration of the edge node. BRIEF DESCRIPTION OF DRAWINGS

[0088] In order to more clearly illustrate the technical solutions of the embodiments of the application, the following will briefly introduce the drawings needed to be used in the description of the embodiments of the application. Obviously, the drawings in the following description are only some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative labor.

[0089] Figure 1 is a flowchart of the node migration method provided in an embodiment of the application;

[0090] Figure 2 is a smooth migration schematic diagram provided in an embodiment of the application;

[0091] Figure 3 is a flowchart of the node migration method provided in an embodiment of the application;

[0092] Figure 4 is a container platform architecture schematic diagram provided in an embodiment of the application;

[0093] Figure 5 is a cluster migration schematic diagram provided in an embodiment of the application;

[0094] Figure 6is a controller execution flow diagram proposed by an embodiment of the present application;

[0095] Figure 7 is a container group management component flow diagram proposed by an embodiment of the present application;

[0096] Figure 8 is an operation processing diagram proposed by an embodiment of the present application;

[0097] Figure 9 is a schematic diagram of a node migration device proposed by an embodiment of the present application;

[0098] Figure 10 is a schematic diagram of an electronic device proposed by an embodiment of the present application. DETAILED DESCRIPTION

[0099] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.

[0100] For the convenience of explanation, first, the professional terms appearing in the embodiments are explained:

[0101] KubeEdge (container group management component): KubeEdge is an open source system that extends native containerized business processes and device management to edge hosts. It is built based on Kubernetes and provides core infrastructure support for network, application deployment, and metadata synchronization between the cloud and the edge. KubeEdge mainly includes cloudcore and edgecore, cloudcore runs on the central node, and edgecore runs on the edge node

[0102] Edge node: the central node of the central cluster accessed through KubeEdge, located on the edge side.

[0103] playbook: is a playbook used by ansible to configure, deploy, and manage the controlled node. Through the detailed description of the playbook, the tasks in it can be executed to make the remote host reach the expected state.

[0104] Currently, more and more enterprises use Kubernetes to build and deploy enterprise application services, the main reason is that Kubernetes provides powerful and flexible container orchestration and management functions, which can help enterprises build and manage highly scalable cloud-native applications, Kubernetes allows enterprises to dynamically adjust the scale of the application according to the needs of the load, so as to realize elastic expansion. It can automatically handle the scheduling and resource allocation of containers, reducing the burden on operation and maintenance personnel, while ensuring the high availability and scalability of the application. Enterprises using Kubernetes can help them build modern, scalable and highly reliable applications, improve development efficiency, reduce operation and maintenance costs, and achieve cross-platform and multi-cloud flexibility and portability.

[0105] KubeEdge is an extension based on K8s, which depends on Kubernetes. For enterprises, edge machines are located in various parts of the country, and the network channel distance between the edge machines and the center node is different. The traditional Kubernetes access requires real-time performance. Considering the instability of the network, using KubeEdge access can achieve edge autonomy, and the performance of the cloud edge channel is improved through the underlying optimized multiplexing message channel, thereby reducing the network bandwidth demand between the edge and the cloud. The plug-in approach also ensures its lightweight and performance.

[0106] Currently, there are multiple clusters in the production environment based on CDN business, different clusters are located in different regions and have different numbers of edge nodes, and because it is a CDN business scenario, the production environment uses a DaemonSet controller to deploy business containers. A single machine and a single component have and only have one business container Pod.

[0107] A managed edge machine wants to access another cluster. The conventional operation is to first unshelve the machine, delete the node from the original cluster, and the old single-machine business container Pod will also be deleted. Then, the machine is re-shelved to the new cluster, and a new single-machine business container Pod is created. The entire process involves machine unshelving and re-shelving, which will cause the Pod on the edge node to be deleted and then created, and the online business will be interrupted for a short time. The present application adopts the concept of cloud native, and proposes a system and method for smooth migration of edge nodes based on KubeEdge, which completes the smooth migration of edge nodes from the original cluster to the new cluster, avoids the deletion and creation of Pods, and finally realizes the smooth migration goal without interrupting the business, and maintains the load performance of the edge cluster.

[0108] Reference Figure 1 , Figure 1 is a schematic diagram of cluster node migration, such as Figure 1As shown, when node3 migrates, pod1, pod2, and pod3 will be deleted, and after node3 joins edge cluster 2, pod4, pod5, and pod6 will be newly created.

[0109] Embodiments of the present application propose a system and method for smooth migration of edge nodes based on KubeEdge, which stores the relevant information of the edge node based on the ConfigMap (configuration file storing node and container information) feature and issues it to the pre-access cluster, listens to events based on the Informer, and the controller initiates the request for creating a Pod and the data cleaning of ConfigMap on the edge node, realizes a special "mapping" of the new and old Pods of the edge node based on the KubeEdge edge computing framework, and finally achieves the purpose of smooth transition of the edge node.

[0110] Reference Figure 2 , Figure 2 is a smooth migration schematic diagram proposed by an embodiment of the present application, as shown in Figure 2 After node3 migrates from edge cluster 1 to edge cluster 2, the original pod1, pod2, and pod3 are mapped to edge cluster 2, and the original pods do not need to be closed, which ensures that the business does not interrupt.

[0111] Reference Figure 3 , Figure 3 is a flowchart of a node migration method proposed by an embodiment of the present application. As shown in Figure 3 , the method comprises the following steps:

[0112] S11: The container platform sends the container group information of the container group in the target node in the first cluster to the second cluster.

[0113] Reference Figure 4 , Figure 4 is a container platform architecture schematic diagram proposed by an embodiment of the present application, as shown in Figure 4 The container platform connects multiple edge clusters, each edge cluster has a center node (master) and multiple edge nodes (node1, node2), and the edge node that needs to be migrated is the target node. The center node has an api-server (‌which is one of the core components of the Kubernetes cluster, responsible for handling all RESTful API requests to the cluster, and is the interface between users, external tools and internal components of the system.) and cloudcoer (container group management component), and the edgecore in the edge node is also part of the container group management component. The controller is located in the center node and is used to create a container group and manage container group information. The container platform is a platform for managing container groups (pods) in the cluster.

[0114] In this embodiment, the container platform manages multiple clusters, and the multiple clusters are located in different regions and have different numbers of nodes. When a node wants to migrate from an original cluster (a first cluster) to a new cluster (a second cluster), in order to ensure smooth migration of the business, the container group information stored in the first cluster needs to be stored in a container group configuration file (ConfigMap) in a specified format first, and then sent to the second cluster.

[0115] In this embodiment, the container platform sends the container group information of the container groups in the target nodes in the first cluster to the second cluster, and the specific steps include:

[0116] S11-1: The container platform stores the container group information in a container group configuration file, and the container group information at least includes each container group name in the target nodes and the corresponding node name, each container group name in the target nodes and the corresponding container group number, and all container group names corresponding to the target nodes.

[0117] Reference Figure 5 , Figure 5 is a cluster migration schematic diagram proposed in an embodiment of the present application, as shown in Figure 5 , an operator first selects a machine to be migrated, i.e., a target node. In the pre-migration process, the container group information is first added to the container group configuration file, and then sent to the expected cluster (the second cluster). The container group information at least includes three sub-ConfigMaps: white-pod-node, all podName (container group name) and the corresponding node name (key-value pair: podName:nodeName,) on the migrated node, which is mainly used to query the ConfigMap to clean up other ConfigMap information sent by the container platform after the original Pod on the edge node is deleted. white-pods: all podName and podUid (container group number) of the pods on the migrated node (key-value pair: podName:PodUid), which is mainly used to tamper with the message transmission between the center and the edge segment of the old and new Pods, so as to realize the smooth transition of the business. white-nodes: all podName corresponding to the node on the migrated node (key-value pair: nodeName:podName1, podName2), which is mainly used to control the controller to initiate a request to create a new Pod with the same name as the old Pod in the expected cluster.

[0118] S11-2: The container platform sends the container group configuration file to the second cluster.

[0119] In this embodiment, the container platform sends the container group configuration file to the second cluster, and the second cluster obtains the corresponding container group information.

[0120] S12: The container platform migrates the target node from the first cluster to the second cluster.

[0121] In this embodiment, the container platform migrates the target node from the first cluster to the second cluster, and the specific steps include:

[0122] S12-1: The container platform establishes a network connection between the target node and the second cluster.

[0123] In this embodiment, the container platform establishes a network connection between the target node and the second cluster.

[0124] S12-2: The container platform adds the target node to the white list of the firewall of the second cluster.

[0125] In this embodiment, the container platform adds the target node to the white list of the firewall of the second cluster, so as to ensure that the connection between the target node and the second cluster is not intercepted.

[0126] S12-3: The container platform backs up the certificate and configuration file of the target node in the first cluster.

[0127] In this embodiment, the container platform backs up the certificate and configuration file of the target node in the first cluster. The certificate is used to ensure the security of information transmission in the cluster, and the data can be authenticated through the certificate.

[0128] S12-4: The container platform obtains authentication information from the second cluster.

[0129] In this embodiment, the container platform obtains authentication information from the second cluster, and can access the second cluster only after obtaining the authentication information.

[0130] S12-5: In the case where the container platform obtains the authentication information, the network address of the center node of the second cluster is written into the configuration file.

[0131] In this embodiment, in the case where the container platform obtains the authentication information, the network address of the center node of the second cluster is written into the configuration file.

[0132] S12-6: The container platform restarts the container group management component in the target node, and migrates the target node from the first cluster to the second cluster.

[0133] In this embodiment, the container platform restarts the container group management component in the target node, loads the configuration file, and then migrates the target node from the first cluster to the second cluster.

[0134] In this embodiment, as Figure 5As shown, the playbook (white) connects the edge node and the network of the target cluster, white lists the firewall, avoids the edge node from connecting to the cluster center node, at the same time, the platform stores the information of the Pod running in the old cluster in the ConfigMap and issues it to the target cluster. After the white list and ConfigMap are issued, the playbook (migration) backs up the certificate and configuration file of the original cluster, then obtains the authentication token (authentication information) from the target cluster, and writes the IP value of the center node into the configuration file, and restarts the edgecore, which connects to the target cluster.

[0135] In this embodiment, if the connection fails, the original certificate and configuration file are restored through the playbook (recovery), and the edge node is reconnected to the original cluster, and the platform side deletes the related data in the ConfigMap.

[0136] In this embodiment, the method further comprises:

[0137] S12-7: The container platform queries the corresponding label of the target node in the first cluster from the database of the first cluster.

[0138] In this embodiment, the label of the target node is a label set by the container platform for the target cluster, which represents the business characteristics of the container group in the target node.

[0139] In this embodiment, after the migration is completed, the container platform queries the corresponding label of the target node in the first cluster from the database of the first cluster.

[0140] S12-8: The container platform adds the label to the target node in the second cluster.

[0141] In this embodiment, the container platform adds the label of the target node in the first cluster to the target node in the second cluster, so as to keep the consistency of the business label of the target node in the two clusters.

[0142] S12-9: The controller determines that the target node is added to the second cluster when detecting the label.

[0143] In this embodiment, the controller in the second cluster determines that the target node is added to the second cluster when detecting the label on the target node.

[0144] S13: The controller in the second cluster issues a container group creation request for the target node to the center node of the second cluster according to the container group information, and listens to the container group operation initiated by the container platform and performs corresponding operation.

[0145] In this embodiment, the controller in the second cluster sends a container group creation request to the center node of the second cluster according to the container group information to create a new container group for the target node, and listens to a container group operation initiated by the container platform, and performs a corresponding operation according to the container group operation. The specific steps include:

[0146] S13-1: The controller determines whether the node name of the target node matches the node name stored in the container group information when detecting that the target node joins the second cluster.

[0147] In this embodiment, Figure 6 is a controller execution flow diagram proposed by an embodiment of the application. As shown in Figure 6 When the controller detects that the target node joins the second cluster, it determines whether the node name of the target node matches the node name stored in the container group information, queries the ConfigMap (white-node) which stores the node name of the migrated node, and judges whether the node name of the new pod needs to be created. If it does not exist, it represents a normally mounted machine, not a migrated machine, and a random name can be taken for the new Pod.

[0148] S13-2: The controller determines whether the container group creation request has been sent for the target node when the node name of the target node matches the node name stored in the container group information.

[0149] In this embodiment, as shown in Figure 6 When the node name of the target node matches the node name stored in the container group information, the controller determines whether the container group creation request has been sent for the target node, queries the PodInformer (container group information list), and judges whether a new Pod has been created before. If it exists, it is randomly created. This query is mainly for the upgrade scenario (new Pod is created first, and old Pod is deleted later). In the upgrade scenario, the original container group is upgraded, which can ensure that the business does not interrupt and avoid conflicts.

[0150] S13-3: The controller queries the container group name corresponding to the target node in the container group information when it is determined that the container group creation request has not been sent for the target node.

[0151] In this embodiment, as shown in Figure 6The controller queries the container group name corresponding to the target node in the container group information when it is determined that no container group creation request has been sent to the target node, i.e., the container is created for the target node for the first time. When the controller creates a new Pod for the node for the first time, the podName corresponding to the nodeName is found according to the matching of the workload name and the white-nodes.

[0152] S13-4: The controller sends the container group creation request to the center node, and the name field in the container group creation request is the container group name.

[0153] In this embodiment, as shown in the figure, the controller initiates a request for creating a pod to the api-server of the center node, and the Name field of the pod in the request is set to the PodName queried in the previous step. Figure 6

[0154] S13-5: The controller determines whether the delete timestamp corresponding to the container group is nil when it is determined that the container group operation is an update operation.

[0155] In this embodiment, as shown in the figure, when the controller creates a Pod for the migrated node for the first time, the real Pod in the original cluster will also be deleted after the platform deletes the Pod. To avoid the Pod created for the corresponding component from the ConfigMap (white-nodes) query the corresponding podName to create the request, which is intercepted by the cloudcore, the pod event needs to be listened to, and the container group configuration information issued by the container platform needs to be cleaned up. Figure 6

[0156] In this embodiment, when the controller listens to the container group operation as an update operation, it determines whether the delete timestamp (deleteTimeStamp) corresponding to the container group is nil (empty character). If the delete timestamp is not nil, it represents that the update operation is an update event before the deletion event, and the container group information needs to be deleted. If the delete timestamp is nil, it represents a normal update event, and the container group information does not need to be deleted.

[0157] S13-6: The controller deletes the container group information when the delete timestamp is nil.

[0158] ​​In this embodiment, the controller deletes the corresponding container group information in the target node when the delete timestamp is nil. It is judged whether the deleteTimeStamp is nil. If the deleteTimeStamp is not nil, the corresponding data in white-nodes, white-pods and white-pod-node is deleted.

[0159] S13-7: The controller deletes the container group information when it is found that the container group operation is a deletion operation.

[0160] In this embodiment, the controller deletes the container group information when it is found that the container group operation is a deletion operation. The corresponding data in white-nodes, white-pods and white-pod-node is deleted.

[0161] S14: The container group management component in the center node intercepts the container group creation request and receives the container group operation.

[0162] In this embodiment, it is referred to Figure 7 , Figure 7 is a container group management component flow diagram proposed in an embodiment of the application, as Figure 7 shown, the edge node establishes a connection through kubeEdge, registers the node to the center node, and reports the podStatus of the original old pod to the center node when the center node and the edge node establish a connection. Under normal circumstances, when the center node receives the state message reported by the edge, it will query the pod data from the apiserver and update the state. However, because the old pod is not stored in the database of the expected cluster center node, it will be deleted by the center node because it cannot be queried. Therefore, it is necessary to modify to avoid the deletion of the old pod. Secondly, after the controller monitors the access of the new node and labels it, the controller will initiate a request to create a new pod with the same name. In order to realize the smooth transition of the business, the new pod is not allowed to be created on the edge, and the corresponding request needs to be intercepted. Therefore, it is necessary to modify the cloudcore end of kubeEdge.

[0163] In this embodiment, the container group management component in the center node intercepts the container group creation request and receives the container group operation.

[0164] In this embodiment, the request for creating a new pod with the same name sent by the controller is transmitted to the DownStreamController of the center node cloudcore through the api-server to perform message distribution processing.

[0165] S15: The container group management component processes the container group operation according to the operation target and the operation type of the container group operation, so that the container group normally runs in the target node.

[0166] In this embodiment, the container group management component processes the container group operation according to the operation target and the operation type of the container group operation, so that the container group normally runs in the target node. The specific steps include:

[0167] S15-1: In the case where the operation type of the container group operation is an update operation, the container group management component determines whether the operation target of the container group operation is a container group in the target node according to the container group information.

[0168] In this embodiment, reference is made to Figure 8 , Figure 8 is an operation processing schematic diagram proposed in an embodiment of the present application. As shown in Figure 8 , in the case where the operation type of the container group operation is an update operation, the container group management component determines whether the operation target of the container group operation is a container group in the target node.

[0169] S15-2: In the case where the operation target is a container group in the target node, the container group management component determines whether the deletion timestamp corresponding to the container group is nil.

[0170] In this embodiment, as shown in Figure 8 , in the case where the operation target is a container group in the target node, the container group management component determines whether the deletion timestamp corresponding to the container group is nil. If it is not nil, it means that the operation is an update operation before the deletion operation. If it is nil, it means that it is a normal update operation.

[0171] S15-3: In the case where the deletion timestamp is not nil, the container group management component replaces the container group number in the container group operation with the container group number corresponding to the container group.

[0172] In this embodiment, as shown in Figure 8 , in the case where the deletion timestamp is not nil, the container group management component replaces the container group number (podUid) in the container group operation with the container group number corresponding to the container group, and then sends the container group operation to the edge node (target node). If the deletion timestamp is nil, the container group operation is intercepted.

[0173] S15-4: In the case where the operation type of the container group is a deletion operation, the container group management component determines whether the operation target of the container group operation is a container group in the target node according to the container group information.

[0174] In this embodiment, as shown in Figure 8 The container group management component determines whether the operation target of the container group operation is a container group in the target node according to the container group information in the case that the operation type of the container group is a deletion operation.

[0175] S15-5: The container group management component replaces the container group number in the container group operation with the container group number corresponding to the container group in the target node in the case that the operation target is the container group in the target node.

[0176] In this embodiment, as shown in Figure 8 The container group management component replaces the container group number in the container group operation with the container group number corresponding to the container group in the target node in the case that the operation target is the container group in the target node.

[0177] S15-6: The container group management component delivers the container group operation to the target node.

[0178] In this embodiment, as shown in Figure 8 The container group management component delivers the container group operation to the target node after replacing the container group number.

[0179] S15-7: The container group management component releases the container group operation in the case that the operation target is not the container group in the target node.

[0180] In this embodiment, as shown in Figure 8 The container group management component determines that the container group operation is not for the container group in the target node in the case that the operation target is not the container group in the target node, and releases the container group operation at this time.

[0181] In this embodiment, as shown in Figure 7As shown, for a create operation (add), the white-pods are first queried to determine if it is a pod being migrated from a migration node. If not, it's a regular pod and is allowed to proceed normally. If it is, the message needs to be intercepted to prevent it from being passed to the edge (i.e., the target node). For an update operation (modify), the white-pods are first queried to determine if it is a pod being migrated from a migration node. If not, it's a regular pod and is allowed to proceed normally. If it is, the deleteTimeStamp in the update event is checked to see if it is nil. If not, the message is intercepted. If it replaces the PodUid in the message, the message is allowed to be passed to the edge. The edge node uses the PodUid and PodName to find the old Pod, completing the mapping between the old and new Pods. The new pod is not actually created on the target node; it's only perceived as a new pod in the central node's concept. For a delete event (delete), the white-pods are first queried to determine if it is a pod being migrated from a migration node. If not, it's a regular pod and is allowed to proceed normally. If it is, the PodUid in the message is replaced, and the message is allowed to be passed to the edge node.

[0182] In this embodiment, the main purpose of different event handling methods is to achieve a special mapping between the old Pods on the migration node and the newly created Pods on the controller by modifying the communication messages between the cloud and the edge. Although the new Pod created by the controller is not actually created on the edge node, it has the same name as the old Pod and its data is stored in the cloud database. Therefore, the PodStatus reported by the edge will be transmitted and synchronized to the PodStatus of the new Pod, ultimately completing the smooth transition of the edge node and ensuring uninterrupted service. When the central node deletes a new Pod, due to the modification of the messages between the cloud and the edge, the original old Pod on the edge node will eventually be deleted, completing the smooth migration.

[0183] In this embodiment, the method further includes: S17: When the target node migrates to the second cluster, it reports the container group status information to the central node.

[0184] In this embodiment, the container group status information (PodStatus) includes the current lifecycle status of the container group.

[0185] In this embodiment, as Figure 7 As shown, when the target node migrates to the second cluster, it reports the container group status information to the central node.

[0186] S18: The central node queries the corresponding data of the container group in the database of the second cluster based on the container group name contained in the container group status information.

[0187] In this embodiment, as shown in Figure 7 The central node queries the corresponding data of the container group in the database of the second cluster according to the container group name contained in the container group state information.

[0188] S19: In the case that the central node cannot find the corresponding data in the database of the second cluster, the central node issues a deletion command to the target node.

[0189] In this embodiment, as shown in Figure 7 In the case that the central node cannot find the corresponding data in the database of the second cluster, the central node issues a deletion command to the target node, because the container group information of the target node is not stored in the database of the second cluster.

[0190] S110: The container group management component intercepts the deletion command.

[0191] In this embodiment, the container group manager intercepts the deletion command in order to prevent the container group of the target node from being deleted.

[0192] In this embodiment, as shown in Figure 9 The edge node reports a podStatus state message, the message is delivered to the UpStreamController component through the cloudhub, the UpStreamController queries the information from the apiServer according to the podName, if the information can be queried, the Status of the pod is updated normally, if the information cannot be queried, whether the pod exists in the white-pods is queried again, if the pod does not exist, the pod is deleted normally, if the pod exists, it represents an old pod of the migration node, the deletion message is intercepted to avoid the old pod from being deleted, thereby avoiding business interruption.

[0193] In the above embodiments of the present application, a system and method for smooth migration of edge nodes based on KubeEdge are proposed. The storage, delivery and cleaning of Pod data and Node data are completed based on the event callback of ConfigMap and Informer. By tampering with the content of messages of the cloud end and edge nodes of kubeEdge and intercepting messages in different scenarios, the center node can deliver messages to a newly established container group, while the actual operation can be mapped to the original container group in the target node after processing. The original container group is used to execute the business in the target node, realizing uninterrupted business. In terms of business stability, the conventional edge node needs to go through the process of unloading and then loading when migrating from one cluster to another. The original Pod will be deleted, and the business will be interrupted. However, the smooth migration of edge nodes based on KubeEdge does not delete the container, which can ensure the stable operation of the business. In terms of maintaining the load performance of the cluster, the number of nodes owned by different clusters in the production environment is different. If the number of edge nodes in some clusters is too large, it will cause a large pressure on the center end and lead to performance problems. The smooth migration of edge nodes can maintain the access of edge nodes and control the number of nodes between different clusters without affecting the business. Thus, the migration of edge nodes is realized while the business on the edge nodes is uninterrupted.

[0194] Based on the same inventive concept, an embodiment of the present application provides a node migration device. Referring to Figure 9 , Figure 9 is a schematic diagram of a node migration device 900 according to an embodiment of the present application. As shown in Figure 10 , the device includes:

[0195] A container group information sending module 901 is configured to send container group information of a container group in a target node in a first cluster to a second cluster by a container platform.

[0196] A node migration module 902 is configured to migrate the target node from the first cluster to the second cluster by the container platform.

[0197] A controller operation module 903 is configured to send a container group creation request for the target node to a center node of the second cluster according to the container group information by a controller in the second cluster, and listen to a container group operation initiated by the container platform and perform a corresponding operation.

[0198] An operation interception module 904 is configured to intercept the container group creation request and receive the container group operation by a container group management component in the center node.

[0199] The container group manager operation module 905 is configured to process the container group operation according to the operation target and the operation type of the container group operation, so that the container group normally runs in the target node.

[0200] Optionally, the apparatus further comprises:

[0201] The label obtaining module is configured to query, by the container platform, the corresponding label of the target node in the first cluster from a database of the first cluster.

[0202] The label adding module is configured to add, by the container platform, the label to the target node in the second cluster.

[0203] The node determining module is configured to determine, by the controller, that the target node joins the second cluster when the label is detected.

[0204] Optionally, the apparatus further comprises an information reporting module configured to report, by the target node, container group state information to the center node when the target node is migrated to the second cluster.

[0205] The data querying module is configured to query, by the center node, corresponding data of the container group in a database of the second cluster according to a container group name contained in the container group state information.

[0206] The delete command issuing module is configured to issue, by the center node, a delete command to the target node when the corresponding data cannot be found in the database of the second cluster.

[0207] The delete command intercepting module is configured to intercept, by the container group management component, the delete command.

[0208] Optionally, the container group information sending module comprises:

[0209] The information storage submodule is configured to store, by the container platform, the container group information in a container group configuration file, wherein the container group information at least comprises each container group name in the target node and a corresponding node name, each container group name in the target node and a corresponding container group number, and all container group names corresponding to the target node.

[0210] The file sending submodule is configured to send, by the container platform, the container group configuration file to the second cluster.

[0211] Optionally, the node migration module comprises:

[0212] The network connection establishing submodule is configured to establish, by the container platform, a network connection between the target node and the second cluster.

[0213] a white list sub-module, configured to add the target node to a white list of a firewall of the second cluster by the container platform;

[0214] a certificate obtaining sub-module, configured to back up a certificate and a configuration file of the target node in the first cluster by the container platform;

[0215] an authentication information obtaining sub-module, configured to obtain authentication information from the second cluster by the container platform;

[0216] a network address writing sub-module, configured to write a network address of the center node of the second cluster into the configuration file in a case where the authentication information is obtained by the container platform;

[0217] a restarting sub-module, configured to restart a container group management component in the target node, and migrate the target node from the first cluster to the second cluster by the container platform.

[0218] Optionally, the controller operation module comprises:

[0219] a first controller operation sub-module, configured to determine whether a node name of the target node matches a node name stored in the container group information by the controller in a case where it is detected that the target node is added into the second cluster;

[0220] a second controller operation sub-module, configured to determine whether the container group creation request has been sent for the target node by the controller in a case where the node name of the target node matches the node name stored in the container group information;

[0221] a third controller operation sub-module, configured to query a container group name corresponding to the target node in the container group information by the controller in a case where it is determined that the container group creation request has not been sent for the target node;

[0222] a fourth controller operation sub-module, configured to send the container group creation request to the center node by the controller, wherein a name field in the container group creation request is the container group name;

[0223] a fifth controller operation sub-module, configured to determine whether a deletion timestamp corresponding to the container group is nil by the controller in a case where it is listened that the container group operation is an update operation;

[0224] a sixth controller operation sub-module, configured to delete the container group information by the controller in a case where the deletion timestamp is not nil;

[0225] The seventh controller operation submodule is configured to delete the container group information when the controller listens to the container group operation as a deletion operation.

[0226] Optionally, the container group manager operation module comprises:

[0227] The first container group manager operation submodule is configured to determine, by the container group management component, whether the operation target of the container group operation is a container group in the target node according to the container group information when the operation type of the container group operation is an update operation.

[0228] The second container group manager operation submodule is configured to determine, by the container group management component, whether the deletion timestamp corresponding to the container group is nil when the operation target is a container group in the target node.

[0229] The third container group manager operation submodule is configured to replace, by the container group management component, the container group number in the container group operation with the container group number corresponding to the container group when the deletion timestamp is not nil.

[0230] The fourth container group manager operation submodule is configured to determine, by the container group management component, whether the operation target of the container group operation is a container group in the target node according to the container group information when the operation type of the container group is a deletion operation.

[0231] The fifth container group manager operation submodule is configured to replace, by the container group management component, the container group number in the container group operation with the container group number corresponding to the container group when the operation target is a container group in the target node.

[0232] The sixth container group manager operation submodule is configured to pass, by the container group management component, the container group operation to the target node.

[0233] The seventh container group manager operation submodule is configured to release, by the container group management component, the container group operation when the operation target is not a container group in the target node.

[0234] Based on the same inventive concept, another embodiment of the present application provides a readable storage medium having a computer program stored thereon, the program being executed by a processor to implement the steps in the node migration method according to any one of the above embodiments of the present application.

[0235] Based on the same inventive concept, another embodiment of the present application provides an electronic device, Figure 1is a schematic diagram of an electronic device 1000 according to an embodiment of the present application, comprising a memory 1001, a processor 1002, and a computer program stored in the memory and capable of running on the processor, wherein the processor implements the steps of the node migration method according to any one of the embodiments of the present application when running.

[0236] For the apparatus embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts are described in the part of the method embodiment.

[0237] Each of the embodiments in the present specification is described in a progressive manner, and each embodiment focuses on the difference from other embodiments. The same and similar parts of each embodiment can be referred to each other.

[0238] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, apparatus, or computer program product. Therefore, the embodiments of the present application can be in the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. In addition, the embodiments of the present application can be in the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0239] The embodiments of the present application are described with reference to flowcharts and / or block diagrams according to the method, terminal device (system), and computer program product of the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of the flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to produce a machine, so that the instructions executed by the computer or other programmable data processing terminal device produce a device implemented in the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 an apparatus that performs the functions specified in one or more blocks.

[0240] These computer program instructions can also be stored in a computer-readable memory capable of causing a computer or other programmable data processing terminal device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product comprising instruction apparatus, which implements the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 an apparatus that performs the functions specified in one or more blocks.

[0241] These computer program instructions can also be loaded into a computer or other programmable data processing terminal device, so that a series of operational steps are performed on the computer or other programmable terminal device to generate a computer-implemented process, thus the instructions executed on the computer or other programmable terminal device provide a process for implementing the functions specified in the flowchart Figure 1 one flow or multiple flows and / or blocks ​ one block or multiple blocks.

[0242] Although the preferred embodiments of the present application have been described, those skilled in the art who understand the basic inventive concept after getting to know the present application can make additional changes and modifications to the embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the embodiments of the present application.

[0243] Finally, it should also be noted that, in this document, relational terms such as first and second and the like can only be used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the terms "comprising", "including" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such a process, method, article or terminal device. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article or terminal device including the element.

[0244] The node migration method, device, equipment and storage medium provided by the present application are described in detail above, and the principles and implementation manners of the present application are described by applying specific examples; the above embodiment descriptions are only used to help understand the method of the present application and its core idea; meanwhile, for those skilled in the art, according to the idea of the present application, the specific implementation manner and application range can be changed; in conclusion, the content of the present description should not be understood as limiting the present application.

Claims

1. A method of node migration, the method comprising: The method comprises: The container platform sends container group information of a container group in a target node in a first cluster to a second cluster; The container platform migrates the target node from the first cluster to the second cluster; A controller in the second cluster sends a container group creation request for the target node to a center node of the second cluster according to the container group information, and listens to a container group operation initiated by the container platform and performs a corresponding operation; A container group management component in the center node of the second cluster intercepts the container group creation request and receives the container group operation; The container group management component processes the container group operation according to an operation target and an operation type of the container group operation, so that the container group normally runs in the target node; The container platform migrates the target node from the first cluster to the second cluster, comprising: The container platform establishes network connection of the target node with the second cluster; The container platform adds the target node to a white list of a firewall of the second cluster; The container platform backs up a certificate and a configuration file of the target node in the first cluster; The container platform obtains authentication information from the second cluster; In a case where the container platform obtains the authentication information, the container platform writes a network address of the center node of the second cluster into the configuration file; The container platform restarts a container group management component in the target node, and migrates the target node from the first cluster to the second cluster; The controller in the second cluster sends a container group creation request for the target node to the center node of the second cluster according to the container group information, and listens to a container group operation initiated by the container platform and performs a corresponding operation, comprising: The controller determines whether a node name of the target node matches a node name stored in the container group information in a case where the target node is detected to be added to the second cluster; The controller determines whether the container group creation request has been sent for the target node in a case where the node name of the target node matches the node name stored in the container group information; The controller queries a container group name corresponding to the target node in the container group information in a case where it is determined that the container group creation request has not been sent for the target node; The controller sends the container group creation request to the center node, and a name field in the container group creation request is the container group name; The controller determines whether a deletion timestamp corresponding to the container group is nil in a case where it is listened that the container group operation is an update operation; The controller deletes the container group information in a case where the deletion timestamp is not nil; The controller deletes the container group information in a case where it is listened that the container group operation is a deletion operation.

2. The node migration method of claim 1, wherein, Before the controller in the second cluster sends a container group creation request for the target node to a center node of the second cluster according to the container group information, the method further comprises: The container platform queries corresponding labels of the target node in the first cluster from a database of the first cluster; The container platform adds the labels to the target node in the second cluster; The controller determines that the target node joins the second cluster when the labels are detected.

3. The node migration method of claim 1, wherein, The method further comprises: the target node reports container group state information to the center node when migrating to the second cluster; The center node queries corresponding data of the container group in the database of the second cluster according to a container group name contained in the container group state information; The center node issues a deletion command to the target node when the corresponding data cannot be found in the database of the second cluster; The container group management component intercepts the deletion command.

4. The node migration method of claim 1, wherein, The container platform sends container group information of a container group in a target node in a first cluster to a second cluster, comprising: The container platform stores the container group information in a container group configuration file, wherein the container group information at least comprises each container group name in the target node and corresponding node name, each container group name in the target node corresponding to a container group number, and all container group names corresponding to the target node; The container platform sends the container group configuration file to the second cluster.

5. The node migration method of claim 1, wherein, The container group management component processes the container group operation according to an operation target and an operation type of the container group operation, comprising: When the operation type of the container group operation is an update operation, the container group management component determines whether the operation target of the container group operation is a container group in the target node according to the container group information; When the operation target is the container group in the target node, the container group management component determines whether a deletion timestamp corresponding to the container group is nil; When the deletion timestamp is not nil, the container group management component replaces a container group number in the container group operation with a container group number corresponding to the container group; When the operation type of the container group is a deletion operation, the container group management component determines whether the operation target of the container group operation is a container group in the target node according to the container group information; When the operation target is the container group in the target node, the container group management component replaces a container group number in the container group operation with a container group number corresponding to the container group; The container group management component transmits the container group operation to the target node; When the operation target is not the container group in the target node, the container group management component releases the container group operation.

6. A node migration apparatus characterized by comprising: The device comprises: A container group information sending module for the container platform to send container group information of a container group in a target node in a first cluster to a second cluster; a node migration module, configured to migrate the target node from the first cluster to the second cluster by the container platform; a controller operation module, configured to send a container group creation request for the target node to a center node of the second cluster according to the container group information by a controller in the second cluster, and listen to a container group operation initiated by the container platform and perform a corresponding operation; an operation interception module, configured to intercept the container group creation request by a container group management component in the center node, and receive the container group operation; a container group manager operation module, configured to process the container group operation according to an operation target and an operation type of the container group operation, so that the container group normally runs in the target node; the container platform migrates the target node from the first cluster to the second cluster, including: the container platform establishes network connection between the target node and the second cluster; the container platform adds the target node to a white list of a firewall of the second cluster; the container platform backs up a certificate and a configuration file of the target node in the first cluster; the container platform obtains authentication information from the second cluster; in a case where the container platform obtains the authentication information, the container platform writes a network address of the center node of the second cluster into the configuration file; the container platform restarts a container group management component in the target node, and migrates the target node from the first cluster to the second cluster; the controller in the second cluster sends the container group creation request for the target node to the center node of the second cluster according to the container group information, and listens to the container group operation initiated by the container platform and performs a corresponding operation, including: the controller determines whether a node name of the target node matches a node name stored in the container group information in a case where the target node is detected to be added to the second cluster; the controller determines whether the container group creation request has been sent for the target node in a case where the node name of the target node matches the node name stored in the container group information; the controller queries a container group name corresponding to the target node in the container group information in a case where it is determined that the container group creation request has not been sent for the target node; the controller sends the container group creation request to the center node, and a name field in the container group creation request is the container group name; the controller determines whether a deletion timestamp corresponding to the container group is nil in a case where it is listened that the container group operation is an update operation; the controller deletes the container group information in a case where the deletion timestamp is not nil; the controller deletes the container group information in a case where it is listened that the container group operation is a deletion operation.

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

8. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor, when executing the computer program, implements the steps of the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Container scheduling system, method, device and equipment

    CN111767145A

  • Container migration method and device of container cluster management system, equipment and medium

    CN116668271A