Method and system for migrating storage across kubernetes clusters
By creating load balancing services and corresponding services between kubernetes clusters, data migration across clusters and different storage types is realized, data corruption and cross-storage type migration problems caused by manual intervention in the existing technology, and the security of data migration is improved and flexibility.
Patent Information
- Application Number
- CN202411393667.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-08
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2044-10-08
AI Technical Summary
Existing data migration methods have the risk of data corruption or loss due to manual intervention, lack of cross-storage type support, and only support same cluster migration, making it difficult to achieve data migration across clusters and different storage types, especially between kubernetes clusters.
By creating a load balancing service across clusters between kubernetes clusters, pulling up corresponding services according to storage volume types, sharing and replicating data, thereby realizing data migration across clusters and different storage types.
Reduce manual intervention, ensure data integrity and security, support migration of multiple storage types, improve data management flexibility and cost-effectiveness, and realize data migration across clusters and even across regions.
Smart Images

Figure CN119271140A_ABST
Abstract
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 many methods to achieve data transfer from one storage system to another. These methods range from basic manual operations to automated technologies. In practical applications, existing data migration methods have the following shortcomings:
[0003] 1. Manually copying data is not only time-consuming and labor-intensive, but also greatly increases the risk of data damage or loss during the migration process due to manual intervention, which inevitably leads to data inconsistency, data loss or data leakage, thus having a serious impact on the user's operations and reputation;
[0004] 2. Lack of cross-storage type support, and does not support data migration between different storage types. For example, it does not support migration from block storage to file storage or from local storage to cloud storage. These operations require matching with additional solutions. The lack of data migration tools that support different storage types limits the flexibility of enterprises in choosing storage solutions;
[0005] 3. Intra-cluster migration is restricted. Data migration can only be performed within the same cluster. 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 storage data migration method that is safe, reliable, and more widely applicable and does not require manual data contact, 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 a Kubernetes cluster is provided, the method comprising:
[0009] Mount the storage volumes to be migrated and the storage volumes that receive the source data across clusters, and create a load balancing service that connects across clusters.
[0010] Launch the corresponding service according to the type of 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;
[0011] According to the types of the storage volume to be migrated and the storage volume receiving the source storage data, the data is copied to the storage volume in the cluster receiving the source storage 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 storage 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 storage 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 a storage volume in a cluster that receives the storage source data according to the types of the storage volume to be migrated and the storage volume that receives 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, copying the data in the storage volume mounted on the storage source POD 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, according to the types of the storage volume to be migrated and the storage volume receiving the storage source data, copying the data to the storage volume in the cluster receiving the storage source data includes:
[0022] When the types of storage volumes mounted on the storage source POD and the storage target POD are both block device types, use the dd tool 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;
[0023] When the type of the storage volume mounted on the storage source POD is a block device type, and the type of the storage volume mounted on the storage target POD is a file system type, the type of the storage volume mounted on the storage source POD is converted to the file system type, and 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;
[0024] When the type of the storage volume mounted on the storage source POD is a file system type, and the type of the storage volume mounted on the storage target POD is a block device type, the type of the storage volume mounted on the storage target POD is converted to a file system type, and 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;
[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, the system comprising a cross-cluster migration storage service client, the cross-cluster migration storage service client being used to: mount storage volumes to be migrated and storage volumes for receiving storage source data across clusters, and create a load balancing service for cross-cluster connections; pull up corresponding services according to the types of storage volumes to be migrated, and share storage volumes of corresponding types to be migrated to the cluster receiving the storage source data through the load balancing service; and copy data to storage volumes in the cluster receiving the storage source data according to the types of storage volumes to be migrated and storage volumes for receiving 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, can realize data migration across clusters and even across regions, can integrate automated tools and intelligent algorithms, 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. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. 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 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 A schematic diagram of the structure 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 the following embodiments and features in the embodiments may be combined with each other in the absence of conflict; and, based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without making any creative work are within the scope of protection of the present 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 may be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on the present disclosure, it should be understood by those skilled in the art that an aspect described herein may be implemented independently of any other aspect, and two or more of these aspects may be combined in various ways. For example, any number of aspects described herein may be used to implement the device and / or practice the method. In addition, other structures and / or functionalities other than one or more of the aspects described herein may be used to implement this device 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 plurality of storage clients 103 that migrate across clusters.
[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; according to the type of the storage volume to be migrated and the storage volume that receives the storage source data, copy the data to the storage volume in the cluster 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 of 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 suitable 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 via 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 client 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 client 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 cross-Kubernetes cluster migration storage data 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 one device, in some embodiments, any appropriate 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 A technical schematic diagram of a method for migrating storage across kubernetes clusters according to the present invention. Figure 3 1 is a flowchart of the steps of a method for migrating storage across Kubernetes clusters according to an embodiment of the present invention. The method for migrating storage across Kubernetes clusters of this embodiment 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 according to 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: starting a corresponding service according to the type of the storage volume to be migrated, and sharing the corresponding type of storage volume 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, 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. In this embodiment, ISCSI (Internet Small Computer System Interface) is a storage protocol based on an IP network, which allows SCSI commands and data to be transmitted over an IP network. ISCSI technology enables remote storage devices to be mapped to local hosts, 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, 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. 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, and mount files and directories in the remote file system to the local system, so that the local system can access remote files like 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 for copying and converting data in Linux and Unix systems, such as copying data directly from a hardware device, or creating a file system mirror. In this example, the dd tool is used to copy block device data in a Linux system.
[0055] When the type of the storage volume mounted on the storage source POD is a block device type, and the type of the storage volume mounted on the storage target POD is a file system type, the type of the storage volume mounted on the storage source POD is converted to a file system type, and 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; when the type of the storage volume mounted on the storage source POD is a file system type, and the type of the storage volume mounted on the storage target POD is a block device type, the type of the storage volume mounted on the storage target POD is converted to a file system type, and 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; 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. In this example, the cp tool is a basic command line tool in Linux and Unix systems, used to copy files or directories.
[0056] In actual applications, after data migration is performed using the method for migrating storage across kubernetes clusters of this embodiment, the corresponding resources can also be destroyed to avoid resource waste. First, the storage volume is unmounted in the storage source POD and the storage target POD, and then the storage source POD and the storage target POD are deleted. For the storage source 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, it is possible to implement storage migration across different Kubernetes clusters and mutual migration between different storage types, that is, it is possible to support multiple storage types, implement data migration across clusters and even across regions, integrate automated tools and intelligent algorithms, reduce manual intervention, ensure data integrity and availability, improve the security and efficiency of data migration, avoid the risk of data corruption or loss due to manual contact with data, and improve the flexibility and cost-effectiveness of data management.
[0058] like Figure 4 As shown, the present invention also 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 through the communication bus 340. The processor 310 implements the above-mentioned method for migrating storage across kubernetes clusters by running the executable computer program.
[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 can be essentially or partly embodied in the form of a software product that contributes to the prior art, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0060] The system embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected based on actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art may understand and implement it without creative effort.
[0061] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiment.
[0062] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. A method for migrating storage across kubernetes clusters, characterized in that: The method comprises: Mount the storage volumes to be migrated and the storage volumes that receive the source data across clusters, and create a load balancing service that connects across clusters. Start the corresponding service according to the type of 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; According to the types of the storage volume to be migrated and the storage volume receiving the source storage data, the data is copied to the storage volume in the cluster receiving the source storage data.
2. The method for migrating storage across kubernetes clusters according to claim 1, characterized in that: Mount the storage volume to be migrated and the storage volume that receives the source data across clusters, including: 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; Create a storage target Pod in the storage target Kubernetes cluster, and mount the storage volume that receives the storage source data on the created storage target Pod.
3. The method for migrating storage across kubernetes clusters according to claim 2, characterized in that: 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.
4. The method for migrating storage across kubernetes clusters according to claim 3, characterized in that: The load balancing service is used to provide a load balancing IP address to the storage target Pod.
5. The method for migrating storage across kubernetes clusters according to claim 1, characterized in that: 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.
6. The method for migrating storage across kubernetes clusters according to claim 5, characterized in that: 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 of 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.
7. The method for migrating storage across kubernetes clusters according to claim 5, characterized in that: 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.
8. 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 are copied to the storage volumes mounted on the storage target POD.
9. The method for migrating storage across kubernetes clusters according to claim 1, characterized in that: 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 types of storage volumes mounted on the storage source POD and the storage target POD are both block device types, use the dd tool 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; When the type of the storage volume mounted on the storage source POD is a block device type, and the type of the storage volume mounted on the storage target POD is a file system type, the type of the storage volume mounted on the storage source POD is converted to the file system type, and 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; When the type of the storage volume mounted on the storage source POD is a file system type, and the type of the storage volume mounted on the storage target POD is a block device type, the type of the storage volume mounted on the storage target POD is converted to a file system type, and 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; 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.
10. 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 storage source data across clusters, and create a load balancing service for cross-cluster connection; 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 receiving the storage source data through the load balancing service; According to the types of the storage volume to be migrated and the storage volume receiving the source storage data, the data is copied to the storage volume in the cluster receiving the source storage data.
Citation Information
Patent Citations
Method and system for monitoring K8s storage volume, terminal and storage medium
CN112230847A
Kubernetes-based storage configuration method and system and electronic equipment
CN113342280A
Temporary volume storage method, containerized cloud platform and computer readable medium
CN116382585A
Method for realizing Kubernetes persistent storage data migration and related equipment
CN116774935A
Online migration method and device for stateful Pod in Kubernetes cluster
CN116974696A