A method and system for migrating storage across Kubernetes clusters

By mounting storage volumes and load balancing services across clusters, combined with dd or cp tools, the problem of data migration across Kubernetes clusters and different storage types is solved, achieving safe and reliable data migration and improving the flexibility and efficiency of data management.

CN119271140BActive Publication Date: 2025-09-19CHINA ELECTRONICS CLOUD DIGITAL INTELLIGENCE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411393667.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-08
Publication Date
2025-09-19
Estimated Expiration
2044-10-08

AI Technical Summary

Technical Problem

Existing technologies have high risks of manual intervention during data migration, do not support migration of different storage types, and have limited cluster migration. In particular, it is difficult to ensure data consistency and integrity when migrating across Kubernetes clusters.

Method used

By mounting storage volumes across clusters, creating a load balancing service, launching corresponding services based on the storage volume type, sharing storage volumes using the load balancing service, and copying data using the dd or cp tool, data migration across Kubernetes clusters and between different storage types can be achieved.

Benefits of technology

It enables secure and reliable data migration across different Kubernetes clusters and storage types, reduces manual intervention, ensures data integrity and availability, improves migration efficiency and flexibility, and reduces the risk of data corruption or loss.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119271140B_ABST
    Figure CN119271140B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of storage data migration, and provides a method and system for migrating storage across Kubernetes clusters, comprising: mounting storage volumes to be migrated and storage volumes receiving storage source data across clusters, creating a load balancing service connected across clusters; launching corresponding services based on the types of storage volumes to be migrated, and sharing the corresponding types of storage volumes to be migrated with the cluster receiving the storage source data through the load balancing service; and copying data to storage volumes in the cluster receiving the storage source data based on the types of the storage volumes to be migrated and the storage volumes receiving the storage source data. The present invention can implement storage migration across different Kubernetes clusters and mutual migration between different storage types, integrates automated tools and intelligent algorithms, reduces manual intervention, ensures data integrity and availability, improves the security and efficiency of data migration, and enhances the flexibility and cost-effectiveness of data management.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of storage data migration, and in particular to a method and system for migrating storage across Kubernetes clusters. Background Art

[0002] In the field of data storage migration, there are various methods for transferring data from one storage system to another. These methods range from basic manual operations to automated technologies. In practice, existing data migration methods have the following shortcomings:

[0003] 1. Manually copying data is not only time-consuming and labor-intensive, but also significantly increases the risk of data corruption or loss during the migration process due to manual intervention. This inevitably leads to data inconsistency, data loss, or data leakage, severely impacting user operations and reputation.

[0004] 2. Lack of cross-storage type support. Data migration between different storage types is not supported. For example, migration from block storage to file storage or from local storage to cloud storage is not supported. These operations require matching with additional solutions. The lack of data migration tools that support different storage types limits enterprises' flexibility in choosing storage solutions.

[0005] 3. Intra-cluster migration is restricted. Data migration can only be performed within the same cluster and cross-cluster migration is not supported. When users need to migrate data from one data center to another, cross-cluster migration not only needs to deal with network latency and bandwidth limitations, but also needs to ensure data consistency and integrity, which faces additional complexity and challenges.

[0006] Therefore, how to provide a secure, reliable, and widely applicable storage data migration method that does not require manual data access, and can achieve data migration between different Kubernetes clusters and different storage types, has become a technical problem that needs to be solved urgently. Summary of the Invention

[0007] In view of this, in order to overcome the deficiencies of the prior art, the present invention aims to provide a method and system for migrating storage across Kubernetes clusters.

[0008] According to a first aspect of the present invention, a method for migrating storage across Kubernetes clusters is provided, the method comprising:

[0009] Mount the storage volume to be migrated and the storage volume receiving the source data across clusters to create a load balancing service connected across clusters.

[0010] Launch the corresponding service based on the type of storage volume to be migrated, and share the corresponding type of storage volume to be migrated to the cluster receiving the source storage data through the load balancing service;

[0011] Based on the types of the storage volume to be migrated and the storage volume receiving the source data, the data is copied to the storage volume in the cluster receiving the source data.

[0012] Preferably, in the method for migrating storage across Kubernetes clusters of the present invention, mounting the storage volume to be migrated and the storage volume receiving the source data across clusters includes:

[0013] Create a storage source Pod in the storage source Kubernetes cluster and mount the storage volume to be migrated on the created storage source Pod.

[0014] Create a storage target Pod in the storage target Kubernetes cluster and mount the storage volume that receives the source data on the created storage target Pod.

[0015] Preferably, in the method for migrating storage across Kubernetes clusters of the present invention, creating a load balancing service connected across clusters includes: creating a load balancing service in the storage source Kubernetes cluster, and associating the created load balancing service with the created storage source POD.

[0016] Preferably, in the method for migrating storage across Kubernetes clusters of the present invention, the load balancing service is used to provide a load balancing IP to the storage target POD.

[0017] Preferably, in the method for migrating storage across Kubernetes clusters of the present invention, corresponding services are pulled up according to the types of storage volumes to be migrated, and the corresponding types of storage volumes to be migrated are shared to the cluster that receives the storage source data through the load balancing service, including: pulling up corresponding services according to the types of storage volumes mounted on the storage source POD, using the storage target POD as the client of the corresponding service, and sharing the corresponding types of storage volumes in the storage source POD to the storage target POD through the load balancing service.

[0018] Preferably, in the method for migrating storage across Kubernetes clusters of the present invention, a corresponding service is pulled up according to the type of storage volume mounted on the storage source POD, the storage target POD is used as the client of the corresponding service, and the storage volume of the corresponding type in the storage source POD is shared to the storage target POD through the load balancing service, including: when the type of storage volume mounted on the storage source POD is a block device, an ISCSI service is pulled up in the storage source POD, the storage target POD is used as the client corresponding to the ISCSI service, a load balancing IP is requested from the load balancing service, and the storage volume of the block device type in the storage source POD is shared to the storage target POD according to the obtained load balancing IP.

[0019] Preferably, in the method for migrating storage across Kubernetes clusters of the present invention, a corresponding service is pulled up according to the type of storage volume mounted on the storage source POD, the storage target POD is used as the client of the corresponding service, and the storage volume of the corresponding type in the storage source POD is shared to the storage target POD through the load balancing service, including: when the type of storage volume mounted on the storage source POD is a file system type, an NFS service is pulled up in the storage source POD, the storage target POD is used as the client corresponding to the NFS service, a load balancing IP is requested from the load balancing service, and the storage volume of the file system type in the storage source POD is shared to the storage target POD according to the obtained load balancing IP.

[0020] Preferably, in the method for migrating storage across Kubernetes clusters of the present invention, data is copied to the storage volume in the cluster receiving the storage source data according to the types of the storage volume to be migrated and the storage volume receiving the storage source data, including: after sharing the storage volume in the storage source POD to the storage target POD, according to the types of the storage volumes mounted by the storage source POD and the storage target POD, the data in the storage volume mounted on the storage source POD is copied to the storage volume mounted on the storage target POD.

[0021] Preferably, in the method for migrating storage across Kubernetes clusters of the present invention, copying data to a storage volume in the cluster receiving the source storage data according to the types of the storage volume to be migrated and the storage volume receiving the source storage data includes:

[0022] When the storage volumes mounted on the source Pod and the target Pod are both block devices, use the dd tool on the target Pod to copy the data from the storage volume mounted on the source Pod to the storage volume mounted on the target Pod.

[0023] When the type of the storage volume mounted on the source Pod is a block device type and the type of the storage volume mounted on the target Pod is a file system type, convert the type of the storage volume mounted on the source Pod to the file system type and use the cp tool on the target Pod to copy the data in the storage volume mounted on the source Pod to the storage volume mounted on the target Pod.

[0024] When the type of the storage volume mounted on the source Pod is a file system type and the type of the storage volume mounted on the target Pod is a block device type, convert the type of the storage volume mounted on the target Pod to a file system type and use the cp tool on the target Pod to copy the data in the storage volume mounted on the source Pod to the storage volume mounted on the target Pod.

[0025] When the types of the storage volumes mounted on the storage source POD and the storage target POD are both file system types, the cp tool is used in the storage target POD to copy the data in the storage volume mounted on the storage source POD to the storage volume mounted on the storage target POD.

[0026] According to a second aspect of the present invention, a system for migrating storage across Kubernetes clusters is provided, which includes a cross-cluster migration storage service client, which is used to: mount storage volumes to be migrated and storage volumes that receive storage source data across clusters, and create a load balancing service connected across clusters; pull up corresponding services based on the types of storage volumes to be migrated, and share the corresponding types of storage volumes to be migrated to the cluster that receives the storage source data through the load balancing service; and copy data to the storage volumes in the cluster that receives the storage source data based on the types of the storage volumes to be migrated and the storage volumes that receive the storage source data.

[0027] According to a third aspect of the present invention, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in the first aspect of the present invention when executing the program.

[0028] The method and system for migrating storage across Kubernetes clusters of the present invention can realize storage migration across different Kubernetes clusters and mutual migration between different storage types, that is, it can support multiple storage types and realize data migration across clusters and even across regions. It can integrate automated tools and intelligent algorithms to reduce manual intervention, ensure data integrity and availability, improve the security and efficiency of data migration, avoid the risk of data damage or loss caused by manual contact with data, and improve the flexibility and cost-effectiveness of data management. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0030] Figure 1 This is an example diagram of the architecture of a system for migrating storage across Kubernetes clusters according to an embodiment of the present invention;

[0031] Figure 2 A technical schematic diagram of a method for migrating storage across Kubernetes clusters according to the present invention;

[0032] Figure 3 A flowchart of a method for migrating storage across Kubernetes clusters according to an embodiment of the present invention;

[0033] Figure 4 This is a schematic structural diagram of the device provided by the present invention. DETAILED DESCRIPTION

[0034] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0035] It should be noted that, in the absence of conflict, the following embodiments and features in the embodiments may be combined with each other; and, based on the embodiments in this disclosure, all other embodiments obtained by persons of ordinary skill in the art without creative work are within the scope of protection of this disclosure.

[0036] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein can be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on this disclosure, it should be understood by those skilled in the art that an aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number of aspects described herein can be used to implement an apparatus and / or practice a method. In addition, other structures and / or functionalities other than one or more of the aspects described herein can be used to implement this apparatus and / or practice this method.

[0037] Figure 1 FIG. 1 is an example diagram of an architecture of a system for migrating storage across Kubernetes clusters according to an embodiment of the present invention. Figure 1 As shown, the system may include a cross-cluster migration storage service client 101, a communication network 102 and / or one or more cross-cluster migration storage clients 103. Figure 1 The example in FIG. 1 is a multiple cross-cluster migration storage client 103 .

[0038] The cross-cluster migration storage service client 101 can be any appropriate server for storing information, data, programs and / or any other suitable type of content. In some embodiments, the cross-cluster migration storage service client 101 can perform appropriate functions. For example, in some embodiments, the cross-cluster migration storage service client 101 can be used to migrate storage data across kubernetes clusters. As an optional example, in some embodiments, the cross-cluster migration storage service client 101 can be used to: mount the storage volumes to be migrated and the storage volumes that receive the storage source data across clusters, and create a load balancing service connected across clusters; pull up the corresponding service according to the type of the storage volume to be migrated, and share the corresponding type of storage volume to be migrated to the cluster that receives the storage source data through the load balancing service; and copy the data to the storage volume in the cluster that receives the storage source data according to the type of the storage volume to be migrated and the storage volume that receives the storage source data.

[0039] As another example, in some embodiments, the cross-cluster migration storage service client 101 may send a method for cross-Kubernetes cluster migration storage to the cross-cluster migration storage client 103 for user use based on a request from the cross-cluster migration storage client 103 .

[0040] As an optional example, in some embodiments, the cross-cluster migration storage client 103 is used to provide a visual cross-cluster migration storage interface, which is used to receive a user's selection input operation for migrating storage data across Kubernetes clusters, and, in response to the selection input operation, obtain a cross-cluster migration storage interface corresponding to the option selected by the selection input operation from the cross-cluster migration storage service client 101 and display the cross-cluster migration storage interface, wherein the cross-cluster migration storage interface at least displays information on migrating storage data across Kubernetes clusters and operation options for migrating storage data across Kubernetes clusters.

[0041] In some embodiments, the communication network 102 can be any appropriate combination of one or more wired and / or wireless networks. For example, the communication network 102 can include any one or more of the following: the Internet, an intranet, a wide area network (WAN), a local area network (LAN), a wireless network, a digital subscriber line (DSL) network, a frame relay network, an asynchronous transfer mode (ATM) network, a virtual private network (VPN) and / or any other suitable communication network. The cross-cluster migration storage client 103 can be connected to the communication network 102 by one or more communication links (e.g., communication link 104), and the communication network 102 can be linked to the cross-cluster migration storage service end 101 via one or more communication links (e.g., communication link 105). The communication link can be any communication link suitable for transmitting data between the cross-cluster migration storage client 103 and the cross-cluster migration storage service end 101, such as a network link, a dial-up link, a wireless link, a hard-wired link, any other suitable communication link or any suitable combination of such links.

[0042] The cross-cluster migration storage client 103 may include any one or more clients that present an interface for migrating storage data across Kubernetes clusters in an appropriate form for user use and operation. In some embodiments, the cross-cluster migration storage client 103 may include any suitable type of device. For example, in some embodiments, the cross-cluster migration storage client 103 may include a mobile device, a tablet computer, a laptop computer, a desktop computer, and / or any other suitable type of client device.

[0043] Although the cross-cluster migration storage service client 101 is illustrated as a single device, in some embodiments, any suitable number of devices may be used to perform the functions performed by the cross-cluster migration storage service client 101. For example, in some embodiments, multiple devices may be used to implement the functions performed by the cross-cluster migration storage service client 101. Alternatively, a cloud service may be used to implement the functions of the cross-cluster migration storage service client 101.

[0044] Based on the above system, an embodiment of the present invention provides a method for migrating storage across Kubernetes clusters, which is described below through the following embodiments.

[0045] Figure 2 This is a technical principle diagram of a method for migrating storage across Kubernetes clusters according to the present invention. Figure 3 The method for migrating storage across Kubernetes clusters according to the embodiment of the present invention is a flowchart of the steps of the method. The method for migrating storage across Kubernetes clusters according to the embodiment of the present invention can be executed on a cross-cluster migration storage service end, such as Figure 2 and Figure 3As shown, the method for migrating storage across Kubernetes clusters includes the following steps:

[0046] Step S201: Mount the storage volume to be migrated and the storage volume receiving the source data across clusters, and create a load balancing service for cross-cluster connections.

[0047] As an optional example, in this embodiment, before the storage data is migrated, a storage source POD is created in the storage source Kubernetes cluster, and the storage volume to be migrated is mounted on the created storage source POD; a storage target POD is created in the storage target Kubernetes cluster, and the storage volume for receiving the storage source data is mounted on the created storage target POD. A load balancing service is created in the storage source Kubernetes cluster, and the created load balancing service is associated with the created storage source POD. In this embodiment, the load balancing service is used to provide a load balancing IP to the storage target POD, and the storage target POD in the storage target Kubernetes cluster can access the storage volume mounted on the storage source POD based on the load balancing IP provided by the load balancing service. It should be noted that, in this embodiment, the size of the storage volume for receiving the storage source data mounted on the storage target POD is greater than or equal to the size of the storage volume mounted on the storage source POD.

[0048] Step S202: launching corresponding services according to the types of storage volumes to be migrated, and sharing the corresponding types of storage volumes to be migrated to the cluster receiving the storage source data through the load balancing service.

[0049] In this embodiment, the corresponding service is launched according to the type of storage volume mounted on the storage source POD, the storage target POD is used as the client of the corresponding service, and the storage volume of the corresponding type in the storage source POD is shared to the storage target POD through the load balancing service.

[0050] As an optional example, when the type of storage volume mounted on the storage source POD is a block device, the ISCSI service is pulled up in the storage source POD, the storage target POD is used as the client corresponding to the ISCSI service, and the load balancing IP is requested from the load balancing service. Then, based on the obtained load balancing IP, the storage volume of the block device type in the storage source POD is shared with the storage target POD. In this embodiment, ISCSI (Internet Small Computer System Interface) is a storage protocol based on an IP network. It allows SCSI commands and data to be transmitted over an IP network. ISCSI technology enables remote storage devices to be mapped to a local host, providing a network-based storage solution.

[0051] As an optional example, when the type of storage volume mounted on the storage source POD is a file system type, the NFS service is pulled up in the storage source POD, the storage target POD is used as the client corresponding to the NFS service, and the load balancing IP is requested from the load balancing service. Then, based on the obtained load balancing IP, the storage volume of the file system type in the storage source POD is shared with the storage target POD. In this embodiment, NFS (Network File System) is a distributed file system protocol that allows computer systems to share and access files across the network, mounting files and directories in a remote file system to the local system, allowing the local system to access remote files in the same way as accessing local files.

[0052] Step S203: based on the types of the storage volume to be migrated and the storage volume receiving the source storage data, copy the data to the storage volume in the cluster receiving the source storage data.

[0053] After sharing the storage volume in the storage source POD to the storage target POD, this embodiment copies the data in the storage volume mounted on the storage source POD to the storage volume mounted on the storage target POD according to the types of the storage volumes mounted on the storage source POD and the storage target POD.

[0054] As an optional example, in the method of this embodiment, when the types of storage volumes mounted on the storage source POD and the storage target POD are both block device types, the dd tool is used in the storage target POD to copy the data in the storage volume mounted on the storage source POD to the storage volume mounted on the storage target POD. In this example, the dd tool is a powerful command line tool used to copy and convert data in Linux and Unix systems, such as copying data directly from hardware devices or creating a file system mirror. In this example, the dd tool is used to copy block device data in the Linux system.

[0055] If the volume mounted on the source Pod is a block device and the volume mounted on the target Pod is a file system, the source volume is converted to a file system, and the cp tool is used on the target Pod to copy the data from the source volume to the target volume. If the volume mounted on the source Pod is a file system and the volume mounted on the target Pod is a block device, the target volume is converted to a file system, and the cp tool is used on the target Pod to copy the data from the source volume to the target volume. If the volumes mounted on both the source and target Pods are file system types, the cp tool is used on the target Pod to copy the data from the source volume to the target volume. In this example, the cp tool is a basic command-line tool used in Linux and Unix systems to copy files or directories.

[0056] In actual applications, after performing data migration using the cross-Kubernetes cluster storage migration method of this embodiment, the corresponding resources can also be destroyed to avoid resource waste. First, unmount the storage volume on the source storage Pod and the target storage Pod, then delete the source storage Pod and the target storage Pod. For the source storage Kubernetes cluster, the load balancing service can also be deleted to release the corresponding load balancing IP.

[0057] According to the method and system for migrating storage across Kubernetes clusters of this embodiment, storage migration across different Kubernetes clusters and mutual migration between different storage types can be realized, that is, it can support multiple storage types, and can realize data migration across clusters and even across regions. It can integrate automated tools and intelligent algorithms to reduce manual intervention, ensure data integrity and availability, improve the security and efficiency of data migration, avoid the risk of data corruption or loss caused by manual contact with data, and improve the flexibility and cost-effectiveness of data management.

[0058] like Figure 4 As shown, the present invention further provides a device including a processor 310, a communication interface 320, a memory 330 for storing a computer program executable by the processor, and a communication bus 340. The processor 310, the communication interface 320, and the memory 330 communicate with each other via the communication bus 340. The processor 310 executes the executable computer program to implement the aforementioned method for migrating storage across Kubernetes clusters.

[0059] Among them, the computer program in the memory 330 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0060] The system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units. They may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.

[0061] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus the necessary general hardware platform, or of course, by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the existing technology can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or certain parts of the embodiment.

[0062] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.

Claims

1. A method for migrating storage across kubernetes clusters, characterized in that: The method comprises: Mount the storage volume to be migrated and the storage volume receiving the source data across clusters to create a load balancing service connected across clusters. Launch the corresponding service based on the type of storage volume to be migrated, and share the corresponding type of storage volume to be migrated to the cluster receiving the source storage data through the load balancing service; Based on the types of the storage volume to be migrated and the storage volume receiving the source data, copy the data to the storage volume in the cluster receiving the source data. Mount the storage volume to be migrated and the storage volume receiving the source storage data across clusters, including: creating a storage source Pod in the storage source Kubernetes cluster, mounting the storage volume to be migrated on the created storage source Pod; creating a storage target Pod in the storage target Kubernetes cluster, mounting the storage volume receiving the source storage data on the created storage target Pod; According to the type of storage volume to be migrated, the corresponding service is pulled up, and the corresponding type of storage volume to be migrated is shared to the cluster that receives the storage source data through the load balancing service, including: according to the type of storage volume mounted on the storage source POD, the corresponding service is pulled up, the storage target POD is used as the client of the corresponding service, and the corresponding type of storage volume in the storage source POD is shared to the storage target POD through the load balancing service.

2. The method for migrating storage across Kubernetes clusters according to claim 1, wherein: Create a load balancing service that connects across clusters, including: creating a load balancing service in the storage source Kubernetes cluster, and associating the created load balancing service with the created storage source Pod.

3. The method for migrating storage across kubernetes clusters according to claim 2, wherein: The load balancing service is used to provide a load balancing IP address to the storage target Pod.

4. The method for migrating storage across Kubernetes clusters according to claim 1, wherein: According to the type of storage volume mounted on the storage source POD, the corresponding service is pulled up, the storage target POD is used as the client of the corresponding service, and the storage volume of the corresponding type in the storage source POD is shared to the storage target POD through the load balancing service, including: when the type of storage volume mounted on the storage source POD is a block device, the ISCSI service is pulled up in the storage source POD, the storage target POD is used as the client corresponding to the ISCSI service, the load balancing IP is requested from the load balancing service, and the storage volume of the block device type in the storage source POD is shared to the storage target POD according to the obtained load balancing IP.

5. The method for migrating storage across kubernetes clusters according to claim 1, wherein: According to the type of storage volume mounted on the storage source POD, the corresponding service is pulled up, the storage target POD is used as the client of the corresponding service, and the storage volume of the corresponding type in the storage source POD is shared to the storage target POD through the load balancing service, including: when the type of storage volume mounted on the storage source POD is a file system type, the NFS service is pulled up in the storage source POD, the storage target POD is used as the client corresponding to the NFS service, the load balancing IP is requested from the load balancing service, and the storage volume of the file system type in the storage source POD is shared to the storage target POD according to the obtained load balancing IP.

6. The method for migrating storage across kubernetes clusters according to claim 1, characterized in that: According to the types of the storage volumes to be migrated and the storage volumes receiving the storage source data, the data is copied to the storage volumes in the cluster receiving the storage source data, including: after the storage volumes in the storage source POD are shared to the storage target POD, according to the types of the storage volumes mounted on the storage source POD and the storage target POD, the data in the storage volumes mounted on the storage source POD is copied to the storage volumes mounted on the storage target POD.

7. The method for migrating storage across Kubernetes clusters according to claim 1, wherein: Based on the types of the storage volume to be migrated and the storage volume receiving the source data, copy the data to the storage volume in the cluster receiving the source data, including: When the storage volumes mounted on the source Pod and the target Pod are both block devices, use the dd tool on the target Pod to copy the data from the storage volume mounted on the source Pod to the storage volume mounted on the target Pod. When the type of the storage volume mounted on the source Pod is a block device type and the type of the storage volume mounted on the target Pod is a file system type, convert the type of the storage volume mounted on the source Pod to the file system type and use the cp tool on the target Pod to copy the data in the storage volume mounted on the source Pod to the storage volume mounted on the target Pod. When the type of the storage volume mounted on the source Pod is a file system type and the type of the storage volume mounted on the target Pod is a block device type, convert the type of the storage volume mounted on the target Pod to a file system type and use the cp tool on the target Pod to copy the data in the storage volume mounted on the source Pod to the storage volume mounted on the target Pod. When the types of the storage volumes mounted on the storage source POD and the storage target POD are both file system types, the cp tool is used in the storage target POD to copy the data in the storage volume mounted on the storage source POD to the storage volume mounted on the storage target POD.

8. A system for migrating storage across kubernetes clusters, characterized in that: The system includes a cross-cluster migration storage service client, which is used to: mount the storage volume to be migrated and the storage volume receiving the source storage data across clusters, create a load balancing service connected across clusters; pull up corresponding services according to the type of the storage volume to be migrated, and share the corresponding type of storage volume to be migrated to the cluster receiving the source storage data through the load balancing service; According to the types of the storage volumes to be migrated and the storage volumes receiving the storage source data, the data is copied to the storage volumes in the cluster receiving the storage source data; wherein, the storage volumes to be migrated and the storage volumes receiving the storage source data are mounted across clusters, including: creating a storage source POD in the storage source Kubernetes cluster, and mounting the storage volumes to be migrated on the created storage source POD; creating a storage target POD in the storage target Kubernetes cluster, and mounting the storage volumes receiving the storage source data on the created storage target POD; pulling up corresponding services according to the types of the storage volumes to be migrated, and sharing the corresponding types of storage volumes to be migrated to the cluster receiving the storage source data through the load balancing service, including: pulling up corresponding services according to the types of storage volumes mounted on the storage source POD, using the storage target POD as the client of the corresponding service, and sharing the corresponding types of storage volumes in the storage source POD to the storage target POD through the load balancing service.

Citation Information

Patent Citations

  • Kubernetes-based storage configuration method and system and electronic equipment

    CN113342280A

  • Method for realizing Kubernetes persistent storage data migration and related equipment

    CN116774935A