Shared access method and system based on cloud native storage data volume

By realizing automatic switching between local file systems and shared file systems on the Kubernetes platform, the problem of insufficient Pod shared access performance and convenience is solved, costs and delays are reduced, and the adaptability and ease of use of data volumes are improved.

CN118860281APending Publication Date: 2024-10-29SHANGHAI PUDONG DEVELOPMENT BANK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410855114.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-28
Publication Date
2024-10-29

AI Technical Summary

Technical Problem

The shared access performance and convenience of Pods in the Kubernetes platform are insufficient. The existing technology requires mounting an external shared file system, resulting in high usage and operation and maintenance costs and low performance.

Method used

By deploying automatic switching between local persistent volumes and NFS shared volumes on the Kubernetes platform, the conversion of local file systems and shared file systems is realized, the external shared file system is abandoned, access delays and costs are reduced, and the adaptability and ease of data volumes are improved. Usability.

Benefits of technology

It achieves high performance and convenient shared access for Pods in the Kubernetes platform, reduces usage and operation and maintenance costs, and improves the adaptability and ease of use of data volumes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118860281A_ABST
    Figure CN118860281A_ABST
Patent Text Reader

Abstract

The invention relates to a shared access method and system based on a cloud native storage data volume. Comprising the following steps: when a target container group is deployed on a target working node of a Kubernetes platform, judging whether a container group having a shared access requirement with the target container group is deployed or not; if the persistent volume is not deployed, mounting the local persistent volume on the target container group, so that the target container group accesses data in the persistent volume; and if the persistent volume is deployed, running an NFS service process, generating an NFS shared volume corresponding to the persistent volume, and mounting the NFS shared volume on the target container group, so that the target container group accesses data in the persistent volume through the NFS shared volume. According to the method, the Kubernetes platform data volume of the local shared file system is considered, the conversion between the local file system and the shared file system is realized at the rear end, and the mounting of an external network file system is abandoned, so that the access delay is reduced, and the use cost and the operation and maintenance cost are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of this specification relate to the field of computer technology, and in particular, to a shared access method and system based on cloud-native storage data volumes. Background Art

[0002] There are many applications on the Kubernetes platform that need to read and write the same data volume from multiple different nodes at the same time, that is, shared access. Currently, the most widely used file system is the Kubernetes platform persistent storage volume (Persistent Volume, PV), which can generally only be mounted on the application instance container (Pod) deployed on a single node, and cannot be mounted by Pods deployed on other nodes at the same time, and cannot achieve shared access to Pods on multiple nodes.

[0003] At present, most of the shared file systems provided by the network file server outside Kubernetes are mounted on the Pods deployed on multiple nodes, so as to achieve shared access of Pods on multiple nodes. However, because this shared file system belongs to the external network file server, its usage cost and operation and maintenance cost are very high. In addition, due to network latency, the performance of the external shared file system is much lower than that of the local persistent volume. Moreover, the application on the Kubernetes platform only needs to use the external shared file system when it is horizontally expanded to multiple instances (i.e., multiple Pods). Therefore, in order to ensure the scalability of the application, most of the existing technologies have to abandon the method of mounting local persistent volumes in the single instance (i.e., one Pod) state. Therefore, whether it is a single instance or multiple instances, the performance and convenience of shared access in the existing technology are not high.

[0004] How to improve the performance and convenience of shared access to Pods in the Kubernetes platform is a technical problem that needs to be solved urgently. Summary of the invention

[0005] In order to solve the problem of insufficient performance and convenience of shared access of Pods in the Kubernetes platform in the prior art, the embodiments of this specification provide a shared access method and system based on cloud native storage data volumes. Starting from the local file system, a Kubernetes platform data volume that takes into account the local shared file system is realized, and the conversion between the local file system and the shared file system is realized at its back end, and the shared file system mounted on the external network file system server is abandoned, thereby reducing access latency, reducing usage costs and operation and maintenance costs, and automatically switching between the local file system and the shared file system, taking into account performance and scalability, and greatly improving the adaptability and ease of use of the data volume.

[0006] The specific technical solutions of the embodiments of this specification are as follows:

[0007] On the one hand, an embodiment of this specification provides a shared access method based on a cloud native storage data volume, including:

[0008] When deploying the target container group on the target working node of the Kubernetes platform, determine whether at least one container group having a shared access requirement with the target container group has been deployed on the Kubernetes platform;

[0009] If no container group having a shared access requirement with the target container group is deployed on the Kubernetes platform, a persistent volume corresponding to the shared access requirement local to the Kubernetes platform is mounted on the target container group so that the target container group can access the data in the persistent volume;

[0010] If at least one container group having a shared access requirement with the target container group has been deployed on the Kubernetes platform, it is determined whether there is a container group on which the persistent volume has been mounted among the deployed container groups;

[0011] If there is a container group that has mounted the persistent volume among the deployed container groups, determine whether there is a corresponding NFS shared volume for the persistent volume;

[0012] If the NFS shared volume does not exist, run the NFS service process on the working node corresponding to the container group that has mounted the persistent volume, generate an NFS shared volume corresponding to the persistent volume, and mount the NFS shared volume on the target container group, so that the target container group can access the data in the persistent volume through the NFS shared volume;

[0013] If the NFS shared volume exists, the NFS shared volume is mounted on the target container group, so that the target container group can access the data in the persistent volume through the NFS shared volume.

[0014] Furthermore, if there is a container group that has mounted the persistent volume, the method further includes:

[0015] Determine whether the working node corresponding to the container group that has mounted the persistent volume is the target working node;

[0016] If it is the target working node, mounting the persistent volume on the target container group;

[0017] If it is not the target working node, the step of determining whether there is a corresponding NFS shared volume for the persistent volume is executed.

[0018] Furthermore, running an NFS service process on a working node corresponding to the container group on which the persistent volume has been mounted, and generating an NFS shared volume corresponding to the persistent volume further includes:

[0019] An NFS process container is deployed on a working node corresponding to the container group on which the persistent volume has been mounted, and the NFS service process is run in the NFS process container, and the file system format of the persistent volume is converted to the NFSv4 network file system format to generate the NFS shared volume.

[0020] Furthermore, the method further comprises:

[0021] When reducing the multiple container groups corresponding to the shared access requirements deployed on the Kubernetes platform to a single container group, the container group on which the persistent volume is mounted is retained.

[0022] Further, when reducing the multiple container groups corresponding to the shared access requirements deployed on the Kubernetes platform to a single container group, the method further includes:

[0023] After deleting all container groups that mount the NFS shared volume from the Kubernetes platform, delete the NFS shared volume.

[0024] On the other hand, the embodiments of this specification also provide a shared access system based on cloud native storage data volumes, including a master node and a working node;

[0025] The master node is used to manage the container groups with shared access requirements deployed on each of the working nodes;

[0026] A CSI plug-in is deployed in the working node. When a container group corresponding to the shared access requirement is deployed on the working node, the CSI plug-in executes the above method.

[0027] On the other hand, an embodiment of the present specification further provides a computer device, including a memory, a processor, and a computer program stored in the memory, and the processor implements the above method when executing the computer program.

[0028] On the other hand, an embodiment of the present specification further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program implements the above method when executed by a processor.

[0029] Finally, the embodiments of this specification also provide a computer program product, wherein the computer program product includes a computer program, and the computer program implements the above method when executed by a processor.

[0030] By using the embodiments of the present specification, the method of mounting an external shared file system in the Kubernetes platform to achieve data sharing between multiple container groups on multiple nodes is abandoned. Instead, when deploying a container group with shared access requirements, it is determined whether at least one container group with shared access requirements with the target container group to be deployed has been deployed on the Kubernetes platform. If not, the persistent volume corresponding to the shared access requirement of the local Kubernetes platform is mounted on the target container group, and the target container group accesses the data in the local persistent volume. When deploying other container groups corresponding to the shared access requirement, the NFS service is run to generate an NFS shared volume corresponding to the persistent volume, that is, the data in the persistent volume is converted to the NFSv4 network file format, and the NFS shared volume is mounted on other container groups corresponding to the shared access requirement. In this way, other container groups can access the data in the local persistent volume through the NFS shared volume, and the container group mounting the persistent volume still accesses the data in the persistent volume through local access, thereby realizing data sharing. Compared with the method of mounting an external shared file system in the prior art, the method of the embodiment of this specification realizes a Kubernetes platform data volume that takes into account the local shared file system, and realizes the conversion of the local file system and the shared file system at its back end, thereby reducing access latency, reducing usage costs and operation and maintenance costs, and through automatic switching between the local file system and the shared file system, taking into account performance and scalability, greatly improving the adaptability and ease of use of the data volume. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the embodiments of this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0032] Figure 1 The figure is a flow chart of a shared access method based on a cloud-native storage data volume according to an embodiment of the present specification;

[0033] Figure 2 The figure is a flow chart of determining whether to reuse a persistent volume if there is a container group that has mounted the persistent volume in an embodiment of the present specification;

[0034] Figure 3 The figure shows a schematic diagram of the structure of a shared access system based on cloud native storage data volumes in an embodiment of this specification;

[0035] Figure 4 The figure is a schematic diagram of the structure of a computer device in an embodiment of the present specification.

[0036]

Description of reference numerals

[0037] 401, master node;

[0038] 402, working node;

[0039] 4021, CSI plugin;

[0040] 502. Computer equipment;

[0041] 504. Processing equipment;

[0042] 506. Storage resources;

[0043] 508. Drive system;

[0044] 510, input / output module;

[0045] 512. Input devices;

[0046] 514. Output device;

[0047] 516. Presentation equipment;

[0048] 518. Graphical user interface;

[0049] 520, network interface;

[0050] 522, communication link;

[0051] 524. Communication bus. DETAILED DESCRIPTION

[0052] The following will be combined with the drawings in the embodiments of this specification to clearly and completely describe the technical solutions in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of them. Based on the embodiments in the embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the embodiments of this specification.

[0053] It should be noted that the terms "first", "second", etc. in the description and claims of the embodiments of this specification and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the embodiments of this specification described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, device, product or equipment that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment.

[0054] It should be noted that the acquisition, storage, use, and processing of data in the technical solutions of the embodiments of this specification comply with the relevant provisions of national laws and regulations.

[0055] It should be noted that in the embodiments of this specification, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of this application, but it does not mean that the applicant has or will necessarily use the solution.

[0056] In the embodiments of this specification, the Kubernetes platform (abbreviated as K8s) is an open source tool for managing containers. Its architecture is mainly divided into two parts: the master node (Master) and the worker node (Node). The master node is responsible for scheduling and managing all worker nodes, and the worker node is where the application is actually run. The smallest scheduling unit of the Kubernetes platform is a container group (Pod). A Pod can contain one or more containers, sharing storage and network. The container is the environment in which the application runs and is an instance in the Pod. Node is an actual machine in the Kubernetes platform, such as a virtual machine, which is responsible for running the Pod.

[0057] A persistent volume (PV) is used to describe or define a storage volume that is internal to the Kubernetes platform and is manually provided by the administrator or dynamically created by the Kubernetes platform through StorageClass. A persistent volume claim (PVC) is used to describe what type of PV storage is needed or what conditions must be met. Define a storage volume (the storage volume type is PVC) in a Pod. When defining it, specify the size directly. The PVC must establish a relationship with the corresponding PV. The PVC will apply for the PV according to the configuration definition, and the PV is created from the storage space. PV and PVC are storage resources abstracted by Kubernetes. A Pod can request a specific amount of resources (CPU and memory); similarly, a PVC claim can also request a specific size and access mode. For example, you can require the PV volume to be mounted in one of the ReadWriteOnce, ReadOnlyMany, or ReadWriteMany modes.

[0058] The Network File System (NFS) allows a system to share directories and files with others on the network. By using NFS, users and programs can access files on external systems just like accessing local files. In the prior art, in order to achieve shared access between multiple Pods, the Kubernetes platform mounts the external NFS on each Pod. However, the use cost and operation and maintenance cost of the external NFS are very high, and there is a delay in network transmission, and the access speed is much lower than the local PV volume. However, most PV volumes can only be mounted by Pods on one working node, and data sharing between Pods on different working nodes cannot be achieved.

[0059] In response to the problems existing in the prior art, the embodiments of this specification provide a shared access method based on cloud native storage data volumes. Starting from the local file system, a Kubernetes platform data volume that takes into account the local shared file system is implemented, and the conversion between the local file system and the shared file system is realized at its back end. Figure 1 The figure shows a flow chart of a shared access method based on a cloud native storage data volume in an embodiment of this specification. The process of shared access to a multi-container group on the Kubernetes platform is described in this figure. The order of steps listed in the embodiment is only one way of executing the order of many steps and does not represent the only execution order. When the system or device product in practice is executed, it can be executed in sequence or in parallel according to the method shown in the embodiment or the accompanying drawings.

[0060] Specific as Figure 1 As shown, the method may include:

[0061] Step 101: When deploying a target container group on a target working node of a Kubernetes platform, determine whether at least one container group having a shared access requirement with the target container group has been deployed on the Kubernetes platform;

[0062] Step 102: If no container group having a shared access requirement with the target container group is deployed on the Kubernetes platform, a persistent volume corresponding to the shared access requirement and local to the Kubernetes platform is mounted on the target container group;

[0063] So that the target container group can access the data in the persistent volume;

[0064] Step 103: If at least one container group having a shared access requirement with the target container group has been deployed on the Kubernetes platform, it is determined whether there is a container group on which the persistent volume has been mounted among the deployed container groups;

[0065] Step 104: If there is a container group that has mounted the persistent volume among the deployed container groups, determine whether there is a corresponding NFS shared volume for the persistent volume;

[0066] Step 105: If the NFS shared volume does not exist, run the NFS service process on the working node corresponding to the container group on which the persistent volume has been mounted, generate an NFS shared volume corresponding to the persistent volume, and mount the NFS shared volume on the target container group;

[0067] So that the target container group can access the data in the persistent volume through the NFS shared volume;

[0068] Step 106: If the NFS shared volume exists, mount the NFS shared volume on the target container group;

[0069] This allows the target container group to access the data in the persistent volume through the NFS shared volume.

[0070] By using the embodiments of the present specification, the method of mounting an external shared file system in the Kubernetes platform to achieve data sharing between multiple container groups on multiple nodes is abandoned. Instead, when deploying a container group with shared access requirements, it is determined whether at least one container group with shared access requirements with the target container group to be deployed has been deployed on the Kubernetes platform. If not, the persistent volume corresponding to the shared access requirement of the local Kubernetes platform is mounted on the target container group, and the target container group accesses the data in the local persistent volume. When deploying other container groups corresponding to the shared access requirement, the NFS service is run to generate an NFS shared volume corresponding to the persistent volume, that is, the data in the persistent volume is converted to the NFSv4 network file format, and the NFS shared volume is mounted on other container groups corresponding to the shared access requirement. In this way, other container groups can access the data in the local persistent volume through the NFS shared volume, and the container group mounting the persistent volume still accesses the data in the persistent volume through local access, thereby realizing data sharing. Compared with the method of mounting an external shared file system in the prior art, the method of the embodiment of this specification realizes a Kubernetes platform data volume that takes into account the local shared file system, and realizes the conversion of the local file system and the shared file system at its back end, thereby reducing access latency, reducing usage costs and operation and maintenance costs, and through automatic switching between the local file system and the shared file system, taking into account performance and scalability, greatly improving the adaptability and ease of use of the data volume.

[0071] Through the method of the embodiment of this specification, it is realized that the local file system (local PV volume) is used when there is a single instance (a Pod), and the shared file system (NFS shared volume corresponding to the local PV volume) is used when there are multiple instances. The NFS shared volume is generated by executing the NFS service on the working node that mounts the PV volume. Therefore, its use cost and maintenance cost are lower than the external shared file system, and the access delay is much lower than the delay of accessing the external shared file system. And it is realized that according to the state of Pod expansion, the local PV volume access and the local NFS storage volume access can be freely switched, which improves the flexibility of deployment.

[0072] In the embodiments of this specification, multiple Pods can be deployed on a working node, so Pods with sharing requirements may also be deployed on a working node. In this case, the PV volume already mounted on the working node can be reused. Specifically, Figure 2 As shown, if there is a container group that has mounted the persistent volume, the method further includes:

[0073] Step 201: Determine whether the working node corresponding to the container group that has mounted the persistent volume is the target working node;

[0074] Step 202: If it is the target working node, mount the persistent volume on the target container group;

[0075] Step 203: If it is not the target working node, execute the step of determining whether there is a corresponding NFS shared volume for the persistent volume.

[0076] According to an embodiment of the present specification, running an NFS service process on a working node corresponding to a container group on which the persistent volume has been mounted, and generating an NFS shared volume corresponding to the persistent volume further includes:

[0077] An NFS process container is deployed on a working node corresponding to the container group on which the persistent volume has been mounted, and the NFS service process is run in the NFS process container, and the file system format of the persistent volume is converted to the NFSv4 network file system format to generate the NFS shared volume.

[0078] In the embodiment of this specification, the file system format of the PV volume can be EXT4 / XFS, that is, the PV volume is an EXT4 / XFS file system. In the embodiment of this specification, on the working node corresponding to the Pod that mounts the EXT4 / XFS file system, the Pod object of the Kubernetes platform is used to run the NFS process container. The container mounts the EXT4 / XFS data volume through the standard PVC / PV. The NFS-Ganesha or NFS Kernel service process running in the container converts the EXT4 / XFS into the standard NFSv4 network file system format and sends it to the Kubernetes platform virtual network. On the working node that does not mount the EXT4 / XFS file system, the generated NFS shared volume is mounted to the host operating system through the Service cluster IP of the Kubernetes platform, and then mapped to the Pod deployed there.

[0079] In the embodiments of the present specification, when the application on the Kubernetes platform is horizontally expanded to a multi-instance (i.e., multiple Pods) state, an NFS shared volume corresponding to the persistent volume is generated, and the NFS shared volume is mounted on the expanded multiple Pods. Therefore, the Pod (container group) with shared access requirements belongs to one application. One persistent volume in the embodiments of the present specification corresponds to one NFS shared volume. If the NFS shared volume fails, it will only affect this one application and will not affect other applications. Therefore, the method of the embodiments of the present specification has a high granularity.

[0080] In some other embodiments of the present specification, multiple volumes can be mounted on a Pod. By mounting multiple volumes, different types of data storage can be assigned to the same Pod to achieve data isolation and business separation. At this time, the shared access requirements can be further refined. For example, the Pods deployed on multiple different working nodes only have shared access requirements for one type of data. At this time, it is only necessary to generate an NFS shared volume corresponding to the PV volume of this type, mount the PV volume of this type on a Pod corresponding to the shared access requirement, and mount the NFS shared volume corresponding to the PV volume on other Pods corresponding to the shared access requirement. For data of types that do not have shared access requirements between these Pods, these types of data can be stored on their respective PV volumes and mounted on the corresponding Pods respectively.

[0081] Therefore, in the embodiment of this specification, when deploying the target container group on the target working node of the Kubernetes platform, it is determined whether at least one container group having a shared access requirement with the target container group has been deployed on the Kubernetes platform.

[0082] According to an embodiment of the present specification, when multiple container groups corresponding to the shared access requirements deployed on the Kubernetes platform are reduced to a single container group, the container group on which the persistent volume is mounted is retained.

[0083] In the embodiment of this specification, when it is necessary to reduce multiple Pods corresponding to the shared access requirements deployed on the Kubernetes platform to a single Pod, the retained Pod is the Pod that mounts the PV volume, because the access speed to data in the PV volume is higher than that of the NFS shared volume.

[0084] When multiple volumes are mounted on a Pod, the reduction of multiple Pods to a single Pod is also for the Pods with shared access requirements, rather than reducing all Pods on the Kubernetes platform. Therefore, the NFS shared volumes corresponding to the shared access requirements are unmounted.

[0085] According to one embodiment of the present specification, when reducing multiple container groups corresponding to the shared access requirements deployed on the Kubernetes platform to a single container group, the method further includes:

[0086] After deleting all container groups that mount the NFS shared volume from the Kubernetes platform, the NFS shared volume is deleted, that is, the NFS process container and network deployed on the working node that mounts the PV volume are deleted to recycle system resources.

[0087] According to one embodiment of the present specification, when the NFS service on the working node corresponding to the Pod mounting the PV volume fails (for example, the NFS service container is restarted or forcibly migrated due to a failure), the Pod corresponding to the NFS service container is deleted, and the Pod mounting the PV volume is retained, thereby ensuring the high availability of the system.

[0088] It can be understood that in the deployment scenario of multiple Pods corresponding to the shared access requirements, the embodiments of this specification give priority to local mounting, that is, the local PV volume is mounted on a Pod first, and then the NFS shared volume corresponding to the local PV volume is generated, and the NFS shared volume is mounted on other Pods. Because the access speed of the local PV volume is high, the use and maintenance cost of the NFS shared volume is low, and the access delay is low, the above method of the embodiments of this specification greatly improves the storage volume management effect of the Kubernetes platform.

[0089] Based on the same inventive concept, the embodiments of this specification also provide a shared access system based on cloud native storage data volumes, such as Figure 3 As shown, the system includes: a master node 401 and a working node 402:

[0090] The master node 401 is used to manage the container groups with shared access requirements deployed on each of the working nodes 402;

[0091] A CSI plug-in 4021 is deployed in the working node 402. When the container group corresponding to the shared access requirement is deployed on the working node 402, the CSI plug-in 4021 executes the above method.

[0092] In the embodiment of the present specification, the CSI plug-in 4021 includes a CSI control service module (CSI-Controller-server) and a CSI node service module (CSI-Node-server). The CSI control service module can manage container storage volumes and can be deployed through a stateful application orchestration controller (StatefulSet). It can be connected to the automatic volume configuration program module Provisioner. Provisioner can monitor changes in PVC. When Provisioner detects changes in PVC, it can trigger the CSI control service module's volume creation program CreateVolume to create a container PV based on the monitored PVC, or trigger the CSI control service module's volume uninstallation program DeleteVolume to uninstall the volume directory.

[0093] The CSI node service module can manage the volume directory on the working node 402 and can be deployed as a DaemonSet controller, which can connect to the node driver management program Node-driver-registrar, receive the call of Kubelet through Node-driver-registrar, and implement the CSI interface related to the working node 402, such as mounting the volume directory to the target path in the container or unmounting the volume directory from the container.

[0094] Since the principle of solving the problem by the above system is similar to that of the above method, the implementation of the above system can refer to the implementation of the above method, and the repeated parts will not be repeated.

[0095] like Figure 4 The figure is a schematic diagram of the structure of a computer device according to an embodiment of the present specification. The computer device according to the embodiment of the present specification can run the method according to the embodiment of the present specification.

[0096] The computer device 502 may include one or more processing devices 504, such as one or more central processing units (CPUs), each of which may implement one or more hardware threads. The computer device 502 may also include any storage resources 506 for storing any type of information such as code, settings, data, etc. Without limitation, for example, the storage resources 506 may include any one or more combinations of the following: any type of RAM, any type of ROM, a flash memory device, a hard disk, an optical disk, etc. More generally, any storage resource may use any technology to store information.

[0097] Further, any storage resource may provide volatile or non-volatile retention of information.

[0098] Further, any storage resource may represent a fixed or removable component of the computer device 502. In one case, when the processing device 504 executes the associated instructions stored in any storage resource or combination of storage resources, the computer device 502 may perform any operation of the associated instructions. The computer device 502 also includes one or more drive systems 508 for interacting with any storage resource, such as a hard disk drive system, an optical disk drive system, etc.

[0099] The computer device 502 may also include an input / output module 510 (I / O) for receiving various inputs (via input devices 512) and for providing various outputs (via output devices 514). A specific output mechanism may include a presentation device 516 and an associated graphical user interface (GUI) 518. In other embodiments, the input / output module 510 (I / O), the input device 512, and the output device 514 may not be included, and the computer device 502 may be used as a computer device in a network. The computer device 502 may also include one or more network interfaces 520 for exchanging data with other devices via one or more communication links 522. One or more communication buses 524 couple the components described above together.

[0100] The communication link 522 may be implemented in any manner, for example, through a local area network, a wide area network (e.g., the Internet), a point-to-point connection, etc., or any combination thereof. The communication link 522 may include any combination of hardwired links, wireless links, routers, gateway functions, name servers, etc., governed by any protocol or combination of protocols.

[0101] It should be noted that when the Kubernetes platform of the embodiment of this specification implements the method described in the embodiment of this specification for the computer device 502 described in this embodiment, it may not include the presentation device 516 and the associated graphical user interface (GUI) 518, etc. For example, a computer minimum system consisting of only the processing device 504, the storage resource 506 and the network interface 520 is included.

[0102] The embodiments of the present specification also provide a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program implements the above method when executed by a processor.

[0103] The embodiments of the present specification also provide a computer-readable instruction, wherein when a processor executes the instruction, the program therein causes the processor to execute the above method.

[0104] It should be understood that in the various embodiments of the present specification, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present specification.

[0105] It should also be understood that in the embodiments of this specification, the term "and / or" is only a description of the association relationship of the associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in the embodiments of this specification generally indicates that the associated objects before and after are in an "or" relationship.

[0106] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the embodiments of this specification can be implemented with electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the embodiments of this specification.

[0107] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0108] In the several embodiments provided in the embodiments of this specification, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, or it can be an electrical, mechanical or other form of connection.

[0109] 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, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of this specification.

[0110] In addition, each functional unit in each embodiment of the present specification can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units.

[0111] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of this specification is essentially or the part that contributes to the prior art, or all or 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 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 method described in each embodiment of the embodiment of this specification. 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 code.

[0112] The embodiments of this specification use specific embodiments to illustrate the principles and implementation methods of the embodiments of this specification. The description of the above embodiments is only used to help understand the methods and core ideas of the embodiments of this specification. At the same time, for those skilled in the art, according to the ideas of the embodiments of this specification, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the embodiments of this specification.

Claims

1. A shared access method based on cloud native storage data volumes, characterized in that: The method comprises: When deploying the target container group on the target working node of the Kubernetes platform, determine whether at least one container group having a shared access requirement with the target container group has been deployed on the Kubernetes platform; If no container group having a shared access requirement with the target container group is deployed on the Kubernetes platform, a persistent volume corresponding to the shared access requirement local to the Kubernetes platform is mounted on the target container group so that the target container group can access the data in the persistent volume; If at least one container group having a shared access requirement with the target container group has been deployed on the Kubernetes platform, it is determined whether there is a container group on which the persistent volume has been mounted among the deployed container groups; If there is a container group that has mounted the persistent volume among the deployed container groups, determine whether there is a corresponding NFS shared volume for the persistent volume; If the NFS shared volume does not exist, run the NFS service process on the working node corresponding to the container group that has mounted the persistent volume, generate an NFS shared volume corresponding to the persistent volume, and mount the NFS shared volume on the target container group, so that the target container group can access the data in the persistent volume through the NFS shared volume; If the NFS shared volume exists, the NFS shared volume is mounted on the target container group, so that the target container group can access the data in the persistent volume through the NFS shared volume.

2. The method according to claim 1, characterized in that If there is a container group that has mounted the persistent volume, the method further includes: Determine whether the working node corresponding to the container group that has mounted the persistent volume is the target working node; If it is the target working node, mounting the persistent volume on the target container group; If it is not the target working node, the step of determining whether there is a corresponding NFS shared volume for the persistent volume is executed.

3. The method according to claim 1, characterized in that Running the NFS service process on the working node corresponding to the container group on which the persistent volume has been mounted, and generating the NFS shared volume corresponding to the persistent volume further includes: An NFS process container is deployed on a working node corresponding to the container group on which the persistent volume has been mounted, and the NFS service process is run in the NFS process container, and the file system format of the persistent volume is converted to the NFSv4 network file system format to generate the NFS shared volume.

4. The method according to claim 1, characterized in that: The method further comprises: When reducing the multiple container groups corresponding to the shared access requirements deployed on the Kubernetes platform to a single container group, the container group on which the persistent volume is mounted is retained.

5. The method according to claim 4, characterized in that When reducing the multiple container groups corresponding to the shared access requirements deployed on the Kubernetes platform to a single container group, the method further includes: After deleting all container groups that mount the NFS shared volume from the Kubernetes platform, delete the NFS shared volume.

6. A shared access system based on cloud native storage data volumes, characterized in that: Including master nodes and worker nodes; The master node is used to manage the container groups with shared access requirements deployed on each of the working nodes; A CSI plug-in is deployed in the working node. When the container group corresponding to the shared access requirement is deployed on the working node, the CSI plug-in executes the method described in any one of claims 1 to 5.

7. A computer device comprising a memory, a processor, and a computer program stored in the memory, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 5 is implemented.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.

9. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.