CN115599501A - Method, system, equipment and storage medium for migrating kubernets containers - Google Patents

Method, system, equipment and storage medium for migrating kubernets containers Download PDF

Info

Publication number
CN115599501A
CN115599501A CN202211391383.0A CN202211391383A CN115599501A CN 115599501 A CN115599501 A CN 115599501A CN 202211391383 A CN202211391383 A CN 202211391383A CN 115599501 A CN115599501 A CN 115599501A
Authority
CN
China
Prior art keywords
pod
name
container
virtual
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211391383.0A
Other languages
Chinese (zh)
Inventor
曹玲玲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202211391383.0A priority Critical patent/CN115599501A/en
Publication of CN115599501A publication Critical patent/CN115599501A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/4557Distribution of virtual machine instances; Migration and load balancing

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a method, a system, equipment and a storage medium for migrating kubernets containers, wherein the method comprises the following steps: migrating the container mirror image and the file system, and applying for system resources on a target node to complete the creation of the Pod; migrating the memory data of the Pod; restoring the identification of the Pod, setting a key value pair according to the name space, the Pod name and the IP address of the Pod, and generating a virtual IP table according to the key value pair; and determining a target Pod according to the name of the Pod and the name space of the Pod based on the virtual IP table, and clearing the source Pod according to the target Pod. The invention maintains a virtual IP table by using the name space plus the Pod name as a Key Value and the IP address of the Pod as a Value, thereby solving the problem of renaming in the container migration in Kubernets.

Description

Method, system, equipment and storage medium for migrating kubernets container
Technical Field
The present invention relates to the field of cluster management, and more particularly, to a method, system, device, and storage medium for migrating kubernets containers.
Background
Kubernets is the most widely used cluster management tool at present, and the demand for realizing the on-line migration of the Pod under the Kubernets environment is increasingly strong. In kubernets, the smallest management element is not a container, but a Pod, which is managed by kubernets organizations in Pod fashion. Thus, online migration of containers, and indeed Pod, is achieved under kubernets. The online migration of Pod is different from the pure migration of container, the container migration only needs to migrate one container at a time, but in kubernets, a plurality of containers may be in operation in one Pod, so that the plurality of containers need to be migrated simultaneously when the Pod is migrated; in addition, each Pod in kubernets has its own unique identifier, and the Pod after migration and the source Pod should be identical in the migration process, so there are contradictions between uniqueness of Pod and migration, and how to solve these contradictions is a problem that must be solved to realize container migration in kubernets.
Disclosure of Invention
In view of this, an object of an embodiment of the present invention is to provide a method, a system, a computer device, and a computer readable storage medium for migrating a kubernets container, where a namespace and a Pod name are used as Key values, and an IP address of a Pod is used as a Value, a virtual IP table is maintained, and in a service recovery phase of migration, a virtual IP table is used to implement a flow cut for Pod requests, thereby solving a contradiction between kubernets and migration and a clearing operation for a source-end Pod.
Based on the above purpose, an aspect of the embodiments of the present invention provides a method for migrating a kubernets container, including the following steps: migrating the container mirror image and the file system, and applying for system resources on a target node to complete the creation of the Pod; migrating the memory data of the Pod; restoring the identification of the Pod, setting a key value pair according to the name space, the Pod name and the IP address of the Pod, and generating a virtual IP table according to the key value pair; and determining a target Pod according to the name of the Pod and the name space where the Pod is located based on the virtual IP table, and clearing the source Pod according to the target Pod.
In some embodiments, the setting the key-value pair according to the namespace, the Pod name, and the IP address of the Pod comprises: and taking the name space and the Pod name of the Pod of the target node as key values, taking the IP address of the Pod of the target node as a vaule value, and forming a key value pair according to the key values and the vaule value.
In some embodiments, the identification of the recovery Pod comprises: and downloading the final backup file from the OSS end, synchronizing the memory state of the container in the Pod, recovering the memory state of the corresponding container in the Pod according to the memory image file of the container, and synchronizing the file content of the read-write layer of the container.
In some embodiments, the determining a target Pod according to the name of the Pod and the name space where the Pod is located based on the virtual IP table, and clearing a source Pod according to the target Pod includes: finding out all entities corresponding to the Pod stored in the Etcd according to the name of the Pod and the name space where the Pod is located, and sequentially checking whether the IP addresses are consistent; in response to the consistency of the IP addresses, deleting the entity corresponding to the Pod and cleaning a virtual IP table; and in response to deleting the entity corresponding to the Pod, deleting the Pod at the source end when the Kubelet is synchronized.
In another aspect of the embodiments of the present invention, a system for migrating a kubernets container is provided, including: the creation module is configured to migrate the container mirror image and the file system and apply for system resources on a target node to complete creation of the Pod; the migration module is configured to migrate the memory data of the Pod; the system comprises an identification module, a storage module and a control module, wherein the identification module is used for recovering an identification of a Pod, setting a key value pair according to a name space, a Pod name and an IP address of the Pod, and generating a virtual IP table according to the key value pair; and the recovery module is configured to determine a target Pod according to the name of the Pod and the name space where the Pod is located based on the virtual IP table, and clear the source Pod according to the target Pod.
In some embodiments, the identification module is configured to: and taking the name space and the Pod name of the Pod of the target node as key values, taking the IP address of the Pod of the target node as a vaule value, and forming a key value pair according to the key values and the vaule value.
In some embodiments, the identification module is configured to: and downloading the final backup file from the OSS end, synchronizing the memory state of the container in the Pod, recovering the memory state of the corresponding container in the Pod according to the memory image file of the container, and synchronizing the file content of the read-write layer of the container.
In some embodiments, the recovery module is configured to: finding out all entities corresponding to the Pod stored in the Etcd according to the name of the Pod and the name space where the Pod is located, and sequentially checking whether the IP addresses are consistent; in response to the consistency of the IP addresses, deleting the entity corresponding to the Pod and cleaning the virtual IP table; and in response to deleting the entity corresponding to the Pod, deleting the Pod at the source end when the Kubelet is synchronized.
In another aspect of the embodiments of the present invention, there is also provided a computer device, including: at least one processor; and a memory storing computer instructions executable on the processor, the instructions when executed by the processor implementing the steps of the method as above.
In a further aspect of the embodiments of the present invention, a computer-readable storage medium is also provided, in which a computer program for implementing the above method steps is stored when the computer program is executed by a processor.
The invention has the following beneficial technical effects: and maintaining a virtual IP table by taking the name space and the Pod name as Key values and the IP address of the Pod as Value values, and realizing stream switching of Pod requests by using the virtual IP table in the service recovery stage of migration, thereby solving the contradiction between Kubernets and migration and the cleaning work of source-end pods.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the prior art descriptions will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other embodiments can be obtained according to the drawings without creative efforts.
FIG. 1 is a schematic diagram of an embodiment of a method of kubernets container migration provided by the present invention;
FIG. 2 is a schematic diagram of a virtual IP table for conflict resolution according to the present invention;
FIG. 3 is a schematic diagram of an embodiment of a system for kubernets container migration provided by the present invention;
FIG. 4 is a schematic hardware configuration diagram of an embodiment of a computer device for migrating kubernets containers according to the present invention;
FIG. 5 is a schematic diagram of an embodiment of a computer storage medium for kubernets container migration provided by the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following embodiments of the present invention are described in further detail with reference to the accompanying drawings.
It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are used for distinguishing two entities with the same name but different names or different parameters, and it should be noted that "first" and "second" are only used for convenience of expression and should not be construed as a limitation to the embodiments of the present invention, and no description is given in the following embodiments.
In a first aspect of an embodiment of the present invention, an embodiment of a method for migrating kubernets containers is provided. Fig. 1 is a schematic diagram illustrating an embodiment of a method for migrating kubernets containers according to the present invention. As shown in fig. 1, the embodiment of the present invention includes the following steps:
s1, migrating a container mirror image and a file system, and applying for system resources on a target node to complete the creation of Pod;
s2, migrating the memory data of the Pod;
s3, restoring the identification of the Pod, setting a key value pair according to the name space, the Pod name and the IP address of the Pod, and generating a virtual IP table according to the key value pair; and
and S4, determining a target Pod according to the name of the Pod and the name space of the Pod based on the virtual IP table, and clearing the source Pod according to the target Pod.
The Kubernetes overall system architecture mainly includes several key components:
(1) Etcd: the state of all resources in the whole cluster is stored, such as Pod, PV/PVC and the like;
(2) Apiserver: apiserver is an entrance for operating cluster resources, and the cluster resources which need to be accessed, modified and deleted all need to pass through Apiserver;
(3) Controller manager: the control management center of the whole cluster is responsible for maintaining the state of the whole cluster;
(4) Scheduler: scheduling cluster resources is achieved, and the Pod in the cluster is scheduled to different nodes according to different scheduling strategies;
(5) Kubelet: the Kubelet runs on each node and is responsible for managing the life cycle of the Pod on the node and managing the Volume and the network;
(6) The kube-proxy is responsible for providing cluster-internal Service discovery and load balancing for Service.
The container migration process in the Kubernet environment is generally divided into three stages of pre-migration, memory migration and service recovery. In the pre-migration stage, migration of container images and file systems is completed, system resources are applied on a target node, and creation of a Pod is completed; completing the migration of the Pod memory data in a memory migration stage; and the service recovery stage realizes the cleaning work of completing the switching, the transformation and the migration of the Pod service. The embodiment of the invention mainly researches the switching flow of the Pod request by using the virtual IP table in the service recovery stage of migration, solves the contradiction between Kubernetes and migration and solves the clearing work of a source end Pod.
The service restoration phase pre-creates the Pod according to its static configuration, but many of them are temporarily set such as uuid, IP, etc. of the Pod. This is because the uniqueness of the Pod in Kubernetes does not allow different pods to have the same name, IP, etc. under the same namespace, as this would conflict with the management of the system. During the recovery process, the identification of Pod needs to be recovered. A straightforward approach is to reset the new Pod identity after deleting the Pod on the source node. The advantage of this approach is that it is simple and intuitive to implement. However, there are several disadvantages, the first is that the Pod at the destination end must wait for the Pod at the source end to be deleted before accessing the service again, and if an error occurs when the Pod at the source end is deleted, the Pod at the destination end cannot be correctly deleted, and the service of Pod is unavailable during this period of time, which increases the service downtime by changing phases; the second problem is that if an error occurs when the Pod id is modified, that is, the recovery process fails, the Pod needs to be recovered at the source end, and at this time, the Pod at the source end is deleted and needs to be created again, which increases the recovery cost. The solution of deleting Pod before modifying Pod id is not a good choice.
It is a reasonable choice to modify the Pod id before performing the source cleaning task, so kubernets must allow conflicts to exist before performing the source cleaning task. The reason why the Pod name is not allowed to conflict is that when there is a Pod of the same name, the target Pod cannot be determined, so it is only necessary to explicitly tell the system the target Pod when a conflict occurs. Because the names of the Pod within a namespace are unique, the IP addresses of the Pod are also unique. Therefore, a Virtual IP Table (Virtual IP Table) is maintained with the name of namespace + Pod as Key Value and the IP address of Pod as Value. When the conflict exists, the IP address of the target Pod is obtained according to the appointed Pod name, and then the target Pod can be found.
Fig. 2 is a schematic diagram of solving a conflict in a Virtual IP Table according to the present invention, and as shown in fig. 2, in the service recovery process, a new piece of record information is inserted into a Virtual IP Table, the namespace and the Pod name of a target node Pod are used as Key values, and the IP address is used as a value. With the help of Virtual IP Table, a Pod request with conflict is specified, and the request specification of counter under default name space is processed by Pod with IP address of 10.0.0.2. The Pod request with conflict will be finally handed to the counter at the NodeB according to the IP address. The data in the Virtual IP Table is time-sensitive and does not need to be stored permanently. When the identity of the Pod of the destination server has been modified, the service of the Pod has been restored. At this point, a request for cleaning the source Pod may be submitted to the kube-apiserver. After the Kube-apiserver clears the object of the source end Pod in the Etcd, the corresponding data in the Virtual IP Table can be deleted, and the operation of deleting Pod is continuously completed by the Kubelet of the subsequent source end.
Restoring Pod service on the target node mainly comprises restoring identification of Pod and cleaning source end Pod. The identification of the recovery Pod mainly comprises the name and the label data of the Pod, and a Virtual IP (Internet protocol) Table is set; and the clearing of the source end Pod comprises initiating a request for clearing the source end Pod, then a specific clearing process is specifically realized by the kube-apiserver, and after clearing is finished, corresponding records in the Virtual IP Table are deleted at the same time.
In some embodiments, the identification of the recovery Pod comprises: and downloading the final backup file from the OSS end, synchronizing the memory state of the container in the Pod, recovering the memory state of the corresponding container in the Pod according to the memory image file of the container, and synchronizing the file content of the read-write layer of the container.
And downloading the final backup file from an OSS (object storage) end, synchronizing the memory state of the container in the Pod, recovering the memory state of the corresponding container in the Pod according to the memory image file of the container, and synchronizing the file content of the read-write layer of the container. In this step, if the memory recovery fails, the Pod at the source end is recovered, and the whole migration process fails. If the memory state is successfully recovered, the identification of the Pod needs to be modified. Kubernetes does not allow modifying the names, IP and other contents of the pods, but the content is just the code level, and only partial modification of Kubelet is needed to open up the management layer, so that the existence of the pods with the same name is possible. If the identification of the Pod is successfully modified, then the Virtual IP Table can be set.
In some embodiments, the determining a target Pod according to the name of the Pod and the name space where the Pod is located based on the virtual IP table, and clearing a source Pod according to the target Pod includes: finding out all entities corresponding to the Pod stored in the Etcd according to the name of the Pod and the name space where the Pod is located, and sequentially checking whether the IP addresses are consistent; in response to the consistency of the IP addresses, deleting the entity corresponding to the Pod and cleaning a virtual IP table; and in response to deleting the entity corresponding to the Pod, deleting the Pod at the source end when the Kubelet is synchronized.
And processing the homonymous conflict of Pod, wherein the Kubelet starting request running on the node is processed by the kube-apiserver. When the kube-api server processes the request of Pod, before entering the Etcd to find the corresponding Pod object, the Virtual IP Table also needs to be accessed to see whether the specified Pod exists. If the Virtual IP Table is successfully set, the service of the whole Pod is restarted at the moment, and the whole service recovery phase is completed, a request for clearing the source Pod can be sent to the kube-apiserver. Correspondingly, if any step fails, the recovery process is considered to be a failure of the recovery process, the Pod at the source end needs to be recovered, and the whole migration process fails.
After the recovery of the Pod service is completed, the entire migration process can be said to have been completed. But some cleaning work needs to be performed. After migration is complete, the Pod on the source node has no longer provided the service and can be deleted, this cleaning work being initiated by the target node's kubel and handled by the kube-apiserver. The clearing source end Pod mainly finds all entities corresponding to the Pod stored in the Etcd according to the name of the Pod and the name space where the Pod is located, then sequentially checks whether the IPs are consistent, and if so, deletes the corresponding entities and clears the Virtual IP Table. When deleting the corresponding entity, the source Pod will be deleted when the source Kubelet is synchronized.
It should be noted that, the steps in the embodiments of the method for migrating kubernets container described above may be intersected, replaced, added, or deleted, and therefore, these methods for migrating kubernets container with reasonable permutation and combination should also belong to the scope of the present invention, and should not limit the scope of the present invention to the embodiments.
In view of the above object, according to a second aspect of the embodiments of the present invention, a system for migrating kubernets containers is provided. As shown in fig. 3, the system 200 includes the following modules: the creation module is configured to migrate the container mirror image and the file system and apply for system resources on a target node to complete the creation of the Pod; the migration module is configured to migrate the memory data of the Pod; the identification module is used for configuring an identification used for recovering the Pod, setting a key value pair according to a name space, a Pod name and an IP address of the Pod, and generating a virtual IP table according to the key value pair; and the recovery module is configured to determine a target Pod according to the name of the Pod and the name space where the Pod is located based on the virtual IP table, and clear the source Pod according to the target Pod.
In some embodiments, the identification module is configured to: and taking the name space and the Pod name of the Pod of the target node as key values, taking the IP address of the Pod of the target node as a vaule value, and forming a key value pair according to the key values and the vaule value.
In some embodiments, the identification module is configured to: and downloading the final backup file from the OSS end, synchronizing the memory state of the container in the Pod, recovering the memory state of the corresponding container in the Pod according to the memory image file of the container, and synchronizing the file content of the read-write layer of the container.
In some embodiments, the recovery module is configured to: finding out all entities corresponding to the Pod stored in the Etcd according to the name of the Pod and the name space where the Pod is located, and sequentially checking whether the IP addresses are consistent; in response to the consistency of the IP addresses, deleting the entity corresponding to the Pod and cleaning the virtual IP table; and in response to deleting the entity corresponding to the Pod, deleting the Pod at the source end when the Kubelet is synchronized.
In view of the above object, a third aspect of the embodiments of the present invention provides a computer device, including: at least one processor; and a memory storing computer instructions executable on the processor, the instructions being executable by the processor to perform the steps of: s1, migrating a container mirror image and a file system, and applying for system resources on a target node to complete the creation of a Pod; s2, migrating the memory data of the Pod; s3, restoring the identification of the Pod, setting a key value pair according to the name space, the Pod name and the IP address of the Pod, and generating a virtual IP table according to the key value pair; and S4, determining a target Pod according to the name of the Pod and the name space of the Pod based on the virtual IP table, and clearing the source Pod according to the target Pod.
In some embodiments, the setting the key-value pair according to the namespace, the Pod name, and the IP address of the Pod comprises: and taking the name space and the Pod name of the Pod of the target node as key values, taking the IP address of the Pod of the target node as a vaule value, and forming a key value pair according to the key values and the vaule value.
In some embodiments, the identification of the recovery Pod comprises: and downloading the final backup file from the OSS end, synchronizing the memory state of the container in the Pod, recovering the memory state of the corresponding container in the Pod according to the memory image file of the container, and synchronizing the file content of the read-write layer of the container.
In some embodiments, the determining a target Pod according to the name of the Pod and the name space where the Pod is located based on the virtual IP table, and clearing a source Pod according to the target Pod includes: finding out all entities corresponding to the Pod stored in the Etcd according to the name of the Pod and the name space where the Pod is located, and sequentially checking whether the IP addresses are consistent; in response to the consistency of the IP addresses, deleting the entity corresponding to the Pod and cleaning the virtual IP table; and in response to deleting the entity corresponding to the Pod, deleting the Pod at the source end when the Kubelet is synchronized.
Fig. 4 is a schematic hardware structural diagram of an embodiment of the computer device for migrating kubernets containers according to the present invention.
Taking the device shown in fig. 4 as an example, the device includes a processor 301 and a memory 302.
The processor 301 and the memory 302 may be connected by a bus or other means, such as the bus connection shown in fig. 4.
The memory 302 is a non-volatile computer-readable storage medium, and can be used for storing non-volatile software programs, non-volatile computer-executable programs, and modules, such as program instructions/modules corresponding to the method for migrating kubernets containers in the embodiment of the present application. The processor 301 executes various functional applications of the server and data processing, i.e., a method of implementing the kubernets container migration, by executing nonvolatile software programs, instructions, and modules stored in the memory 302.
The memory 302 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the method of the kubernets container migration, and the like. Further, the memory 302 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, memory 302 optionally includes memory located remotely from processor 301, which may be connected to a local module via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
Computer instructions 303 corresponding to one or more methods of kubernets container migration are stored in the memory 302 and, when executed by the processor 301, perform the method of kubernets container migration in any of the above-described method embodiments.
Any embodiment of a computer device for performing the method of kubernets container migration described above may achieve the same or similar effects as any of the preceding method embodiments corresponding thereto.
The present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, performs a method of kubernets container migration.
Fig. 5 is a schematic diagram of an embodiment of a computer storage medium migrated from the kubernets container according to the present invention. Taking the computer storage medium as shown in fig. 5 as an example, the computer readable storage medium 401 stores a computer program 402 which, when executed by a processor, performs the method as described above.
Finally, it should be noted that, as one of ordinary skill in the art can appreciate that all or part of the processes of the methods of the above embodiments can be implemented by a computer program to instruct related hardware, and the program of the method for migrating kubernets container can be stored in a computer readable storage medium, and when executed, the program can include the processes of the embodiments of the methods as described above. The storage medium of the program may be a magnetic disk, an optical disk, a Read Only Memory (ROM), a Random Access Memory (RAM), or the like. The embodiments of the computer program may achieve the same or similar effects as any of the above-described method embodiments.
The foregoing are exemplary embodiments of the present disclosure, but it should be noted that various changes and modifications could be made herein without departing from the scope of the present disclosure as defined by the appended claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. Furthermore, although elements of the disclosed embodiments of the invention may be described or claimed in the singular, the plural is contemplated unless limitation to the singular is explicitly stated.
It should be understood that, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly supports the exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items.
The numbers of the embodiments disclosed in the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, and the program may be stored in a computer-readable storage medium, where the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk.
Those of ordinary skill in the art will understand that: the discussion of any embodiment above is meant to be exemplary only, and is not intended to intimate that the scope of the disclosure, including the claims, of embodiments of the invention is limited to these examples; within the idea of an embodiment of the invention, also technical features in the above embodiment or in different embodiments may be combined and there are many other variations of the different aspects of the embodiments of the invention as described above, which are not provided in detail for the sake of brevity. Therefore, any omissions, modifications, substitutions, improvements, and the like that may be made without departing from the spirit and principles of the embodiments of the present invention are intended to be included within the scope of the embodiments of the present invention.

Claims (10)

1. A method for migrating kubernets containers is characterized by comprising the following steps:
migrating the container mirror image and the file system, and applying for system resources on a target node to complete the creation of the Pod;
migrating memory data of the Pod;
restoring the identification of the Pod, setting a key value pair according to the name space, the Pod name and the IP address of the Pod, and generating a virtual IP table according to the key value pair; and
and determining a target Pod according to the name of the Pod and the name space where the Pod is located based on the virtual IP table, and clearing the source Pod according to the target Pod.
2. The method of claim 1, wherein setting the key-value pair according to the namespace, the Pod name, and the IP address of the Pod comprises:
and taking the name space and the Pod name of the Pod of the target node as key values, taking the IP address of the Pod of the target node as a vaule value, and forming a key value pair according to the key values and the vaule value.
3. The method of claim 1, wherein the recovering the identification of the Pod comprises:
and downloading the final backup file from the OSS end, synchronizing the memory state of the container in the Pod, recovering the memory state of the corresponding container in the Pod according to the memory image file of the container, and synchronizing the file content of the read-write layer of the container.
4. The method of claim 1, wherein the determining a target Pod according to the name of the Pod and the name space where the Pod is located based on the virtual IP table, and clearing a source Pod according to the target Pod comprises:
finding out all entities corresponding to the Pod stored in the Etcd according to the name of the Pod and the name space where the Pod is located, and sequentially checking whether the IP addresses are consistent;
in response to the consistency of the IP addresses, deleting the entity corresponding to the Pod and cleaning a virtual IP table;
and in response to deleting the entity corresponding to the Pod, deleting the Pod at the source end when the Kubelet is synchronized.
5. A system for kubernets container migration, comprising:
the creation module is configured to migrate the container mirror image and the file system and apply for system resources on a target node to complete the creation of the Pod;
the migration module is configured to migrate the memory data of the Pod;
the system comprises an identification module, a storage module and a control module, wherein the identification module is used for recovering an identification of a Pod, setting a key value pair according to a name space, a Pod name and an IP address of the Pod, and generating a virtual IP table according to the key value pair; and
and the recovery module is configured to determine a target Pod according to the name of the Pod and the name space where the Pod is located based on the virtual IP table, and clear the source Pod according to the target Pod.
6. The system of claim 5, wherein the identification module is configured to:
and taking the name space and the Pod name of the Pod of the target node as key values, taking the IP address of the Pod of the target node as a vaule value, and forming a key value pair according to the key values and the vaule value.
7. The system of claim 5, wherein the identification module is configured to:
and downloading the final backup file from the OSS end, synchronizing the memory state of the container in the Pod, recovering the memory state of the corresponding container in the Pod according to the memory image file of the container, and synchronizing the file content of the read-write layer of the container.
8. The system of claim 5, wherein the recovery module is configured to:
finding out all entities corresponding to the Pod stored in the Etcd according to the name of the Pod and the name space where the Pod is located, and sequentially checking whether the IP addresses are consistent;
in response to the consistency of the IP addresses, deleting the entity corresponding to the Pod and cleaning the virtual IP table;
and in response to deleting the entity corresponding to the Pod, deleting the Pod at the source end when the Kubelet is synchronized.
9. A computer device, comprising:
at least one processor; and
a memory storing computer instructions executable on the processor, the instructions when executed by the processor implementing the steps of the method of any one of claims 1 to 4.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 4.
CN202211391383.0A 2022-11-08 2022-11-08 Method, system, equipment and storage medium for migrating kubernets containers Pending CN115599501A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211391383.0A CN115599501A (en) 2022-11-08 2022-11-08 Method, system, equipment and storage medium for migrating kubernets containers

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211391383.0A CN115599501A (en) 2022-11-08 2022-11-08 Method, system, equipment and storage medium for migrating kubernets containers

Publications (1)

Publication Number Publication Date
CN115599501A true CN115599501A (en) 2023-01-13

Family

ID=84852789

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211391383.0A Pending CN115599501A (en) 2022-11-08 2022-11-08 Method, system, equipment and storage medium for migrating kubernets containers

Country Status (1)

Country Link
CN (1) CN115599501A (en)

Similar Documents

Publication Publication Date Title
US20220327007A1 (en) Migrating edge device resources to a cloud computing environment
US11409622B1 (en) Methods and systems for a non-disruptive planned failover from a primary copy of data at a primary storage system to a mirror copy of the data at a cross-site secondary storage system without using an external mediator
CN111641515B (en) VNF life cycle management method and device
US10673694B2 (en) Private network mirroring
CN110347483B (en) Method and device for migrating physical machine to virtual machine and storage medium
CN113032085A (en) Management method, device, server, management system and medium of cloud operating system
US11650859B2 (en) Cloud environment configuration based on task parallelization
WO2020106528A1 (en) Traffic forwarding during migration
CN104793981B (en) A kind of online snapshot management method and device of cluster virtual machine
US20230315584A1 (en) Backing up data for a namespace assigned to a tenant
US20220012091A1 (en) System and method for executing multi-stage distributed computing operations with independent rollback workflow
CN110990415A (en) Data processing method and device, electronic equipment and storage medium
US9485308B2 (en) Zero copy volume reconstruction
CN112667259A (en) SDN controller version upgrading method, device and medium
US11709749B1 (en) Diagnostic data collection for kubernetes
CN115599501A (en) Method, system, equipment and storage medium for migrating kubernets containers
US20230133014A1 (en) Methods and Systems for Storage Virtual Machine Migration Between Clusters of a Networked Storage System
CN113157392A (en) High-availability method and equipment for mirror image warehouse
CN110837394A (en) High-availability configuration version warehouse configuration method, terminal and readable medium
US11563800B1 (en) Distributed semantic network for concurrent access to interconnected objects
CN117389713B (en) Storage system application service data migration method, device, equipment and medium
US11757733B2 (en) Parallel service invocation in a network
US11853783B1 (en) Identifying hosts for dynamically enabling specified features when resuming operation of a virtual compute instance
US20230229475A1 (en) Leader selection and revocation for tasks in a virtualized computing system
US20220350656A1 (en) Increase assignment effectiveness of kubernetes pods by reducing repetitive pod mis-scheduling

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination