Automated Mounting Method and Device, Readable Storage Medium, and Computer Device

By mirroring the related software of the object storage file system and using the daemon set in the K8S cluster, the parallel file system is automatically mounted to each computing node in the K8S cluster, solving the problems of complex and inefficient operation and maintenance in the existing technology, and achieving efficient automatic mounting and operation and maintenance.

CN114327515BActive Publication Date: 2025-06-24SHENZHEN YISHIHUOLALA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111629786.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-28
Publication Date
2025-06-24
Estimated Expiration
2041-12-28

AI Technical Summary

Technical Problem

When mounting a parallel file system to a K8S cluster, the prior art requires manual installation of mount software and setting configuration files on the host, resulting in complex operation and maintenance and low efficiency, especially when cluster expansion or reduction, it requires manual intervention.

Method used

The software related to the object storage file system is created by mirroring the object, and the configuration parameters related to parallel file system mounting are obtained based on the software, and the daemon set in the K8S cluster is used to automatically mount the parallel file system into each computing node.

Benefits of technology

It realizes automatic mounting of parallel file systems in K8S clusters, reduces manpower investment, improves mounting efficiency, and automatically realizes mounting of new nodes after cluster expansion, reducing the intervention of manual operation and maintenance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114327515B_ABST
    Figure CN114327515B_ABST
Patent Text Reader

Abstract

The present application provides an automated mounting method, an automated mounting device, a computer-readable storage medium, and a computer device. The automated mounting method includes: imaging relevant software of an object storage file system; obtaining configuration parameters related to parallel file system mounting based on the imaged relevant software of the object storage file system; and mounting the parallel file system to each computing node by a daemon set in a K8S cluster based on the imaged relevant software of the object storage file system and the configuration parameters. The automated mounting method, the automated mounting device, the computer-readable storage medium, and the computer device according to the embodiments of the present application can achieve automated mounting of parallel file systems in each computing node, eliminating the need for manual mounting on the host machine and saving manpower. In addition, after the K8S cluster is expanded, the daemon set can automatically mount the distributed parallel file system of the newly added nodes, reducing the need for manual operation and maintenance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technologies. Specifically, this application relates to an automated mounting method, an automated mounting device, a computer-readable storage medium, and a computer device. Background Art

[0002] A parallel file system is an optimized high-performance file system provided by an object storage service (OBS), offering millisecond-level access latency, TB / s-level bandwidth, and million-level IOPS (read / write times), and capable of quickly processing high-performance computing (HPC) workloads.

[0003] As a sub-product of the object storage service, the parallel file system supports users to read data according to the standard OBS interface and also supports reading and writing data according to POSIX file semantics through the PFS client (obsfs tool) deployed in an elastic cloud server. Through obsfs, users can mount the created parallel file system to a cloud Linux server and can perform online processing on files and directories in the parallel file system just like operating a local file system. Online processing includes operations such as creating and deleting files / directories, renaming files / directories, and modifying and writing files.

[0004] Currently, the obsfs service provided by Huawei Cloud manufacturers can only manually create a parallel file system through the obsfs tool and mount it to a cloud Linux server. This process requires the installation of the Linux virtual machine environment dependency and the encapsulation of the obsfs tool, and also requires the distribution of obsfs configuration. In this case, for all nodes of the K8S cluster, it is necessary to manually install the mounting software on the host machine, set the configuration file, and also deal with problems such as machine restart and cluster expansion, which brings relatively great challenges to the use and operation and maintenance of the distributed parallel file system on K8S. Summary of the Invention

[0005] To at least solve one of the above technical defects, this application provides the following technical solutions: an automated mounting method, an automated mounting device, a computer-readable storage medium, and a computer device.

[0006] An embodiment of the present application provides an automated mounting method for automatically mounting a parallel file system to a K8S cluster, where the K8S cluster includes multiple computing nodes. The automated mounting method includes: imaging relevant software of an object storage file system; obtaining configuration parameters related to the mounting of the parallel file system based on the imaged relevant software of the object storage file system; and mounting the parallel file system to each of the computing nodes by a daemon set in the K8S cluster based on the imaged relevant software of the object storage file system and the configuration parameters.

[0007] In some embodiments, imaging the relevant software of obsfs includes: selecting a base image; installing basic dependency software; downloading and compiling the program of the object storage file system; writing an image startup script; and packaging and pushing the relevant software of the object storage file system to an image repository.

[0008] In some embodiments, after the step of obtaining, based on the imaged relevant software of the object storage file system, configuration parameters related to the mounting of the parallel file system, the automated mounting method further includes: encapsulating the configuration parameters by using a configuration set object in the K8S cluster. Mounting the parallel file system to each of the computing nodes by a daemon set in the K8S cluster based on the imaged relevant software of the object storage file system and the configuration parameters includes: mounting the parallel file system to each of the computing nodes by a daemon set in the K8S cluster based on the imaged relevant software of the object storage file system and the configuration set object encapsulating the configuration parameters.

[0009] In some embodiments, mounting the parallel file system to each of the computing nodes by a daemon set in the K8S cluster based on the imaged relevant software of the object storage file system and the configuration parameters includes: configuring the configuration parameters into the daemon set; and mounting the parallel file system to each of the computing nodes by the daemon set with the parameters configured based on the imaged relevant software of the object storage file system.

[0010] In some embodiments, the configuration parameters include a bucket of the object storage file system, a secret key of the object storage file system, and a secret of the object storage file system.

[0011] In some embodiments, each of the computing nodes is deployed in a host of the K8S cluster, and each computing node includes containers. The relevant software of the object storage file system made based on the image by the daemon set in the K8S cluster and the configuration set object encapsulating the configuration parameters mount the parallel file system to each computing node, including: mounting the configuration set object encapsulating the configuration parameters so that the containers can obtain the configuration parameters from the configuration set object; specifying the program of the object storage file system in the image repository, setting the container to enable the mount directory sharing permission at startup; specifying to mount the target directory in the host to the container; setting the container to unmount before stopping; based on the kubectl command of the K8S, the program of the object storage file system mounts the parallel file system to the target directory that has been mounted to the container; verifying whether each computing node successfully mounts the parallel file system.

[0012] In some embodiments, each of the computing nodes is deployed in a host of the K8S cluster, and each computing node includes containers. The relevant software of the object storage file system made based on the image by the daemon set with the parameters configured mounts the parallel file system to each computing node, including: specifying the program of the object storage file system in the image repository, setting the container to enable the mount directory sharing permission at startup; specifying to mount the target directory in the host to the container; setting the container to unmount before stopping; based on the kubectl command of the K8S, the program of the object storage file system mounts the parallel file system to the target directory that has been mounted to the container; verifying whether each computing node successfully mounts the parallel file system.

[0013] An embodiment of the present application also provides an automatic mounting device for automatically mounting a parallel file system to a K8S cluster, where the K8S cluster includes multiple computing nodes. The automatic mounting device includes an image making module, an obtaining module, and a mounting module. The image making module is used for making the relevant software of the object storage file system for the image. The obtaining module is used for obtaining the configuration parameters related to the mounting of the parallel file system based on the relevant software of the object storage file system made for the image. The mounting module is used for the daemon set in the K8S cluster to mount the parallel file system to each computing node based on the relevant software of the object storage file system made for the image and the configuration parameters.

[0014] An embodiment of the present application also provides a computer-readable storage medium. A computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the automated mounting method described in any of the above embodiments is implemented.

[0015] An embodiment of the present application also provides a computer device. The computer device includes: one or more processors; a memory; one or more computer programs, wherein the one or more computer programs are stored in the memory and configured to be executed by the one or more processors, and the one or more computer programs are configured to: execute the automated mounting method described in any of the above embodiments.

[0016] Compared with the prior art, the present application has the following beneficial effects:

[0017] The automated mounting method, automated mounting device, computer-readable storage medium, and computer device according to the embodiments of the present application mirror the relevant software of the object storage file system, obtain the relevant configuration parameters of the mounting operation based on the relevant software of the object storage file system, and finally use the daemon set in the K8S cluster to realize the automated mounting of the parallel file system in each computing node. There is no need to manually install mounting software and set configuration files on the host, saving manpower and greatly improving the efficiency of mounting the parallel file system to the K8S cluster. In addition, after the K8S cluster is expanded, the daemon set can automatically mount the distributed parallel file system of the newly added nodes, thereby reducing the intervention operation of manual operation and maintenance.

[0018] The additional aspects and advantages of the present application will be partially given in the following description, and these will become obvious from the following description, or can be understood through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The above and / or additional aspects and advantages of the present application will become obvious and easy to understand from the following description of the embodiments in conjunction with the drawings, where:

[0020] Figure 1 is a schematic flowchart of the automated mounting method according to some embodiments of the present application;

[0021] Figure 2 is a schematic block diagram of the automated mounting device according to some embodiments of the present application;

[0022] Figure 3 is a schematic flowchart of the automated mounting method according to some embodiments of the present application;

[0023] Figure 4 is a schematic flowchart of the automated mounting method according to some embodiments of the present application;

[0024] Figure 5 Schematic flowchart of the automated mounting method according to some embodiments of the present application;

[0025] Figure 6 Schematic flowchart of the automated mounting method according to some embodiments of the present application;

[0026] Figure 7 Schematic flowchart of the automated mounting method according to some embodiments of the present application;

[0027] Figure 8 Schematic diagram of the scenario of the automated mounting method according to some embodiments of the present application;

[0028] Figure 9 Schematic flowchart of the automated mounting method according to some embodiments of the present application;

[0029] Figure 10 Schematic diagram of the communication between the computer-readable storage medium and the processor according to some embodiments of the present application;

[0030] Figure 11 Schematic diagram of the computer device according to some embodiments of the present application. Detailed implementation manners

[0031] The embodiments of the present application will be described in detail below. Examples of the embodiments are shown in the accompanying drawings, where the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the accompanying drawings are exemplary and are only used to explain the present application and should not be construed as limiting the present application.

[0032] Those skilled in the art of the present technology can understand that unless specifically stated otherwise, the singular forms "a", "an", "the" and "said" used herein may also include the plural forms. It should be further understood that the term "comprising" used in the specification of the present application means the presence of the described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or their groups. The phrase "and / or" used herein includes all or any unit and all combinations of one or more of the associated listed items.

[0033] Those skilled in the art of the present technology can understand that unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meaning as the general understanding of those of ordinary skill in the art to which the present application belongs. It should also be understood that terms such as those defined in a general dictionary should be understood to have a meaning consistent with the meaning in the context of the prior art, and will not be interpreted in an idealized or overly formal sense unless specifically defined as here.

[0034] Please refer to Figure 1 , an embodiment of the present application provides an automated mounting method for automatically mounting a parallel file system to a K8S cluster, and the K8S cluster includes multiple computing nodes. The automated mounting method includes:

[0035] 01: Image-making the relevant software of the object storage file system;

[0036] 02: Obtaining configuration parameters related to the mounting of the parallel file system based on the relevant software of the object storage file system made by the image;

[0037] 03: Mounting the parallel file system to each computing node by the daemon set in the K8S cluster based on the relevant software of the object storage file system made by the image and the configuration parameters.

[0038] Please refer to Figure 2 , an embodiment of the present application also provides an automated mounting device 10. The automated mounting method of the embodiment of the present application can be implemented by the automated mounting device 10 of the embodiment of the present application. The automated mounting device 10 includes an image-making module 11, an obtaining module 12, and a mounting module 13. Step 01 can be implemented by the image-making module 11. Step 02 can be implemented by the obtaining module 12. Step 03 can be implemented by the mounting module 13.

[0039] That is to say, the image-making module 11 can be used to image-make the relevant software of the object storage file system. The obtaining module 12 can be used to obtain configuration parameters related to the mounting of the parallel file system based on the relevant software of the object storage file system made by the image. The mounting module 13 can be used to mount the parallel file system to each computing node by the daemon set in the K8S cluster based on the relevant software of the object storage file system made by the image and the configuration parameters.

[0040] Among them, K8S (i.e., Kubernetes) is a container cluster management system open-sourced by Google. Based on Docker technology, K8S provides a series of complete functions such as deployment and operation, resource scheduling, service discovery, and dynamic scaling for containerized applications, and can improve the convenience of large-scale container cluster management. The K8S cluster is composed of multiple host machines, and each host machine corresponds to a computing node.

[0041] The object storage file system of the embodiments of the present application can be obsfs, aws s3, Tencent Cloud cos, Alibaba Cloud Object Storage oss, etc., which is not limited herein. In an example of the present application, the object storage file system is obsfs. Obsfs is a file system tool based on FUSE provided by the Object Storage Service (OBS), which is used to mount the OBS parallel file system to the Linux system, enabling users to directly use the vast storage space of OBS like operating a file system locally. Therefore, when the parallel file system is mounted on the K8S cluster, users can perform online processing on the files and directories in the parallel file system as if operating a local file system.

[0042] However, the existing parallel file system needs to manually mount and install software and set configuration files on the host when mounting on the K8S cluster. This method not only requires a lot of manpower during mounting, but also requires manual intervention for deployment and operation and maintenance operations when the K8S cluster expands or shrinks, making the mounting operation of the parallel file system extremely complex and cumbersome.

[0043] In the automated mounting method and the automated mounting device 10 provided by the embodiments of the present application, relevant software of the object storage file system is made into an image, configuration parameters related to the mounting operation are obtained based on the relevant software of the object storage file system, and finally the automated mounting of the parallel file system in each computing node is realized by using the daemon set in the K8S cluster, without the need to manually install mounting software and set configuration files on the host, saving manpower and greatly improving the efficiency of mounting the parallel file system to the K8S cluster. In addition, after the K8S cluster expands, the daemon set can automatically realize the mounting of the distributed parallel file system on the newly added nodes, thereby reducing the need for manual operation and maintenance intervention.

[0044] Please refer to Figure 3 , in some embodiments, step 01 of making the relevant software of the object storage file system into an image includes:

[0045] 011: Select a base image;

[0046] 012: Install basic dependency software;

[0047] 013: Download and compile the program of the object storage file system;

[0048] 014: Write an image startup script;

[0049] 015: Package the relevant software of the object storage file system and push it to the image repository.

[0050] Please refer to again Figure 2, in some embodiments, steps 011, 012, 013, 014, and 015 can all be implemented by the image making module 11. That is to say, the image making module 11 can be further used to select a base image, install basic dependent software, download and compile the obsfs program, write an image startup script, and package and push the relevant software of the object storage file system to the image repository.

[0051] Specifically, first, a base image is selected. In an embodiment of the present application, the base image is the alpine base image. The alpine base image is a lightweight Linux distribution oriented to security, with a very small image capacity, fast image download speed, small storage space occupied by the image, and can shield relevant security issues. Of course, in other embodiments, other base images can also be selected, which are not limited herein. Subsequently, basic dependent software is installed. It can be understood that when a program needs to run on an operating system composed of docker containers, the operating system needs to include some basic software, and the basic dependent software here is the basic dependent software that constitutes the container. Subsequently, the program of the object storage file system (such as the obsfs program) is downloaded and compiled. Subsequently, the image startup script docker-entrypoint.sh is written. Among them, the startup script mainly obtains the authentication parameters and configuration parameters related to the storage bucket (such as obsfs bucket) of the object storage file system. Based on the above parameters, the following core mounting command of the example can be executed in the subsequent steps: obsfs ${OBS_BUCKET} ${MNT_POINT} -d -d -f -o passwd_file= / etc / passwd -obsfs -o -o url=${OBS_URL} -o use_ino -o allow_other to complete the mounting operation of the object storage file system (referred to as obsfs here). After the relevant software of obsfs in the image making is completed, the relevant software of the object storage file system after image making is packaged and pushed to the image repository. In an embodiment of the present application, the image repository is a docker image repository. The image repository can perform software upload (push) and download (extraction). In an embodiment of the present application, the relevant software of obsfs after image making is packaged and pushed to the docker image repository, which is convenient for extracting the relevant software through the network in the subsequent steps.

[0052] Please refer to Figure 4 and Figure 8 , in some embodiments, after step 02 of the automatic mounting method, it further includes:

[0053] 04: Encapsulating the configuration parameters by using the configuration set object in the K8S cluster;

[0054] Step 03 mounts the parallel file system to each computing node by the daemonset in the K8S cluster based on the relevant software of the object storage file system made from the image and the configuration parameters, including:

[0055] 031: The daemonset in the K8S cluster mounts the parallel file system to each computing node based on the relevant software of the object storage file system made from the image and the configuration set object encapsulating the configuration parameters.

[0056] Please refer to Figure 2 , in some embodiments, the automatic mounting device further includes an encapsulation module 14. Step 04 can be implemented by the encapsulation module 14. Step 031 can be implemented by the mounting module 13. That is to say, the encapsulation module 14 can be used to encapsulate the configuration parameters by using the configuration set object in the K8S cluster. The mounting module 13 can also be used to mount the parallel file system to each computing node by the relevant software of the object storage file system made from the image and the configuration set object encapsulating the configuration parameters by the daemonset in the K8S cluster.

[0057] Among them, the configuration parameters include bucket, key, secret key, path, etc. In an embodiment of the present application, the configuration parameters are obs bucket, obs Key, obs Secret key, obs url. The configuration set object can be the ConfigMap object of the K8S cluster. By encapsulating the configuration parameters by using the ConfigMap object, the corresponding containers in the object storage service system in the subsequent steps can obtain the mounted configuration parameters by mounting the ConfigMap object as an environment variable, avoiding manually repeating the configuration on multiple computing nodes and avoiding the problems caused by misoperations in this configuration process.

[0058] Please refer to Figure 5 , Figure 8 and Figure 9 , in some embodiments, each computing node is deployed in a host of the K8S cluster, and each computing node includes containers. Step 031 mounts the parallel file system to each computing node by the daemonset in the K8S cluster based on the relevant software of the object storage file system made from the image and the configuration set object encapsulating the configuration parameters, including:

[0059] 0311: Mount the configuration set object encapsulating the configuration parameters so that the container obtains the configuration parameters from the configuration set object;

[0060] 0312: Specify the program of the object storage file system in the image repository, and set the container to enable the shared permission of the mounting directory when starting;

[0061] 0313: Specify to mount the target directory in the host to the container;

[0062] 0314: Set to unmount before the container stops;

[0063] 0315: Based on the kubectl command of K8S, the program of the object storage file system mounts the parallel file system to the target directory that has been mounted to the container;

[0064] 0316: Verify whether the parallel file system is successfully mounted on each computing node.

[0065] Please refer to Figure 2 , in some embodiments, steps 0311, 0312, 0313, 0314, 0315 and 0316 can all be implemented by the mounting module 13. That is to say, the mounting module 13 can be further used to mount the configuration set object encapsulating the configuration parameters, so that the container can obtain the configuration parameters from the configuration set object, and specify the program of the object storage file system in the image repository, and set the container to enable the shared permission of the mounted directory at startup. The mounting module 13 can also be further used to specify to mount the target directory in the host to the container, set to unmount before the container stops, and based on the kubectl command of K8S, the program of the object storage file system mounts the parallel file system to the target directory that has been mounted to the container. The mounting module 13 can also be further used to verify whether the parallel file system is successfully mounted on each computing node.

[0066] Specifically, please combine Figure 8 and Figure 9, the parallel file system mounting in each computing node can be achieved by writing a DaemonSet object (i.e., the DaemonSet object) for the object storage file system operations in K8S. In a specific embodiment of the present application, first, mount the ConfigMap object encapsulating the configuration parameters in step 04. In this way, after the container started on each computing node in the K8S cluster is started, it will inject the configuration parameters in this configmap into the container as environment variables, and the container can obtain the configuration parameters from the environment variables. Subsequently, specify the obsfs image (i.e., the compiled obsfs program) pushed to the image repository in steps 011 to 014, and set the container to enable the mount directory sharing permission at startup. Subsequently, specify a certain path (i.e., the target directory) on the host to be mounted into the container, so that when obsfs performs the parallel file system mounting, the parallel file system will be mounted to the target directory of the host in the container, and the parallel file system mounting sharing is achieved through this target directory. Subsequently, specify that an umount operation is performed before the container stops. In this way, the parallel file system can be unmounted when the cluster is scaled down and the obsfs container (obsfs pod) stops. Subsequently, use the k8s kubectl command to deploy the parallel file system for each computing node in the K8S cluster. Specifically, the obsfs program mounts the parallel file system to the target directory that has been mounted to the container. In this way, the mounting operation of the parallel file system for all computing nodes in the K8S cluster can be achieved. After the obsfs program mounts the parallel file system to the target directory that has been mounted to the container, it is possible to further verify whether the distributed parallel file system is successfully mounted in the target directory of the host. If there is a situation where the distributed file system is not successfully mounted in the target directory of some or all hosts, the automatic mounting method described in the embodiment of the present application can be performed again. In this way, by adding the verification of whether the distributed parallel file system is successfully mounted, the successful mounting of the distributed file system in each computing node can be effectively ensured.

[0067] Please refer to Figure 6 , in some embodiments, step 03 mounts the parallel file system to each computing node by the DaemonSet in the K8S cluster based on the relevant software and configuration parameters of the object storage file system made from the image, including:

[0068] 032: Configure the configuration parameters into the DaemonSet;

[0069] 033: The DaemonSet with the parameters configured mounts the parallel file system to each computing node based on the relevant software of the object storage file system made from the image.

[0070] Please refer to again Figure 2, in some embodiments, both step 032 and step 033 can be implemented by the mounting module 13. That is to say, the mounting module 13 can be used to configure configuration parameters into the daemon process set, and the daemon process set with the parameters configured can mount the parallel file system into each computing node based on the relevant software of the object storage file system for image making.

[0071] Specifically, in the embodiments of the present application, instead of encapsulating configuration parameters using a configuration set object, multiple configuration parameters are configured into the daemon process set one by one. After all the configuration parameters are configured into the daemon process set, the daemon process set with the parameters configured can mount the parallel file system into each computing node based on the relevant software of the object storage file system for image making. This method can still achieve the automatic mounting of the parallel file system. Even when the K8S cluster scales in or out, the automatic mounting of the parallel file system can also be achieved.

[0072] Please refer to Figures 7 to 9 , in some embodiments, each computing node is deployed in a host of the K8S cluster, and each computing node includes containers. Step 033 that the daemon process set with the parameters configured mounts the parallel file system into each computing node based on the relevant software of the object storage file system for image making includes:

[0073] 0331: Specify the program of the object storage file system in the image repository, and set the container to enable the sharing permission of the mounting directory when starting.

[0074] 0332: Specify to mount the target directory in the host into the container.

[0075] 0333: Set the container to unmount before stopping.

[0076] 0334: Based on the kubectl command of K8S, the program of the object storage file system mounts the parallel file system into the target directory that has been mounted to the container.

[0077] 0335: Verify whether the parallel file system is successfully mounted to each computing node.

[0078] Please refer to again Figure 2, in some embodiments, steps 0331, 0332, 0333, 0334, and 0335 can all be implemented by the mounting module 13. That is to say, the mounting module 13 can be used to specify the program of the object storage file system in the image repository, set the container to enable the mounting directory sharing permission at startup, and specify to mount the target directory on the host machine into the container. The mounting module 13 can be further used to set the container to unmount before stopping. Based on the kubectl command of K8S, the object storage file system program mounts the parallel file system into the target directory that has been mounted into the container. The mounting module 13 can also be used to verify whether each computing node has successfully mounted the parallel file system.

[0079] Specifically, since the configuration parameters have been configured into the DaemonSet object, the container can directly obtain the configuration parameters from the DaemonSet object. Subsequently, specify the obsfs image (i.e., the compiled obsfs program) pushed to the image repository in steps 011 to 014, and set the container to enable the mounting directory sharing permission at startup. Subsequently, specify to mount a certain path (i.e., the target directory) on the host machine into the container. In this way, when obsfs executes the mounting of the parallel file system, it will mount the parallel file system into the target directory of the host machine in the container, and the mounting and sharing of the parallel file system are achieved through this target directory. Subsequently, specify to perform an unmount operation before the container stops. In this way, the parallel file system can be unmounted when the cluster is scaled down and the obsfs container (obsfs pod) stops. Subsequently, deploy the parallel file system of each computing node in the K8S cluster through the k8s kubectl command. Specifically, the obsfs program mounts the parallel file system into the target directory that has been mounted into the container. In this way, the mounting operation of the parallel file system for all computing nodes in the K8S cluster can be achieved. After the obsfs program mounts the parallel file system into the target directory that has been mounted into the container, it can be further verified whether the distributed parallel file system has been successfully mounted in the target directory of the host machine. If there is a situation where the distributed file system has not been successfully mounted in the target directory of some or all host machines, the automatic mounting method described in the embodiments of the present application can be performed again. In this way, by adding the verification of whether the distributed parallel file system is successfully mounted, the successful mounting of the distributed file system in each computing node can be effectively ensured.

[0080] The content of the method embodiments of this application is applicable to the device embodiments of this application. The functions specifically implemented by the device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those of the above methods. For specific details, please refer to the description in the method embodiments and will not be elaborated here.

[0081] Please combine Figure 8, in some embodiments, other application containers deployed in the K8S cluster can use the parallel file system by mounting the HostPath of the host machine. In this way, the applicable range of the parallel file system is wider and it is more convenient for users to use.

[0082] In summary, in the automated mounting method and device of the embodiments of the present application, the mounting of the parallel file system on each computing node in the K8S cluster is realized by combining the docker and the daemon set of K8S. In addition, by packaging the software and dependencies of the object storage file system tool with the docker image, the modification of the host machine environment can be avoided. Moreover, after the K8S cluster is expanded, the daemon set can automatically realize the mounting of the distributed parallel file system on the newly added nodes, which can reduce the intervention operation of manual operation and maintenance. In addition, the mounting logic of the parallel file system storage bucket is decoupled from the upper-layer business logic of K8S. The applications deployed in the upper-layer K8S only need to mount the directory and can operate the parallel file system just like using the local file system.

[0083] In addition, please refer to Figure 10 , the embodiments of the present application provide a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the automated mounting method described in any of the above embodiments is realized. Among them, the computer-readable storage medium includes but is not limited to any type of disk (including floppy disks, hard disks, optical disks, CD-ROMs, and magneto-optical disks), ROM (Read-Only Memory), RAM (Random Access Memory), EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), flash memory, magnetic cards or optical cards. That is, the storage device includes any medium that can store or transmit information in a readable form by a device (such as a computer, a mobile phone), and can be a read-only memory, a magnetic disk or an optical disk, etc.

[0084] The content of the method embodiments of the present application is applicable to the storage medium embodiments of the present application. The functions specifically implemented by the storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those of the above methods. For specific details, please refer to the descriptions in the method embodiments and will not be repeated here.

[0085] In addition, please refer to Figure 11, Embodiments of the present application also provide a computer device. The computer device described in this embodiment can be devices such as servers, personal computers, and network devices. The computer device includes: one or more processors, a memory, and one or more computer programs, where the one or more computer programs are stored in the memory and configured to be executed by the one or more processors, and the one or more computer programs are configured to execute the automated mounting method described in any of the above embodiments.

[0086] The content of the method embodiments of the present application is applicable to the computer device embodiments of the present application. The functions specifically implemented by the computer device embodiments of the present application are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those of the above methods. For specific details, please refer to the descriptions in the method embodiments and will not be elaborated here.

[0087] In addition, in each embodiment of the present application, each functional unit can be integrated in a processing module, or each unit can exist physically alone, or two or more units can be integrated in a module. The above integrated module can be implemented in the form of hardware or in the form of a software functional module. When the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.

[0088] The above are only some embodiments of the present application. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present application, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present application.

Claims

1. An automated mounting method for automatically mounting a parallel file system to a K8S cluster, where the K8S cluster includes multiple computing nodes, characterized in that, The automated mounting method includes: Mirror-making the relevant software of the object storage file system; Obtaining configuration parameters related to the parallel file system mounting based on the relevant software of the object storage file system made by the mirror; Mounting the parallel file system to each of the computing nodes by the daemon set in the K8S cluster based on the relevant software of the object storage file system made by the mirror and the configuration parameters; After the step of the automated mounting method obtaining the configuration parameters related to the parallel file system mounting based on the relevant software of the object storage file system made by the mirror, it further includes: Using the configuration set object in the K8S cluster to encapsulate the configuration parameters; The step of mounting the parallel file system to each of the computing nodes by the daemon set in the K8S cluster based on the relevant software of the object storage file system made by the mirror and the configuration parameters includes: Mounting the parallel file system to each of the computing nodes by the daemon set in the K8S cluster based on the relevant software of the object storage file system made by the mirror and the configuration set object encapsulating the configuration parameters; Each of the computing nodes is deployed in a host in the K8S cluster, and each computing node includes containers; The step of mounting the parallel file system to each of the computing nodes by the daemon set in the K8S cluster based on the relevant software of the object storage file system made by the mirror and the configuration set object encapsulating the configuration parameters includes: Mounting the configuration set object encapsulating the configuration parameters so that the containers can obtain the configuration parameters from the configuration set object; Specifying the program of the object storage file system in the mirror repository and setting the containers to enable the mounting directory sharing permission at startup; Specifying to mount the target directory in the host to the containers; Setting the containers to unmount before stopping; Based on the kubectl command of the K8S, mounting the parallel file system to the target directory that has been mounted to the containers by the program of the object storage file system; Verifying whether the parallel file system is successfully mounted to each of the computing nodes; The step of mounting the parallel file system to each of the computing nodes by the daemon set in the K8S cluster based on the relevant software of the object storage file system made by the mirror and the configuration parameters includes: Configuring the configuration parameters into the daemon set; Mounting the parallel file system to each of the computing nodes by the daemon set with the configuration parameters configured based on the relevant software of the object storage file system made by the mirror; The step of mounting the parallel file system to each of the computing nodes by the daemon set with the configuration parameters configured based on the relevant software of the object storage file system made by the mirror includes: Specifying the program of the object storage file system in the mirror repository and setting the containers to enable the mounting directory sharing permission at startup; Specifying to mount the target directory in the host to the containers; Set the container to be unmounted before stopping; Based on the kubectl command of the K8S, the program of the object storage file system mounts the parallel file system to the target directory that has been mounted to the container; Verify whether each computing node has successfully mounted the parallel file system.

2. The automated mounting method according to claim 1, wherein The relevant software for mirror-making the object storage file system includes: Select a base image; Install basic dependency software; Download and compile the program of the object storage file system; Write a mirror startup script; Package and push the relevant software of the object storage file system to the mirror repository.

3. The automated mounting method according to claim 2, wherein The configuration parameters include a storage bucket, a key, a secret key, and a path.

4. An automated mounting device for automatically mounting a parallel file system to a K8S cluster, the K8S cluster including a plurality of computing nodes, characterized in that, The automatic mounting device includes: A mirror-making module for mirror-making the relevant software of the object storage file system; An acquisition module for obtaining configuration parameters related to the mounting of the parallel file system based on the relevant software of the object storage file system made by the mirror; An encapsulation module for encapsulating the configuration parameters by using a configuration set object in the K8S cluster; A mounting module for mounting the parallel file system to each computing node by a daemon set in the K8S cluster based on the relevant software of the object storage file system made by the mirror and the configuration parameters; The process of mounting the parallel file system to each computing node by the daemon set in the K8S cluster based on the relevant software of the object storage file system made by the mirror and the configuration parameters includes: The daemon set in the K8S cluster mounts the parallel file system to each computing node based on the relevant software of the object storage file system made by the mirror and the configuration set object encapsulating the configuration parameters; Each computing node is deployed in a host of the K8S cluster, and each computing node includes a container; The process of mounting the parallel file system to each computing node by the daemon set in the K8S cluster based on the relevant software of the object storage file system made by the mirror and the configuration set object encapsulating the configuration parameters includes: Mount the configuration set object encapsulating the configuration parameters so that the container can obtain the configuration parameters from the configuration set object; Specify the program of the object storage file system in the mirror repository and set the container to enable the mounting directory sharing permission at startup; Specify to mount the target directory in the host to the container; Set the container to be unmounted before stopping; Based on the kubectl command of the K8S, the program of the object storage file system mounts the parallel file system to the target directory that has been mounted to the container; Verify whether each computing node has successfully mounted the parallel file system; The process of mounting the parallel file system to each computing node by the daemon set in the K8S cluster based on the relevant software of the object storage file system made by the mirror and the configuration parameters includes: Configure the configuration parameters into the daemon set; Based on the software related to the object storage file system made from the image, the set of daemon processes configured with parameters mounts the parallel file system into each of the computing nodes; The set of daemon processes configured with parameters mounts the parallel file system into each of the computing nodes based on the software related to the object storage file system made from the image, including: Specify the program of the object storage file system in the image repository, and set the container to enable the shared permission of the mount directory at startup; Specify to mount the target directory in the host machine into the container; Set the container to unmount before stopping; Based on the kubectl command of the K8S, the program of the object storage file system mounts the parallel file system into the target directory that has been mounted to the container; Verify whether the parallel file system is successfully mounted to each of the computing nodes.

5. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, it implements the automated mounting method according to any one of claims 1 to 3.

6. A computer device, characterized in that, It includes: One or more processors; A memory; One or more computer programs, wherein the one or more computer programs are stored in the memory and configured to be executed by the one or more processors, and the one or more computer programs are configured to: execute the automated mounting method according to any one of claims 1 to 3.

Citation Information

Patent Citations

  • Method for automatically creating and mounting LVM volume in K8s environment

    CN111880738A

  • Kubernetes-based mirror image construction method and system

    CN112835594A