Method for storing by using network disk in container orchestration engine and related device

By introducing WebDAVFS service and external storage manager in K8s, the mapping relationship between containers and network disks is established, and the problem of limited storage expansion of K8s is solved, and the expansion of container storage and data processing capabilities are improved.

CN119201353APending Publication Date: 2024-12-27GUANGZHOU YAXIN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411407418.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-10
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

The existing container orchestration engine K8s is limited in terms of storage expansion and cannot meet the needs of large-scale data processing.

Method used

By introducing WebDAVFS service in K8s, using external storage managers and WebDAV servers, a mapping relationship between containers and network disks is established to achieve the expansion of container storage.

Benefits of technology

It realizes the data transmission channel between the container and the network disk, expands the storage capacity of K8s, and meets the needs of large-scale data processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119201353A_ABST
    Figure CN119201353A_ABST
Patent Text Reader

Abstract

The invention discloses a method for storing by using a network disk in a container orchestration engine and a related device, and relates to the field of control, and the method comprises the following steps: obtaining a creation request for creating a target POD supporting WebDAVFS service for a target application; a CSI controller in the first slave node is controlled to access an external storage manager in the master node based on the creation request to obtain a WebDAV server address and related information of a target application, and the related information of the target application is at least related to a network disk; controlling the CSI controller to request the WebDAV server to load the target application according to the related information of the target application to obtain a loading result; scheduling and creating a target POD and determining a target slave node where the target POD is located; and mounting the WebDAVFS service to the target POD based on the loading result so as to establish a mapping relationship between the target application and the network disk through the target POD, and realizing that the target application operates the file of the network disk through the target POD based on the mapping relationship.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of control, and in particular to a method and related device for using a network disk for storage in a container orchestration engine. Background Art

[0002] K8s (Kubernetes, container orchestration engine) is an open source container orchestration platform that can automate the deployment, expansion and management of containerized applications. It is widely used due to its advantages such as high availability, scalability and fault tolerance.

[0003] During the operation of K8s, huge storage space is required to store data to meet data processing needs. Therefore, storage expansion of containers is an issue that needs to be solved urgently.

[0004] The existing storage expansion method for containers is generally based on the native storage management capabilities of the container platform. Due to the limitations of the storage management capabilities, when the storage space for the container is larger than the storage management capabilities, it cannot meet the data processing needs. Summary of the invention

[0005] The first aspect of the present application provides a method for using a network disk for storage in a container orchestration engine, comprising: Obtain a creation request for creating a target scheduling unit POD for a target application, where the target POD supports a WebDAVFS service of a distributed authoring and version control file system based on the World Wide Web; The container storage interface CSI controller in the first slave node of the control container orchestration engine K8s accesses the external storage manager in the master node of K8s based on the creation request to obtain the network distributed authoring and version management WebDAV server address and the relevant information of the target application, wherein the external storage manager is pre-configured with the WebDAV server address, and the relevant information of the target application is at least related to the network disk used by the target application, and the K8s includes a plurality of nodes; Controlling the CSI controller to access the WebDAV server based on the WebDAV server address to request the WebDAV server to load the target application according to the relevant information of the target application to obtain a loading result; Schedule to create a target POD and determine the target slave node where the target POD is located; Based on the loading result, the WebDAVFS service is mounted to the POD of the target slave node to establish a mapping relationship between the target application and the network disk through the target POD. Based on the mapping relationship, the target application can operate the files stored in the network disk through the target POD.

[0006] In one possible implementation, the pre-deployment process for K8s includes: Control the deployment of WebDAVFS driver in K8s; In daemon mode, control each slave node in K8s to start the CSI plug-in, so as to control each slave node to provide CSI node service, and the CSI node service supports the creation of target POD; In a stateful service mode, the CSI plug-in is started on the first slave node in K8s to provide a CSI controller service based on the WebDAVFS service.

[0007] In a possible implementation, the container storage interface CSI controller in the first slave node of the control container orchestration engine K8s accesses the external storage manager in the master node of K8s based on the creation request to obtain the network distributed authoring and version management WebDAV server address and relevant information of the target application, including: Controlling the CSI controller to request application identity information and authentication information of the application from the external storage manager based on the creation request; Controlling the CSI controller to receive the application identity information and authentication information fed back by the external storage manager; Based on controlling the CSI controller to obtain relevant information corresponding to the application identity information through authentication of the external storage manager based on the application identity information and the authentication information; Control the CSI controller to obtain the WebDAV server address from local configuration information based on the creation request.

[0008] In a possible implementation, controlling the CSI controller to access the WebDAV server based on the WebDAV server address to request the WebDAV server to load the target application according to the relevant information of the target application to obtain a loading result includes: Controlling the CSI controller to determine a target loading mode corresponding to a storage type based on the storage type in the relevant information of the target application, where the storage type is a storage type of a network disk requested by the target application; According to the target loading mode, the CSI controller is controlled to load the target application to obtain a loading result.

[0009] In a possible implementation, the method further includes: a processing process for operating files stored in the network disk, the process is as follows: Receive an operation request for a target file in the network disk; Controlling the WebDAV server to parse the operation request to obtain the storage type of the network disk corresponding to the operation request; The WebDAV server is controlled to respond to the operation request in a response manner corresponding to the storage type of the network disk.

[0010] In a possible implementation, if the operation request is a read request, controlling the WebDAV server to respond to the operation request in a response manner corresponding to the storage type of the network disk includes: Control the WebDAV server to determine whether the target file corresponding to the read request exists locally; If the target file exists locally, respond to the read request based on the target file stored locally; If the target file does not exist locally, based on the mapping relationship between the target POD and the network disk, the step of controlling the WebDAV server to respond to the read request in a response manner corresponding to the storage type of the network disk is executed.

[0011] In a possible implementation, if the operation request is a write request, controlling the WebDAV server to respond to the operation request in a response manner corresponding to the storage type of the network disk includes: Controlling the WebDAV server to obtain the operation type of the network disk according to the write request; Based on the operation type supporting the write operation, controlling the WebDAV server to request the network disk to perform the write operation on the target file; Based on the fact that the operation type does not support write operation, the WebDAV server is controlled to download the target file from the network disk to the local computer, and the local target file is divided into at least two fragments; the write operation is performed based on the at least two fragments; and the at least two fragments on which the write operation is completed are submitted to the network disk.

[0012] In a possible implementation, the method further includes: receiving a deletion request, wherein the deletion request is used to delete a target application for the external storage manager; Based on the deletion request, delete the target POD corresponding to the target application; Control the CSI node service to uninstall the WebDAVFS service in the target slave node where the target POD is located; The CSI controller in the first slave node is controlled to access the WebDAV server corresponding to the target POD, so as to control the WebDAV server to uninstall the target application for the external storage manager.

[0013] In a possible implementation, after controlling the WebDAV server to uninstall the target application for the external storage manager, the method further includes: Control the WebDAV server to reduce the number of references corresponding to the account of the target application by one to obtain a target number, where the number of references represents the number of PODs corresponding to the account; If the target number is zero, uninstall the storage content of the account; If the target number is not zero, the storage content of the account is retained.

[0014] A second aspect of the present application provides a computer program product, including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements the method of using a network disk for storage in a container orchestration engine according to the first aspect or any implementation of the first aspect.

[0015] A third aspect of the present application provides an electronic device, comprising at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program so that the electronic device can implement the method of using a network disk for storage in a container orchestration engine according to the first aspect or any implementation of the first aspect.

[0016] A fourth aspect of the present application provides a computer storage medium, which carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can use a network disk for storage in the container orchestration engine of the first aspect or any implementation of the first aspect.

[0017] In summary, the present application provides a method and related apparatus for using a network disk for storage in a container orchestration engine, including: obtaining a creation request for creating a target POD for a target application, wherein the target POD supports a service based on WebDAVFS; controlling a container CSI controller in a first slave node of the container orchestration engine K8s to access an external storage manager in a master node of K8s based on the creation request to obtain a WebDAV server address and relevant information of the target application, wherein the external storage manager is pre-configured with a WebDAV server address, and the relevant information of the target application is at least related to the network disk used by the target application, and the K8s includes several nodes; controlling the CSI controller to access the WebDAV server based on the WebDAV server address to request the WebDAV server to load the target application according to the relevant information of the target application to obtain a loading result; scheduling the creation of a target POD, and determining a target slave node where the target POD is located; based on the loading result, mounting the WebDAVFS service to the POD of the target slave node to establish a mapping relationship between the target application and the network disk through the target POD, and based on the mapping relationship, enabling the target application to operate files stored in the network disk through the target POD. In this solution, a CSI controller is set in the first slave node of K8s, an external storage manager and a WebDAV server are set in the master node, the target application is controlled to be recorded in the WebDAV server, and the WebDAVFS service supported by the target POD is mounted to the target slave node where the target POD is created. A mapping relationship between the target POD and the network disk in K8s is established. Based on the mapping relationship, the target application can realize a data transmission channel between the target POD and the network disk. Through the data transmission channel, operations can be performed on files stored in the network disk. The network disk serves as an extension of the container storage in K8s, and extended storage of containers in K8s through the network disk is realized. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.

[0019] Figure 1 It is a schematic diagram of the K8s structure used in a method for using a network disk for storage in a container orchestration engine provided in an embodiment of the present application; Figure 2 It is a flowchart of a method for using a network disk for storage in a container orchestration engine provided by an embodiment of the present application; Figure 3It is a flowchart of the pre-deployment process for K8s provided in an embodiment of the present application; Figure 4 It is a flowchart of a container storage interface CSI controller in a first slave node of a control container orchestration engine K8s provided in an embodiment of the present application, accessing an external storage manager in a master node of K8s based on the creation request to obtain an address of a network distributed authoring and version management WebDAV server and related information of the target application; Figure 5 A flowchart of controlling a CSI controller to access a WebDAV server based on a WebDAV server address to request the WebDAV server to load the target application according to relevant information of the target application and obtain a loading result is provided in an embodiment of the present application; Figure 6 This is a timing diagram of mounting a network disk provided in an embodiment of the present application; Figure 7 It is a flowchart of a processing process for operating files stored in a network disk provided by an embodiment of the present application; Figure 8 It is a flow chart provided in an embodiment of the present application for controlling the WebDAV server to respond to the operation request in a response mode corresponding to the storage type of the network disk according to the mapping relationship between the target POD and the network disk; Fig. 9 is a timing diagram of a read process provided in an embodiment of the present application; Fig.10 Another flowchart of controlling the WebDAV server to respond to the operation request in a response mode corresponding to the storage type of the network disk according to the mapping relationship between the target POD and the network disk provided in an embodiment of the present application; Fig.11 is a timing diagram of a write process provided in an embodiment of the present application; Fig.12 This is a flowchart of deleting an application provided by an embodiment of the present application; Fig.13 It is a flowchart of processing storage for a target application provided by an embodiment of the present application; Fig.14 is a timing diagram of deleting an application provided in an embodiment of the present application; Fig.15 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0020] The following describes the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation method section of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application.

[0021] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0022] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, which is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.

[0023] Figure 1 It is a schematic diagram of the K8s structure adopted in a method of using a network disk for storage in a container orchestration engine provided in an embodiment of the present application, the schematic diagram includes a master node 101 (master) and two slave nodes 102-103, wherein the master node includes an external storage manager and a WebDAV (Web-based Distributed Authoring and Versioning, network distributed creation and version management) server, the external storage manager is provided with an API (Application Program Interface, application program interface) server and application related information, the related information may include appID (application ID), storage type (storage type), account information (account), mount directory (mountDir), etc., the WebDAV server is provided with an API server and an adapter, and a corresponding adapter is provided for each external network disk, the Figure 1 The network disk includes S3 (Simple Storage Service) storage and cloud disk storage. Among them, the slave node 102 is provided with a CSI (Container Storage Interface) controller and POD1 and POD2, and the slave node 103 is provided with POD3. Both slave nodes are provided with CSI node services. Among them, the CSI controller is responsible for managing the storage volume (Volume) in the corresponding K8s. When the CSI node service is provided in the slave node, the slave node supports the creation of the target POD.

[0024] Figure 2This is a flow chart of a method for using a network disk for storage in a container orchestration engine provided in an embodiment of the present application, which may include steps 201 to 205, and these steps are described in detail below.

[0025] 201. Obtain a creation request for creating a target POD for a target application, where the target POD supports a WebDAVFS service; Among them, in this embodiment, it is a process of creating a data transmission channel between the target application and the network disk in K8s for the target application. Specifically, a target POD is created in a slave node in the K8s to establish a data transmission channel between the target application and the network disk through the POD.

[0026] Among them, the tenant user of K8s can request K8s to create a creation request for a target POD for a target application through an interface or a configuration method in a specific format.

[0027] As an example, the configuration file in the specific format may be in HAML (HTML abstraction markup language) format, where HAML is a format for data serialization.

[0028] The creation request representation uses K8s, and the POD created for the target application enables the target application to use the network disk.

[0029] Among them, the target POD requested to be created supports the WebDAVFS (Web Distributed Authoring and Versioning, Web-based distributed writing and version control file system) service. The WebDAVFS is an open source project that uses FUSE (Filesystem in Userspace) to mount the WebDAV service on the Linux system or macOS system. The WebDAVFS service allows tenant users to access files on the WebDAV server through the network file system, just like accessing local files.

[0030] 202. Control the CSI controller in the first slave node of K8s to access the external storage manager in the master node of K8s based on the creation request to obtain the WebDAV server address and the relevant information of the target application, wherein the external storage manager is pre-configured with the WebDAV server address, and the relevant information of the target application is at least related to the network disk used by the target application, and the K8s includes several nodes; K8s includes several nodes, including master nodes and slave nodes.

[0031] The first slave node and the target slave node involved in this application are both slave nodes. The first slave node and the target slave node may be the same node or different nodes, which is not limited in this application.

[0032] The master node is provided with an external storage manager and a WebDAV server. The external storage manager pre-allocates mounting paths for each network disk mounted on the K8s, and the external storage manager is used to provide a meta-mapping relationship between the application and each network disk. The WebDAV server is used to provide a unified interface service for accessing the network disk and converting the network disk into a WebDAV interface.

[0033] As an example, the meta-mapping relationship may include: the network disk type (storage type) that an application can access, application identity information, authentication information, mount directory, etc. Of course, the meta-mapping relationship may also include other content, which is not limited in this application.

[0034] In one possible implementation, in K8s, only one WebDAV server can be set up and set up in the master node; or it can be deployed according to the nodes, with one server deployed in each node.

[0035] Among them, a CSI controller is set in the first slave node in the K8s. The CSI controller meets the K8s control specification and can implement corresponding interface functions in the creation (Provision) stage and the connection (Attach) stage in the dynamic storage configuration.

[0036] Among them, the CSI controller implements CreateVolume and DeleteVolume in the Provision phase. The two are two important interfaces in the CSI storage mechanism, which are used to create storage volumes and delete storage volumes respectively.

[0037] Among them, the CSI controller implements controller volume mounting (ControllerPublishVolume) and controller volume unmounting (ControllerUnpulishVolume) in the Attach phase. The two are two important interfaces in the CSI storage mechanism. They are used to mount (attach) the storage volume to the specified node and unmount (detach) the storage volume from the specified node.

[0038] Among them, the create access request is responded to by the CSI controller in the first slave node. Specifically, based on the create request, the external management memory set on the master node in K8s is accessed, and various network disk related information is preset in the external management memory.

[0039] In this K8s, the CSI controller accesses the network disk through the WebDAV server. In order to realize the data path for access, The CSI controller first accesses the external storage manager to obtain the address of the WebDAV server, so as to load the target application into the WebDAV server by accessing the WebDAV server later.

[0040] When the CSI controller accesses the external storage manager, it also obtains relevant information of the target application.

[0041] The relevant information may include the storage type, mount path, and identification and authentication information of the target application configured for the external storage manager. The storage type represents the storage type of the external storage manager that the target application can access.

[0042] The CSI controller may send the access request to an external storage manager, and the external storage manager allocates an available network disk to the target application.

[0043] In one possible implementation, the CSI controller accesses the external storage manager in the K8s master node based on the creation request. The external storage manager allocates a network disk for the application based on the creation request to obtain relevant information of the target application, and feeds back the WebDAV server address and relevant information of the target application to the CSI controller. Figure 4 This process is described in detail in .

[0044] The network disk may adopt S3 storage, cloud disk storage (icloud), etc., and the cloud disk storage may include cloud disk storages of various operators.

[0045] Among them, PVC (Persistent Volume Claim) will be referenced in the YAML description of the application to create a POD. The storage plug-in type (storage class) will be clearly defined in the PVC. The storage plug-in type corresponds to the meaning of the CSI controller. One storage plug-in type corresponds to one storage plug-in service.

[0046] 203. Control the CSI controller to access the WebDAV server based on the WebDAV server address to request the WebDAV server to load the target application according to the relevant information of the target application, and obtain a loading result; Among them, after the CSI controller receives the WebDAV server address and related information of the target application fed back by the external storage manager, it accesses the WebDAV server according to the WebDAV server address, and the CSI controller also traverses the related information of the target application, and requests the WebDAV server to load the target application based on the related information to obtain the corresponding loading result.

[0047] The WebDAV server implements the loading process of the network disk of the corresponding storage type according to the relevant information of the storage type and the target application.

[0048] If the network disk has been loaded for the target application, this step does not need to be performed.

[0049] The obtained loading result includes a file list accessible to the target application, which is a list of files stored in the network disk and accessible to the target application.

[0050] 204. Schedule to create a target POD and determine the target slave node where the target POD is located; Among them, a POD is created in K8s. The POD can be created in any slave node. The target slave node where the target POD is located is determined to provide a basis for the subsequent mounting of the WebDAVFS service.

[0051] The target slave node may be the first slave node, or other slave nodes, which is not limited in the present application.

[0052] In a possible implementation, a slave node may be determined based on the remaining resources in each slave node, the remaining resources in the slave node being able to carry the data transmission between the POD and the network disk, and a target POD may be created in the slave node.

[0053] 205. Based on the loading result, the WebDAVFS service is mounted to the target POD of the target slave node, so as to establish a mapping relationship between the target application and the network disk through the target POD. Based on the mapping relationship, the target application can operate the files stored in the network disk through the target POD.

[0054] The target application is loaded based on the WebDAV server, and the target POD in the target slave node is controlled to mount the WebDAVFS service.

[0055] The process of mounting the WebDAVFS service may be implemented by using the CSI node service in the target slave node. Specifically, the CSI node service mounts the WebDAVFS service through FUSE-bin in the CSI driver.

[0056] Among them, the FUSE-bin is a binary file, which is used to mount the WebDAVFS service to the file of the target POD. Through the target POD, the network disk can be accessed just like accessing local files.

[0057] In a possible implementation, before executing the solution in this embodiment, each slave node in K8s may be pre-deployed so that each slave node in K8s can provide a basis for mounting the network disk. Figure 3 The K8s pre-deployment process is described in detail.

[0058] Among them, after the target POD establishes the mapping relationship between the target application and the network disk, the target POD can be controlled to start normally and return the mounting path to the tenant user end so that the tenant user end can perform read and write operations through the mounting path.

[0059] Moreover, since a mapping relationship between the target POD and the network disk is established, and the target POD is created for the target application to access the network disk, when the POD is migrated, it is only necessary to modify the mapping relationship between the network disk and the POD.

[0060] In this embodiment, by setting a CSI controller in the first slave node of K8s, setting an external storage manager and a WebDAV server in the master node, controlling the target application to be mounted to the WebDAV server, and mounting the WebDAVFS service supported by the target POD to the target slave node that created the target POD, a mapping relationship between the target application and the network disk based on the target POD is established in K8s. Based on the mapping relationship, a data transmission channel between the target application and the network disk through the target POD and the network disk can be realized. Through the data transmission channel, operations can be performed on files stored in the network disk. The network disk serves as an extension of the container storage in K8s, and expanded storage of containers in K8s through the network disk is realized.

[0061] Figure 3 It is a flowchart of the pre-deployment process for K8s provided in an embodiment of the present application, which may include steps 301 to 303. These steps are described in detail below.

[0062] 301. Control the deployment of WebDAVFS driver in K8s; Among them, this embodiment is the process of pre-deployment of K8s by K8s operation and maintenance personnel, which provides a basis for the subsequent establishment of a mapping relationship between the target POD and the network disk, so that the mapping relationship can enable the target application to operate the files on the network disk through the target POD.

[0063] Among them, the process of deploying the WebDAVFS driver in K8s can be to place the image of the corresponding WebDAVFS driver in the image server used by K8S.

[0064] In the process of deploying the WebDAVFS driver, the WebDAVFS driver is uploaded by mirroring, and the corresponding deployment action adopts the deployment type including, and the deployment type can be a process daemon mode type and an application management mode, etc.

[0065] 302. In daemon mode, control each slave node in K8s to start the CSI plug-in, so as to control each slave node to provide a CSI node service, and the CSI node service supports the creation of a target POD; In order to create a target POD from any slave node in K8s, you can start the CSI plug-in for each slave node in the cluster in advance.

[0066] Accordingly, a daemon process is used to start the CSI plug-in in each slave node, so that the CSI controller can subsequently manage the target PODs subsequently created in each slave node.

[0067] Among them, the slave node of the CSI plug-in is started in daemon mode, which can provide CSI node service. The CSI node service is used to execute the subsequent fuse-bin in the driver to mount the WebDAVFS service to the target POD of the target slave node.

[0068] The process guarding mode may adopt a daemon set (Daemonset).

[0069] 303. In a stateful service mode, control the first slave node in K8s to start the CSI plug-in and provide a CSI controller service based on the WebDAVFS service.

[0070] Among them, any slave node in the K8s can be set as the first slave node to provide CSI controller services to the outside world.

[0071] The selection method may be random selection or selecting a slave node according to the setting requirements of the CS controller, which is not limited in this application.

[0072] Correspondingly, an application management method is adopted to start a CSI plug-in in the first slave node to provide the CSI controller server for external components, and it is based on the WebDAVFS service.

[0073] The external component may be an external provisioner and an external attacher. The external provisioner is responsible for managing the external processor in a sidecar manner and is defined in the same Pod as the CSI plug-in deployed this time.

[0074] Among them, the stateful service mode can adopt a stateful service set (StatefulSet).

[0075] It should be noted that since StatefulSet needs to ensure the stability of the application topology, the update of the target Pod is strictly guaranteed in order. Specifically, the next target Pod will be created and started only after the previous target Pod is stopped and deleted. StatefulSet will ensure that when the Pod is deleted and rebuilt, there will always be one and only one Pod with the CSI plug-in running in the cluster. The specific slave node to be scheduled is determined by K8S at runtime.

[0076] In this embodiment, it also includes: controlling the deployment of the WebDAVFS service in the K8s, and controlling each slave node in the K8s to start the CSI plug-in in a process daemon manner, so that each slave node can provide a CSI node service, and the CSI node service supports the creation of a target POD; and, using an application management method, controlling the first slave node in the K8s to start the CSI plug-in, and the first slave node can provide a CSI controller service based on the WebDAVFS service, thereby realizing the pre-deployment of K8s and providing a creation basis for the subsequent creation of the target POD.

[0077] Figure 4 This is a flowchart of the container storage interface CSI controller in the first slave node of the container orchestration engine K8s provided in an embodiment of the present application, which accesses the external storage manager in the master node of K8s based on the creation request to obtain the network distributed creation and version management WebDAV server address and related information of the target application. It can include steps 401 to 404, and these steps are described in detail below.

[0078] 401. Control the CSI controller to request application identity information and authentication information of the application from the external storage manager based on the creation request; After receiving the creation request, the CSI controller requests the application identity information and authentication information of the application from the external storage manager.

[0079] The application identity information may be an ID assigned to the application to identify the application; the authentication information is specifically used for authentication to determine whether the application has the authority to access the target network disk.

[0080] After receiving the request from the CSI controller, the external storage manager configures the file lists of different network disks that the application can access to form an ACL (Access Control List).

[0081] After allocating application identity information and authentication information to the application, the external storage manager feeds back the application identity information and authentication information to the CSI controller.

[0082] 402. Control the CSI controller to receive application identity information and authentication information fed back by the external storage manager; The CSI controller receives the application identity information and authentication information of the target application generated by the external storage manager in response to the request of the CSI controller.

[0083] The external storage manager manages multiple PODs created for applications, so the applications need to be authenticated.

[0084] As an example, the authentication information may be an API-KEY (key).

[0085] 403. Controlling the CSI controller to obtain relevant information corresponding to the application identity information through authentication of the external storage manager based on the application identity information and the authentication information; Among them, the control CSI controller authenticates the external storage manager based on the application identity information and authentication information. After the external storage manager passes the authentication, it can access different network disk configuration information based on the application and return various related information corresponding to the application identity information.

[0086] Among them, the relevant information, identity information and authentication information constitute the metadata of the application, which is the metadata of the application for the network disk. The metadata is required when mounting the network disk and subsequently accessing the network disk.

[0087] In subsequent steps, this related information is used in the loading process.

[0088] 404. Control the CSI controller to obtain the WebDAV server address from local configuration information based on the creation request.

[0089] The CSI controller is locally configured with configuration information, which may be specifically configured in YAML. The configuration YAML contains various related information required to establish a data transmission channel with a network disk, such as a WebDAV server address.

[0090] Accordingly, after receiving the creation request, the CSI controller obtains the WebDAV server address from the YAML.

[0091] In this embodiment, after the CSI controller receives the creation request, it requests the application identity information and authentication information of the target application from the external storage manager, and receives the application identity information and authentication information of the target application fed back by the external storage manager, and then obtains the relevant information of the application identity information sent by the external storage manager after passing the authentication of the external storage manager. The relevant information is the basis for subsequent loading of the target application and mounting the network disk. In addition, the CSI also obtains the WebDAV server address from the local configuration information based on the creation request, providing a basis for subsequent access to the WebDAV server to load the target application.

[0092] Figure 5 The embodiment of the present application provides a flowchart for controlling the CSI controller to access the WebDAV server based on the WebDAV server address to request the WebDAV server to load the target application according to the relevant information of the target application to obtain the loading result, which may include steps 501 to 502. These steps are described in detail below.

[0093] 501. Control the CSI controller to determine a target loading mode corresponding to a storage type based on the storage type in the relevant information of the target application, where the storage type is a storage type of a network disk requested by the target application; The relevant information of the target application includes various information such as storage type and mounting path.

[0094] The storage type is the storage type of the network disk requested by the target application. The network disk is mounted in K8s and accessed by the target application later.

[0095] As an example, the storage type includes S3 storage, cloud disk storage of operator A, cloud disk storage of operator B, etc.

[0096] Different adapters are required for access to different operators, and accordingly, the loading methods are different.

[0097] The CSI controller determines a target loading mode corresponding to the storage type based on the storage type in the relevant information of the target application.

[0098] Among them, different loading methods may be different execution actions in the loading process, or different parameters in the loading process, or both. This application does not limit the differences between different loading methods.

[0099] 502. According to the target loading mode, control the CSI controller to load the target application and obtain a loading result.

[0100] Wherein, according to the target loading method determined in the above steps, the CIS controller loads the target application.

[0101] In a possible implementation, the creation request may include the account information of the target application, such as a user name and password. When the CSI controller loads the target application, it loads it according to the account information so that the network disk can be accessed based on the account information later.

[0102] In this embodiment, the CSI controller is controlled to determine the target loading mode corresponding to the storage type based on the storage type in the relevant information of the target application, and the storage type is the storage type of the network disk requested by the target application; according to the target loading mode, the CSI controller is controlled to load the target application to obtain the loading result, thereby realizing that for network disks of different storage types, the CSI controller is controlled to load the target application to obtain the loading result, providing a basis for subsequent tenant users to access different network disks through the target application.

[0103] Figure 6 is a timing diagram of mounting a network disk provided in an embodiment of the present application, which corresponds to the above Figure 2-5 The overall process includes tenant users, operation and maintenance personnel, K8s, external storage manager and WebDAV server. The sequence includes the following steps: Step 601: The operation and maintenance personnel deploy the WebDAVFS driver in K8s; Step 602: Deploy the CSI controller service in K8s. Step 603: Deploy CSI node service in K8s; Step 604: The tenant user creates an application in K8s using WebDAV storage. Step 605: The CSI controller in K8s obtains application configuration information; Step 606: The external storage controller returns application metadata; The metadata includes application identity information and various related information of the application.

[0104] Step 607, K8s loads the application using WebDAV according to the storage type and account password in the metadata; Step 608, the WebDAV server checks whether it is loaded, and if not loaded, loads it; Step 609, the WebDAV server returns the loading result to K8s; Step 610: Perform POD scheduling in K8s and determine the mounting node; Step 611: Mount WebDAVFS on the CSI node server in K8s Step 612: In K8s, the POD starts up normally using the mount path.

[0105] Figure 7 It is a flowchart of the processing process of operating files stored in the network disk provided by an embodiment of the present application, which may include steps 701 to 703, and these steps are described in detail below.

[0106] 701. Receive an operation request for a target file in a network disk; The operation request is a read operation or a write operation on a target file in the network disk.

[0107] The network disk has been mounted to K8s, and a mapping relationship is pre-established in K8s for the target application and the network disk.

[0108] Among them, in K8s, the target file can be displayed in the form of a file in the directory corresponding to the Webdavfs service.

[0109] Among them, in K8s, the operation request is to access the files in the corresponding directory of Webdavfs mounted on the target POD through the application.

[0110] 702. Control the WebDAV server to parse the operation request and obtain the storage type of the network disk corresponding to the operation request; The WebDAV server responds to the operation request, and the target POD has a mapping relationship with the network disk. The mapping relationship is Figure 2 The embodiment shown is established.

[0111] The WebDAV server parses the operation request to obtain the request path, which is the specific path of the POD mapped to the network disk. The request path corresponds to the mount directory in the above embodiment, and the request path is the path used when requesting the mount directory.

[0112] Wherein, the storage type of the requested network disk is determined according to the request path.

[0113] Among them, according to the request path, determine in which network disk the target file of the requested operation is stored.

[0114] Among them, the operation request received by the POD is an operation request made using the standard OS (Operating System) interface. The operation request is an IO (input-output) format request, which only meets the needs of reading local files. Based on receiving the operation request, the VFS (virtual File System) module set in the OS kernel state accesses the FUSE driver in the kernel state. The FUSE driver calls the WebDAVFS service in the user state, which is received and processed by the external simulated file system program through the WebDAVFS service, and the request after processing is returned by the original path; the FUSE in the kernel state receives the IO format request forwarded by the VFS, encapsulates it into a FUSE data packet, and passes it to the user state.

[0115] In this process, the WebDAVFS service performs parameter conversion on the operation request in the standard IO format and converts it into an operation request that meets the processing format of the WebDAV processor.

[0116] The operation request that satisfies the processing format of the WebDAV processor may be an operation request that carries a Range header.

[0117] As an example, processing parameters of the WebDAV processor, such as token, WebDAVFS service-related information, etc., are added to the operation request in the standard IO format.

[0118] For example, when the operation request is a read request, the operation request obtained after parameter conversion is a get request with a Range header; when the operation request is a write request, the operation request obtained after parameter conversion is a patch request with a Range header. 703. Control the WebDAV server to respond to the operation request in a response method corresponding to the storage type of the network disk.

[0119] Among them, different network disks respond differently to the same operation request.

[0120] Therefore, in this embodiment, after determining the storage type of the network disk, the WebDAV server is controlled to respond to the operation request in a corresponding response method. If the operation request is a write operation, the write operation is performed on the file in the network disk in the corresponding response method. If the operation request is a read operation, the read operation is performed on the file in the network disk in the corresponding response method.

[0121] Different response methods are required for read and write operations. Fig. 9 and Fig.11 The response methods for the two operation requests are explained respectively.

[0122] In this embodiment, it also includes: a processing process for operating files stored in the network disk, specifically including: receiving an operation request for a target file in the network disk; controlling the WebDAV server to parse the operation request to obtain the storage type of the network disk corresponding to the operation request; controlling the WebDAV server to respond to the operation request in a response method corresponding to the storage type of the network disk. When operating on a file in a certain network disk, the WebDAV server parses the operation request to obtain the storage type of the corresponding network disk, and responds to the operation request in a response method corresponding to the storage type of the network disk, thereby realizing the mapping relationship between the target POD and the network disk, and achieving the purpose of using K8s to operate the mounted network disk.

[0123] Figure 8 It is a flowchart provided by an embodiment of the present application for controlling the WebDAV server to respond to the operation request in a response method corresponding to the storage type of the network disk, which may include steps 801 to 803, and these steps are described in detail below.

[0124] 801. Control the WebDAV server to determine whether a target file corresponding to the read request exists locally; The operation request is a read request, and this embodiment is an explanation of the response process to the read request.

[0125] The read request is to read the target file in the network disk. If the target file exists locally, the target file can be read locally to increase the reading speed.

[0126] Therefore, a determination is made as to whether a target file corresponding to the read request exists locally.

[0127] Among them, the local contains the storage space of each node in K8s.

[0128] 802. If the target file exists locally, respond to the read request based on the target file stored locally; If the target file exists locally, read the locally stored target file.

[0129] 803. If the target file does not exist locally, based on the mapping relationship between the target POD and the network disk, execute the step of controlling the WebDAV server to respond to the read request in a response method corresponding to the storage type of the network disk.

[0130] If the target file does not exist locally in K8s, you need to read the target file from the network disk.

[0131] Accordingly, based on the mapping relationship between the target POD and the network disk, operations on the files in the network disk can be implemented.

[0132] The WebDAV server is controlled to determine the specific path from the POD to the target file stored in the network disk according to the mapping relationship between the target POD and the network disk, and respond to the operation request according to the response method corresponding to the storage type of the network disk.

[0133] The response method corresponding to the storage type of the network disk is specifically to call the adapter corresponding to the network disk.

[0134] Among them, the WebDAV server pre-sets the adapter corresponding to the storage type of each network disk. When determining which network disk file to operate, the read request is transferred to the adapter of the network disk, and the SDK (Software Development Kit) of the external storage is called to read the file of the corresponding network disk and obtain the reading result.

[0135] Subsequently, the WebDAV server replies the reading result to the WebDAVFS service, the WebDAVFS service replies the reading result to FUSE, and FUSE returns it to VFS, thereby returning to the user-mode process to return the reading result of the network disk to the user tenant end of K8s.

[0136] In this embodiment, if the operation request is a read request, after receiving the read request, it is determined whether there is a target file corresponding to the read request locally; if the target file exists locally, the read request is responded to based on the locally stored target file; if the target file does not exist locally, based on the mapping relationship between the target POD and the network disk, the WebDAV server is controlled to respond to the read request in a response method corresponding to the storage type of the network disk, thereby realizing direct reading of the target file on the network disk, without the need to cache the file in the network disk locally and then read it therefrom, thereby reducing the demand for K8s storage space.

[0137] Fig. 9 is a timing diagram of the read process provided in the embodiment of the present application, which corresponds to the above Figure 7-8 The overall process includes POD, WebDAVFS service, WebDAV server, and network disk. The sequence includes the following steps: Step 901, the application POD accesses the files in the directory corresponding to the mounted WebDAVFS service; Among them, access is a read operation using the standard OS interface.

[0138] Step 902: OS kernel VFS accesses FUSE driver; Step 903: The FUSE driver invokes the user-mode WebDAVFS service read request; Step 904: The WebDAVFS service parses the read request, performs parameter conversion, and obtains the get request and request path of the WebDAV server; Step 905: The WebDAVFS service sends a Range header request to the WebDAV server; Step 906: The WebDAV server parses the read request, obtains the corresponding storage type, and converts it into a corresponding storage operation; Step 907: The WebDAV server sends a read request to the network disk; Step 908: The network disk returns a response to the WebDAV server; Step 909: The WebDAV server returns the response to the WebDAVFS server. Step 910: The WebDAVFS service returns a response to the POD.

[0139] Fig.10 This is another flowchart provided by an embodiment of the present application for controlling the WebDAV server to respond to the operation request in a response manner corresponding to the storage type of the network disk, which may include steps 1001 to 1003, and these steps are described in detail below.

[0140] 1001. Control the WebDAV server to obtain the operation type of the network disk according to the write request; The operation request is a write request, and this embodiment is an explanation of the response process to the write request.

[0141] The WebDAV server is controlled to parse the write request, and the storage type of the network disk is determined according to the request path of the write request.

[0142] The storage type may include whether a write operation is supported, where the write operation is to partially modify the resources in the network disk.

[0143] Therefore, by obtaining the operation type of the network disk, it is determined whether the network disk supports write operations.

[0144] If the network disk supports write operations, execute step 1002; otherwise, execute step 1003.

[0145] 1002. Based on the fact that the operation type supports write operation, control the WebDAV server to request the network disk to perform a write operation on the target file; If the network disk supports write operations, the WebDAV server requests the network disk to perform write operations to implement write operations on the target files stored therein.

[0146] In a possible implementation, the WebDAV server calls the corresponding interface of the network disk to complete the write operation on the file.

[0147] As an example, the network disk is an S3 storage device, and the corresponding Upload Part interface can be called to implement a file write operation in the S3 storage device.

[0148] Among them, if the network disk supports write operations, the files in the network disk can be written directly through the network without caching the files locally.

[0149] 1003. Based on the fact that the operation type does not support write operation, control the WebDAV server to download the target file from the network disk to the local computer, and divide the local target file into at least two fragments; If the network disk does not support write operations, the WebDAV server is controlled to download the target file from the network disk to the local computer, so as to perform write operations on the target file locally.

[0150] Among them, the target file downloaded to the local computer can be fragmented, a new directory can be created for the file name, and the multiple fragments can be saved. The fragmentation principle can be set according to actual conditions and is not limited in this application.

[0151] During the download process, the target file of the network disk can be fragmented to achieve local fragment storage.

[0152] 1004. Perform a write operation based on the at least two shards. Among them, for the slices involved in the write operation, the write operation is performed on the target file.

[0153] In a possible implementation, a read-while-write method may be used to perform write operations on the slices of the target file.

[0154] For example, the target file is 10M (megabytes), each shard is 1M, and the target file is divided into 10 shards. According to the write operation range of 1.1M-1.2M, the involved shards are shard 1 and shard 2. Find the corresponding shards and perform write operations to update them. Among them, update shard 1 first and then update shard 2. Subsequently, only shards 3 to shard 10 are read, and write operations are not performed on shards 3 to shard 10.

[0155] 1005. Submit at least two shards that have completed the write operation to the network disk.

[0156] When writing is completed for the slices involved in the write operation and the WebDAV server receives the completion operation, submission is triggered.

[0157] The receiving completion operation may be receiving a close operation of the application.

[0158] The WebDAV server concatenates the fragments in order to obtain the file, and then uploads it to the network disk.

[0159] In this embodiment, if the operation request is a write request, the WebDAV server is controlled to obtain the operation type of the network disk based on the write request; based on the fact that the operation type supports write operations, the WebDAV server is controlled to request the network disk to perform a write operation on the target file; based on the fact that the operation type does not support write operations, the WebDAV server is controlled to download the target file from the network disk to the local computer, and divide the local target file into at least two fragments; the write operation is performed based on the at least two fragments; the at least two fragments that have completed the write operation are submitted to the network disk, thereby realizing the write operation on the target file of the network disk. In this solution, if the network disk supports write operations, the files in the network disk can be written directly through the network without the need to cache the files locally.

[0160] Fig.11 is a timing diagram of the write process provided in the embodiment of the present application, which corresponds to the above Figure 7 , 10 The overall process includes POD, WebDAVFS, WebDAV server, and network disk. The sequence includes the following: 1001. Use POD to access files in the directory corresponding to the mounted WebDAVFS service; Among them, access is a write operation using the standard OS interface.

[0161] 1002. OS kernel VFS accesses FUSE driver; 1003. The FUSE driver calls the user-mode WebDAVFS service write request; 1004. The WebDAVFS service parses the write request, performs parameter conversion, and obtains the patch request and request path of the WebDAV server; 1005. The WebDAVFS service sends a Range header request to the WebDAV server. 1006. The WebDAV server parses the write request, obtains the corresponding storage type, and converts it into a corresponding storage operation; If it is local storage, execute steps 1007-1010; if it is network disk storage, execute steps 1011-1013.

[0162] 1007. The WebDAV server performs a write operation on the local storage; 1008. The WebDAV server returns the write request response to the WebDAVFS service; 1009. The WebDAVFS service returns the write request response to the POD; 1010. The WebDAV server submits the file to the network disk when the application is closed; 1011. The WebDAV server uploads the write request to the network disk through the corresponding interface; 1012. The network disk returns a write request response to the WebDAV server; 1013. The WebDAV server returns a write request response to the WebDAVFS service; 1014. The WebDAVFS service returns the write request response to the POD.

[0163] Fig.12 This is a flowchart for deleting an application provided in an embodiment of the present application, which may include steps 1201 to 1204, and these steps are described in detail below.

[0164] 1201. Receive a deletion request, where the deletion request is used to delete a target application for an external storage manager; Among them, tenant users can delete the target applications supported in K8s through a specific interface or specific command line.

[0165] For example, the specific command line may be a delete command in Kubectl.

[0166] 1202. Based on the deletion request, delete the target POD corresponding to the target application; After receiving the deletion request, the K8s determines the corresponding target POD based on the information of the target application carried in the deletion request, and then deletes the target POD corresponding to the target application.

[0167] 1203. Control the CSI node service to uninstall the WebDAVFS service in the target slave node where the target POD is located; The CSI node service is used to control the POD in the node.

[0168] After deleting the target POD, the CSI node service uninstalls the WebDAVFS service in the target slave node where the target POD is located.

[0169] The K8s also deletes the PVC of the target application.

[0170] 1204. Control the CSI controller in the first slave node to access the WebDAV server corresponding to the target POD, so as to control the WebDAV server to uninstall the target application for the external storage manager.

[0171] The CSI controller also accesses the WebDAV server corresponding to the target POD, traverses various information of the target application in the WebDAV server, and requests the WebDAV server to uninstall according to the various information of the target application.

[0172] Among them, various information of the target application may include account information of the target application, related information of the target application, etc. The related information may include storage type, mounting path, identification and authentication information of the target application, etc.

[0173] Among them, the WebDAV server uninstalls the target application according to various information of the target application, and the target application can no longer access the files on the network disk through the POD in the K8s.

[0174] After controlling the WebDAV server to uninstall the target application for the external storage manager, it is also necessary to process the storage of the target application. Fig.14 The process is described in detail in .

[0175] In this embodiment, after receiving a deletion request to delete the target application for the external storage manager, the target POD corresponding to the target application is deleted, and the CSI node service is controlled to uninstall the WebDAVFS service in the target slave node where the target POD is located. The CSI controller in the first slave node is also controlled to access the WebDAV server corresponding to the target POD to control the WebDAV server to uninstall the target application for the external storage manager, thereby realizing the deletion of the target application in K8s.

[0176] Fig.13 It is a flowchart for processing the storage of the target application provided by an embodiment of the present application, which may include steps 1301 to 1303, and these steps are described in detail below.

[0177] 1301. Control the WebDAV server to reduce the number of references corresponding to the target application account by one to obtain a target number, where the number of references represents the number of PODs corresponding to the account. Among them, one application can create PODs for multiple accounts, and each POD can realize the information transmission channel between the corresponding account in the target application and the network disk.

[0178] Accordingly, when deleting an application, the tenant user makes a request to delete the application through his account.

[0179] Therefore, when controlling the WebDAV server to uninstall the target application for the external storage manager, the application is deleted for a certain account, and it is also necessary to determine whether the storage of the account is processed later.

[0180] For example, a corresponding POD is created for each account of the application. Accordingly, if a tenant user uninstalls the application through a certain account, only the content corresponding to the account in the target application is uninstalled, and the content corresponding to other accounts is not processed.

[0181] Accordingly, Fig.12 In this method, the target application is uninstalled for the tenant user's account.

[0182] Among them, after uninstalling the target application for a certain account, the WebDAW server reduces the number of references corresponding to the account by one. The obtained target number represents the number of PODs corresponding to the account in the current K8s. The number of PODs is the number of applications corresponding to the account. Each account has a mapping relationship with the external manager through a POD.

[0183] 1302. If the target number is zero, uninstall the storage content of the account; If the target number is zero, it means that in K8s, no application of the account has established a mapping relationship with the network disk through POD, and all storage contents of the account can be completely uninstalled.

[0184] Among them, all the storage contents of the account are uninstalled, so as to uninstall all applications of the account in K8s.

[0185] 1303. If the target number is not zero, retain the storage content of the account.

[0186] If the target number is not zero, it means that in K8s, the account has applications that establish a mapping relationship with the network disk through POD, and the storage content of the account needs to be retained so that other applications can access the files on the network disk through the corresponding POD.

[0187] In this embodiment, after controlling the WebDAV server to uninstall the target application for the external storage manager, the WebDAV server is controlled to reduce the number of references corresponding to the target application by one to obtain the target number, which represents the number of PODs corresponding to the target application, and the number of PODs corresponding to the target application is the number of accounts of the target application in K8s with the target application; if the target number is zero, the target application has no account to establish a mapping relationship with the network disk through POD, and the storage content of the target application is uninstalled; if the target number is not zero, the storage content of the target application is retained so that other accounts can continue to access the files on the network disk through the corresponding POD, thereby realizing the deletion of the target application in K8s.

[0188] Fig.14 is a timing diagram of deleting an application provided in an embodiment of the present application, which corresponds to the above Figure 12-13 The overall process includes tenant users, K8s, and WebDAV servers. The sequence includes the following: 1401. The tenant user requests K8s to delete the application. 1402. K8s deletes POD; 1403. The CSIz node service in K8s uninstalls the WebDAVFS service; 1404. K8s deletes PVC; 1405. The CSI controller in K8s controls the WebDAV server to perform storage offloading. 1406. The WebDAV server determines whether the account still has references, and if not, uninstalls it; 1407. The WebDAV server returns the uninstallation result to the CSI controller of K8s.

[0189] The present application also provides an electronic device in an embodiment. Fig.15 As shown, it shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiment of the present application. The electronic device in the embodiment of the present application may include but is not limited to fixed terminals such as mobile phones, laptops, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, etc. Fig.15 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0190] like Fig.15 As shown, the electronic device may include a processing device 1501 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1502 or a program loaded from a storage device 1508 to a random access memory (RAM) 1503. When the electronic device is powered on, various programs and data required for the operation of the electronic device are also stored in the RAM 1503. The processing device 1501, the ROM 1502, and the RAM 1503 are connected to each other via a bus 1504. An input / output (I / O) interface 1505 is also connected to the bus 1504.

[0191] Typically, the following devices may be connected to the I / O interface 1505: an input device 1506 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 1507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 1508 including, for example, a memory card, a hard disk, etc.; and a communication device 1509. The communication device 1509 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although Fig.15An electronic device having various devices is shown, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0192] Also provided in an embodiment of the present application is a computer program product including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements a method for using a network disk for storage in any container orchestration engine provided in an embodiment of the present application.

[0193] A computer-readable storage medium is also provided in an embodiment of the present application. The storage medium carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement a method for using a network disk for storage in any container orchestration engine provided in an embodiment of the present application.

[0194] It should also be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.

[0195] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0196] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.

[0197] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a training device, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, training device, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.

Claims

1. A method for using a network disk for storage in a container orchestration engine, characterized in that: include: Obtain a creation request for creating a target scheduling unit POD for a target application, where the target POD supports a WebDAVFS service of a distributed authoring and version control file system based on the World Wide Web; The container storage interface CSI controller in the first slave node of the control container orchestration engine K8s accesses the external storage manager in the master node of K8s based on the creation request to obtain the network distributed authoring and version management WebDAV server address and the relevant information of the target application, wherein the external storage manager is pre-configured with the WebDAV server address, and the relevant information of the target application is at least related to the network disk used by the target application, and the K8s includes a plurality of nodes; Controlling the CSI controller to access the WebDAV server based on the WebDAV server address to request the WebDAV server to load the target application according to the relevant information of the target application to obtain a loading result; Schedule to create a target POD and determine the target slave node where the target POD is located; Based on the loading result, the WebDAVFS service is mounted to the POD of the target slave node to establish a mapping relationship between the target application and the network disk through the target POD. Based on the mapping relationship, the target application can operate the files stored in the network disk through the target POD.

2. The method for using a network disk for storage in a container orchestration engine according to claim 1, characterized in that: The pre-deployment process for K8s includes: Control the deployment of WebDAVFS driver in K8s; In daemon mode, control each slave node in K8s to start the CSI plug-in, so as to control each slave node to provide CSI node service, and the CSI node service supports the creation of target POD; In a stateful service mode, the CSI plug-in is started on the first slave node in K8s to provide a CSI controller service based on the WebDAVFS service.

3. The method for using a network disk for storage in a container orchestration engine according to claim 1, characterized in that: The container storage interface CSI controller in the first slave node of the control container orchestration engine K8s accesses the external storage manager in the master node of K8s based on the creation request to obtain the network distributed authoring and version management WebDAV server address and relevant information of the target application, including: Controlling the CSI controller to request application identity information and authentication information of the target application from the external storage manager based on the creation request; Controlling the CSI controller to receive the application identity information and authentication information fed back by the external storage manager; Based on controlling the CSI controller to obtain relevant information corresponding to the application identity information through authentication of the external storage manager based on the application identity information and the authentication information; Control the CSI controller to obtain the WebDAV server address from local configuration information based on the creation request.

4. The method for using a network disk for storage in a container orchestration engine according to claim 3, characterized in that: The controlling CSI controller accesses the WebDAV server based on the WebDAV server address to request the WebDAV server to load the target application according to the relevant information of the target application, and obtains the loading result, including: Controlling the CSI controller to determine a target loading mode corresponding to a storage type based on the storage type in the relevant information of the target application, where the storage type is a storage type of a network disk requested by the target application; According to the target loading mode, the CSI controller is controlled to load the target application to obtain a loading result.

5. The method for using a network disk for storage in a container orchestration engine according to claim 1, characterized in that: Also includes: The process of operating files stored in the network disk is as follows: Receive an operation request for a target file in the network disk; Controlling the WebDAV server to parse the operation request to obtain the storage type of the network disk corresponding to the operation request; The WebDAV server is controlled to respond to the operation request in a response manner corresponding to the storage type of the network disk.

6. The method for using a network disk for storage in a container orchestration engine according to claim 5, characterized in that: If the operation request is a read request, controlling the WebDAV server to respond to the operation request in a response manner corresponding to the storage type of the network disk includes: Control the WebDAV server to determine whether the target file corresponding to the read request exists locally; If the target file exists locally, respond to the read request based on the target file stored locally; If the target file does not exist locally, based on the mapping relationship between the target POD and the network disk, the step of controlling the WebDAV server to respond to the read request in a response manner corresponding to the storage type of the network disk is executed.

7. The method for using a network disk for storage in a container orchestration engine according to claim 5, characterized in that: If the operation request is a write request, controlling the WebDAV server to respond to the operation request in a response manner corresponding to the storage type of the network disk includes: Controlling the WebDAV server to obtain the operation type of the network disk according to the write request; Based on the operation type supporting the write operation, controlling the WebDAV server to request the network disk to perform the write operation on the target file; Based on the fact that the operation type does not support write operation, the WebDAV server is controlled to download the target file from the network disk to the local computer, and the local target file is divided into at least two fragments; the write operation is performed based on the at least two fragments; and the at least two fragments on which the write operation is completed are submitted to the network disk.

8. The method for using a network disk for storage in a container orchestration engine according to claim 2, characterized in that: Also includes: receiving a deletion request, wherein the deletion request is used to delete a target application for the external storage manager; Based on the deletion request, delete the target POD corresponding to the target application; Control the CSI node service to uninstall the WebDAVFS service in the target slave node where the target POD is located; The CSI controller in the first slave node is controlled to access the WebDAV server corresponding to the target POD, so as to control the WebDAV server to uninstall the target application for the external storage manager.

9. The method for using a network disk for storage in a container orchestration engine according to claim 8, characterized in that: After controlling the WebDAV server to uninstall the target application for the external storage manager, the method further includes: Control the WebDAV server to reduce the number of references corresponding to the account of the target application by one to obtain a target number, where the number of references represents the number of PODs corresponding to the account; If the target number is zero, uninstall the storage content of the account; If the target number is not zero, the storage content of the account is retained.

10. A computer program product, characterized in that The method comprises computer-readable instructions, which, when executed on an electronic device, enable the electronic device to implement the method for using a network disk for storage in a container orchestration engine according to any one of claims 1 to 9.