WO2024174717A1 - Dynamic storage allocation method and apparatus, electronic device, and storage medium - Google Patents
Dynamic storage allocation method and apparatus, electronic device, and storage medium Download PDFInfo
- Publication number
- WO2024174717A1 WO2024174717A1 PCT/CN2023/141624 CN2023141624W WO2024174717A1 WO 2024174717 A1 WO2024174717 A1 WO 2024174717A1 CN 2023141624 W CN2023141624 W CN 2023141624W WO 2024174717 A1 WO2024174717 A1 WO 2024174717A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- storage
- template
- persistent volume
- request
- storage class
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 84
- 230000002085 persistent effect Effects 0.000 claims abstract description 288
- 238000004590 computer program Methods 0.000 claims description 19
- 238000011084 recovery Methods 0.000 claims description 12
- 230000004048 modification Effects 0.000 claims description 7
- 238000012986 modification Methods 0.000 claims description 7
- 230000004044 response Effects 0.000 claims description 7
- 230000001960 triggered effect Effects 0.000 claims description 4
- 230000008569 process Effects 0.000 description 15
- 238000010586 diagram Methods 0.000 description 12
- 238000012217 deletion Methods 0.000 description 6
- 230000037430 deletion Effects 0.000 description 6
- 230000002688 persistence Effects 0.000 description 6
- 238000004321 preservation Methods 0.000 description 6
- 238000012545 processing Methods 0.000 description 6
- 230000009471 action Effects 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 230000007246 mechanism Effects 0.000 description 3
- 101100233916 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) KAR5 gene Proteins 0.000 description 2
- 206010047289 Ventricular extrasystoles Diseases 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000004064 recycling Methods 0.000 description 2
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 1
- 101000827703 Homo sapiens Polyphosphoinositide phosphatase Proteins 0.000 description 1
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 1
- 102100023591 Polyphosphoinositide phosphatase Human genes 0.000 description 1
- 101100012902 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) FIG2 gene Proteins 0.000 description 1
- 239000003818 cinder Substances 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0668—Interfaces specially adapted for storage systems adopting a particular infrastructure
- G06F3/067—Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0614—Improving the reliability of storage systems
- G06F3/0619—Improving the reliability of storage systems in relation to data integrity, e.g. data losses, bit errors
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0638—Organizing or formatting or addressing of data
Definitions
- the present application relates to the field of computer technology, and in particular to a dynamic storage allocation method, a dynamic storage allocation device, an electronic device, and a computer non-volatile readable storage medium.
- Kubernetes also known as K8s
- K8s is an open source system that can be used to automate the deployment, expansion and management of containerized applications. It can provide a solution for dynamic storage allocation (Dynamic Provisioning) as opposed to static storage allocation.
- Dynamic Provisioning Dynamic Provisioning
- the Kubernetes system can automatically create a PV (Persistent Volume) and complete the binding with PVC after finding a suitable Storage Class for PVC (Persistent Volume Claim).
- Kubernetes can support multiple PV types, each with its own characteristics, and needs to be set according to their respective parameters when in use. Since Kubernetes supports many storage types and the parameters provided by different storage types vary greatly, it is easy to cause the corresponding StorageClass parameter configurations to be different, and some parameters are not displayed, which makes the administrator's configuration work cumbersome. Often, due to different storage type parameters, configuration errors occur, resulting in PV creation errors and application startup failures until the administrator makes the correct changes.
- embodiments of the present application are proposed to provide a dynamic storage allocation method, a dynamic storage allocation device, an electronic device and a computer non-volatile readable storage medium that overcome the above problems or at least partially solve the above problems.
- an embodiment of the present application discloses a dynamic storage allocation method, which is applied to a container cluster management system and includes:
- a storage class template is generated by using a template adapter to create a storage class based on the storage class template;
- a new persistent volume is provisioned in the created storage class, and a new persistent volume is created and bound to the persistent volume claim request to allocate a persistent volume for the persistent volume claim request.
- the method before obtaining the target storage type, the method further includes:
- the not deployed message is returned to allow the cluster administrator to deploy the persistent volume provisioner.
- the method when deploying the persistent volume provisioner, the method further comprises:
- the template adapter is triggered to obtain storage definition parameters corresponding to each storage type, generate template configuration information corresponding to each storage type and save it in the database.
- the trigger template adapter obtains storage definition parameters corresponding to each storage type, including:
- the template configuration information includes template generation rules and template parameter recommendations, and the template configuration information corresponding to each storage type is generated and saved in a database, including:
- obtaining the target storage type includes:
- At least one target storage type corresponding to at least one target storage provision object is obtained, where the storage provision object is an object used to provide persistent volume resources.
- a template adapter is used to generate a storage class template, including:
- a template adapter is used to query the database for template generation rules and template parameter recommendations corresponding to the target storage type, and a storage class template is generated according to the template generation rules and template parameter recommendations corresponding to the target storage type.
- a template adapter is used to query a database for template generation rules and template parameter recommendations corresponding to the target storage type, and a storage class template is generated according to the template generation rules and template parameter recommendations corresponding to the target storage type, including:
- the target storage type input by the cluster administrator is sent to the template adapter, so that after receiving the target storage type, the template adapter queries the database for the template generation rules and template parameter recommendations corresponding to the target storage type, and generates a storage class template based on the template generation rules and template parameter recommendations corresponding to the target storage type.
- the method before creating a storage class based on the storage class template, the method further includes:
- the template generation rules and template parameter recommendations corresponding to the target storage type are modified.
- creating a storage class based on a storage class template includes:
- At least one storage class is created that corresponds one-to-one to at least one target storage type.
- creating a storage class based on a storage class template further includes:
- the storage class template includes at least one of a storage provision object, a resource recovery policy, whether storage expansion is allowed, a mount option, a storage binding mode, and a storage parameter.
- Creating a storage class based on the storage class template includes:
- a storage class is created based on at least one of a storage provision object, a resource recovery policy, whether storage expansion is allowed, a mount option, a storage binding mode, and a storage parameter.
- obtaining a persistent volume claim request created by a user for applying for storage resources includes:
- provisioning a new persistent volume in the created storage class in accordance with the persistent volume claim request includes:
- the persistent volume claim request includes access mode information and storage size information
- a persistent volume provisioning procedure is used to provision a new persistent volume in a target storage class according to the persistent volume claim request, including:
- a new persistent volume is provisioned in the target storage class using the persistent volume provisioner based on the access mode information, storage size information, and storage definition parameters corresponding to the target storage type.
- creating a new persistent volume, and binding the new persistent volume to the persistent volume claim request includes:
- the method further comprises:
- the embodiment of the present application also discloses a dynamic storage allocation device, which is applied to a container cluster management system, and includes:
- An acquisition module is used to obtain the target storage type
- a template generation module used to generate a storage class template using a template adapter according to a target storage type, so as to create a storage class based on the storage class template;
- the storage class template includes storage definition parameters corresponding to the target storage type;
- the request acquisition module is used to obtain the persistent volume claim request created by the user to apply for storage resources
- An allocation module is used to provision a new persistent volume in the created storage class according to the storage definition parameters corresponding to the persistent volume claim request and the target storage type, create a new persistent volume, bind the new persistent volume to the persistent volume claim request, and allocate the persistent volume for the persistent volume claim request.
- the method before obtaining the target storage type, the method further includes:
- a determination module used to determine whether a persistent volume provisioning program has been deployed
- the return module is used to return the undeployment information if the persistent volume provisioner is not deployed so that the cluster administrator can deploy the persistent volume provisioner.
- the apparatus when deploying the persistent volume provisioning procedure, the apparatus further comprises:
- the trigger module is used to trigger the template adapter to obtain the storage definition parameters corresponding to each storage type, generate the template configuration information corresponding to each storage type and save it in the database.
- the trigger module includes:
- the definition parameter acquisition submodule is used to trigger the template adapter to obtain the storage definition parameters corresponding to each storage type provided by the persistent volume provisioning program.
- the template configuration information includes template generation rules and template parameter recommendations
- the trigger module includes:
- the template parameter generation submodule is used to generate template generation rules and template parameter recommendations corresponding to each storage type and save them in the database.
- the acquisition module includes:
- the storage type acquisition submodule is used to obtain at least one target storage type corresponding to at least one target storage provision object, where the storage provision object is an object used to provide persistent volume resources.
- the template generation module includes:
- the storage class template generation submodule is used to use the template adapter to query the database for template generation rules and template parameter recommendations corresponding to the target storage type, and generate a storage class template based on the template generation rules and template parameter recommendations corresponding to the target storage type.
- the storage class template generation submodule includes:
- the target storage type sending unit is used to send the target storage type input by the cluster administrator to the template adapter, so that after receiving the target storage type, the template adapter queries the database for template generation rules and template parameter recommendations corresponding to the target storage type, and generates a storage class template based on the template generation rules and template parameter recommendations corresponding to the target storage type.
- the method before creating a storage class based on the storage class template, the method further includes:
- the instruction response module is used to modify the template generation rules and template parameter recommendations corresponding to the target storage type in response to the template configuration information modification instruction input by the user.
- the template generation module includes:
- a creation submodule is used to create at least one storage class corresponding to at least one target storage type based on the storage class template.
- the template generation module further includes:
- the default storage class setting submodule is used to set a default storage class, which is applied to persistent volume claim requests that do not specify a storage class.
- the storage class template includes at least one of a storage provision object, a resource recovery policy, whether storage expansion is allowed, a mount option, a storage binding mode, and a storage parameter
- the template generation module includes:
- the storage class creation submodule is used to create a storage class based on at least one of the storage provision object, resource recovery policy, whether storage expansion is allowed, mounting options, storage binding mode and storage parameters.
- the request acquisition module includes:
- the persistent volume claim request acquisition submodule is used to obtain a persistent volume claim request created by a user that references a target storage class in at least one storage class.
- the allocation module includes:
- the search submodule is used to search for the target storage class
- the provisioning submodule is used to use the persistent volume provisioner to provision new persistent volumes in the target storage class based on the persistent volume claim request.
- the persistent volume claim request includes access mode information and storage size information
- the provisioning submodule includes:
- the persistent volume provisioning unit is used to use a persistent volume provisioning program to provision a new persistent volume in a target storage class according to the access mode information, the storage size information, and storage definition parameters corresponding to the target storage type.
- the allocation module includes:
- the real storage acquisition submodule is used to obtain the real storage specified by the persistent volume provisioning program
- the binding submodule is used to create a new persistent volume in the real storage and bind the new persistent volume to the persistent volume claim request.
- the apparatus further comprises:
- a data structure creation module that creates a data structure containing a persistent volume that references a persistent volume claim request by name.
- An embodiment of the present application also discloses an electronic device, including: a processor, a memory, and a computer program stored in the memory and capable of running on the processor, and the computer program implements the steps of the above dynamic storage allocation method when executed by the processor.
- the embodiment of the present application also discloses a computer non-volatile readable storage medium, on which a computer program is stored.
- a computer program is stored on which a computer program is stored.
- the steps of the above dynamic storage allocation method are implemented.
- the target storage type can be obtained, and according to the target storage type, a storage class template can be generated using a template adapter to create a storage class based on the storage class template; a persistent volume claim request created by a user for applying for storage resources is obtained; according to the persistent volume claim request, a new persistent volume is provisioned in the created storage class, and a new persistent volume is created, and the new persistent volume is bound to the persistent volume claim request to allocate the persistent volume for the persistent volume claim request.
- the embodiment of the present application can facilitate users to define the required persistent volumes more finely and accurately, and avoid the problem that the user misconfigures parameters of different storage types, resulting in persistent volume creation errors and application startup failures; in addition, it can also ensure that the persistent volume is recycled in the manner required by the user, avoiding accidental deletion of data, affecting the data preservation of stateful container applications or applications with data persistence requirements, and losing important data generated by the application, resulting in application reconstruction failure.
- FIG1 is a flowchart of a method for dynamic storage allocation provided by an embodiment of the present application.
- FIG2 is a flowchart of another method for dynamic storage allocation provided by an embodiment of the present application.
- FIG3 is a schematic diagram of a dynamic storage allocation process based on Kubernetes provided in an embodiment of the present application
- FIG4 is a structural block diagram of a dynamic storage allocation device provided in an embodiment of the present application.
- FIG. 5 is a schematic diagram of an electronic device provided in an embodiment of the present application.
- Kubernetes also known as K8s, is an open source system for automating the deployment, scaling, and management of containerized applications.
- storage resources are managed in a completely different way from computing resources (CPU (Central Processing Unit)/memory).
- CPU Central Processing Unit
- Kubernetes introduced two resource objects, Persistent Volume (PV) and Persistent Volume Claim (PVC), to implement the storage management subsystem.
- PV Persistent Volume
- PVC Persistent Volume Claim
- PV persistent volume
- GlusterFS Internet Small Computer System Interface
- RBD RADOS Block Device
- AWS Amazon Web Services
- PVC is a user's application for storage resources. Just like Pod consumes Node resources, PVC consumes PV resources. PVC can apply for the size of storage space and access mode (such as ReadWriteOnce, ReadOnlyMany or ReadWriteMany).
- the storage space requested using PVC may still not meet the various requirements of applications for storage devices.
- applications have different requirements for the characteristics and performance of storage devices, including read and write speed, concurrency performance, data redundancy, etc.
- Kubernetes introduced a new resource object StorageClass (SC) from version 1.4 to mark the characteristics and performance of storage resources and dynamically supply appropriate PV resources according to the needs of PVC.
- SC resource object StorageClass
- Kubernetes version 1.6 the mechanism of StorageClass and dynamic supply of storage resources has been improved, enabling on-demand creation of storage volumes, which is an important step in the process of automated management of shared storage.
- StorageClass storage resources as a certain category (Class), just like the configuration description (Profile) of storage devices, such as fast storage, slow storage, with data redundancy, without data redundancy, etc. Users can intuitively know the characteristics of various storage resources based on the description of StorageClass and apply for storage resources based on the application's demand for storage resources.
- Class just like the configuration description (Profile) of storage devices, such as fast storage, slow storage, with data redundancy, without data redundancy, etc.
- Profile configuration description
- the system will select a PV that meets the PVC requirements from the existing PVs based on the PVC's request for storage resources (storage space and access mode). Once found, the PV will be bound to the user-defined PVC, and the user's application can use this PVC. This will cause two problems:
- the PVC will remain in the Pending state indefinitely until the system administrator creates a PV that meets the requirements, affecting business deployment;
- PV PersistentVolumeClaim
- Kubernetes currently only has one 5GB PersistentVolume.
- Kubernetes can support multiple PV types. Each storage type has its own characteristics and needs to be set according to their respective parameters when used. The large difference in numbers can easily lead to different configurations of the corresponding StorageClass parameters, and some parameters are not displayed, which makes the administrator's configuration work cumbersome. Often, due to different storage type parameters, configuration errors occur, resulting in PV creation errors and application startup failures until the administrator makes the correct changes.
- the target storage type can be obtained, and according to the target storage type, a storage class template can be generated using a template adapter to create a storage class based on the storage class template; a persistent volume claim request created by a user for applying for storage resources is obtained; according to the persistent volume claim request, a new persistent volume is provisioned in the created storage class, and a new persistent volume is created, and the new persistent volume is bound to the persistent volume claim request to allocate the persistent volume for the persistent volume claim request.
- the embodiment of the present application uses a template adapter to generate a storage class template to create a storage class based on a storage class template, which can facilitate users to define the required persistent volumes more finely and accurately, and avoid the problem that the user misconfigures parameters of different storage types, resulting in persistent volume creation errors and application startup failures; in addition, it can also ensure that the persistent volume is recycled in the manner required by the user, avoiding accidental deletion of data, affecting the data preservation of stateful container applications or applications with data persistence requirements, and losing important data generated by the application, resulting in application reconstruction failure.
- FIG. 1 a flowchart of a method for dynamic storage allocation provided by an embodiment of the present application is shown.
- the method is applied to a container cluster management system, and the method may specifically include the following steps:
- Step 101 obtaining the target storage type.
- an administrator can specify at least one target storage type
- the container cluster management system can support multiple persistent volume types, for example:
- ⁇ AWSElasticBlockStore Elastic Block Store provided by AWS public cloud.
- ⁇ AzureFile File provided by Azure public cloud.
- ⁇ AzureDisk Disk provided by Azure public cloud.
- ⁇ CephFS an open source shared storage system.
- ⁇ FC Fibre Channel
- ⁇ Flocker An open source shared storage system.
- ⁇ GCEPersistentDisk Persistent Disk provided by GCE public cloud.
- ⁇ Glusterfs an open source shared storage system.
- ⁇ HostPath Host directory, only used for single-machine testing.
- ⁇ iSCSI iSCSI storage device.
- ⁇ Local Local storage device, introduced in Kubernetes version 1.7 and reached a stable version in version 1.14.
- Local PV can be provided by specifying a block device (Block Device), or the life cycle of Local PV can be managed through the sig-storage-local-static-provisioner plug-in developed by the community.
- ⁇ Portworx Volumes Storage services provided by Portworx.
- ⁇ RBD Ceph Block Device
- ⁇ StorageOS Storage services provided by StorageOS.
- ⁇ VsphereVolume Storage system provided by VMWare.
- Step 102 Generate a storage class template using a template adapter according to the target storage type, so as to create a storage class based on the storage class template.
- a storage class template can be generated using a template adapter according to the at least one target storage type to create a storage class based on the storage class template.
- Step 103 Obtain a persistent volume claim request created by a user for applying for storage resources.
- a user may create a persistent volume claim request for applying for storage resources, and the system may obtain the persistent volume claim request created by the user for applying for storage resources.
- Step 104 according to the persistent volume claim request, provision a new persistent volume in the created storage class, create a new persistent volume, bind the new persistent volume to the persistent volume claim request, and allocate a persistent volume for the persistent volume claim request.
- a new persistent volume can be provisioned in the created storage class according to the persistent volume claim request created by the user, and a new persistent volume can be created and bound to the persistent volume claim request, thereby allocating a persistent volume for the persistent volume claim request.
- the target storage type can be obtained, and according to the target storage type, a storage class template can be generated using a template adapter to create a storage class based on the storage class template; a persistent volume claim request created by a user for applying for storage resources is obtained; according to the persistent volume claim request, a new persistent volume is provisioned in the created storage class, and a new persistent volume is created, and the new persistent volume is bound to the persistent volume claim request to allocate the persistent volume for the persistent volume claim request.
- the embodiment of the present application can facilitate users to define the required persistent volumes more finely and accurately, and avoid the problem that the user misconfigures parameters of different storage types, resulting in persistent volume creation errors and application startup failures; in addition, it can also ensure that the persistent volume is recycled in the manner required by the user, avoiding accidental deletion of data, affecting the data preservation of stateful container applications or applications with data persistence requirements, and losing important data generated by the application, resulting in application reconstruction failure.
- FIG. 2 a flowchart of a method for dynamic storage allocation provided by an embodiment of the present application is shown.
- the method is applied to a container cluster management system.
- the method may specifically include the following steps:
- Step 201 determining whether a persistent volume provisioning program has been deployed
- Step 202 If the persistent volume provisioning program is not deployed, then return the non-deployment information to enable the cluster administrator to deploy the persistent volume provisioning program.
- the cluster administrator can set up the persistent volume provisioning program for the actual creation, deletion, and other operations of a specific type of storage.
- the container cluster management system can provide a unified standard, and the persistent volume provisioning program can provide storage definition parameters according to the standard.
- the method may further include: triggering the template adapter to obtain storage definition parameters corresponding to each storage type, generating template configuration information corresponding to each storage type, and saving the template configuration information to a database.
- triggering the template adapter to obtain storage definition parameters corresponding to each storage type may include: triggering the template adapter to obtain storage definition parameters corresponding to each storage type provided by the persistent volume provisioning program.
- the template configuration information includes template generation rules and template parameter recommendations.
- Generating template configuration information corresponding to each storage type and saving it in a database may include: generating template generation rules and template parameter recommendations corresponding to each storage type and saving them in a database.
- the template adapter when installing the persistent volume provisioning program, can be triggered to obtain storage definition parameters corresponding to each storage type provided by the persistent volume provisioning program, and at the same time generate template generation rules and template parameter recommendations and save them in the database.
- Step 203 obtaining the target storage type.
- step 203 may include: obtaining at least one target storage type corresponding to at least one target storage provision object, where the storage provision object is an object for providing persistent volume resources.
- the administrator can specify one or more storage provider objects to describe the provider objects of storage resources, which are used to provide specific persistent volume resources and can also be regarded as backend storage drivers.
- Step 204 Generate a storage class template using a template adapter according to the target storage type, so as to create a storage class based on the storage class template.
- a storage class template is generated using a template adapter according to a target storage type, which may include: using a template adapter to query a database for template generation rules and template parameter recommendations corresponding to the target storage type, and generating a storage class template according to the template generation rules and template parameter recommendations corresponding to the target storage type.
- the template adapter can query the database for template generation rules and template parameter recommendations of the corresponding type, and generate one or more storage class templates according to the queried information.
- the process may further include: modifying the template generation rules and template parameter recommendations corresponding to the target storage type in response to a template configuration information modification instruction input by a user.
- creating a storage class based on a storage class template may include: creating at least one storage class corresponding to at least one target storage type based on the storage class template.
- creating a storage class based on a storage class template may also include: setting a default storage class, where the default storage class is applied to persistent volume claim requests that do not specify a storage class.
- the administrator can modify the corresponding parameters according to the actual needs based on the generated template, create one or more storage volumes, and set a default storage volume at the cluster level for persistent volume claim requests that do not specify a storage volume.
- the storage class template includes at least one of a storage provision object, a resource recovery policy, whether storage expansion is allowed, a mount option, a storage binding mode, and a storage parameter.
- Creating a storage class based on the storage class template may include:
- a storage class is created based on at least one of a storage provision object, a resource recovery policy, whether storage expansion is allowed, a mount option, a storage binding mode, and a storage parameter.
- a storage class template may include information and recommended configurations of different dimensions, such as storage providers, resource recovery policies, whether storage expansion is allowed, mount options, storage binding modes, and storage parameters.
- a storage class may be created based on information and recommended configurations of different dimensions, such as storage providers, resource recovery policies, whether storage expansion is allowed, mount options, storage binding modes, and storage parameters.
- Step 205 Obtain a persistent volume claim request created by a user for applying for storage resources.
- step 205 may include: obtaining a persistent volume claim request created by a user that references a target storage class in at least one storage class.
- a user can create a persistent volume claim request that references one of the storage classes, and the system can obtain the persistent volume claim request created by the user for applying for storage resources.
- Step 206 according to the persistent volume claim request, provision a new persistent volume in the created storage class, create a new persistent volume, bind the new persistent volume to the persistent volume claim request, and allocate a persistent volume for the persistent volume claim request.
- provisioning a new persistent volume in a created storage class according to a persistent volume claim request may include: searching for a target storage class; and using a persistent volume provisioning program to provision a new persistent volume in the target storage class according to the persistent volume claim request.
- a persistent volume claim request includes access mode information and storage size information
- a persistent volume provisioning program is used to provision a new persistent volume in a target storage class according to the persistent volume claim request. This may include: using a persistent volume provisioning program to provision a new persistent volume in a target storage class according to the access mode information, storage size information, and storage definition parameters corresponding to the target storage type.
- the container cluster management system can find the storage class and provisioner referenced therein, and require the provisioner to provision a new persistent volume in the storage class according to the access mode and storage size requested by the persistent volume claim, as well as the parameters.
- creating a new persistent volume and binding the new persistent volume to a persistent volume claim request may include: obtaining real storage specified by a persistent volume provisioning program; creating a new persistent volume in the real storage, and binding the new persistent volume to the persistent volume claim request.
- the provisioner specifies the actual storage, creates a persistent volume, and binds it to the persistent volume claim request.
- the method may further include: creating a data structure containing a persistent volume that references the persistent volume claim request by name.
- a user can create a data structure containing the storage volume requested by referencing the persistent volume claim by name.
- the target storage type can be obtained, and according to the target storage type, a storage class template can be generated using a template adapter to create a storage class based on the storage class template; a persistent volume claim request created by a user for applying for storage resources is obtained; according to the persistent volume claim request, a new persistent volume is provisioned in the created storage class, and a new persistent volume is created, and the new persistent volume is bound to the persistent volume claim request to allocate the persistent volume for the persistent volume claim request.
- the embodiment of the present application can facilitate users to define the required persistent volumes more finely and accurately, and avoid the problem that the user misconfigures parameters of different storage types, resulting in persistent volume creation errors and application startup failures; in addition, it can also ensure that the persistent volume is recycled in the manner required by the user, avoiding accidental deletion of data, affecting the data preservation of stateful container applications or applications with data persistence requirements, and losing important data generated by the application, resulting in application reconstruction failure.
- FIG3 a schematic diagram of a dynamic storage allocation process based on a container cluster management system provided in the embodiments of the present application is shown.
- Step 1 If the persistent volume provisioning program has not yet been deployed, the cluster administrator sets up the persistent volume provisioning program.
- Step 2 The administrator specifies the storage provider (storage type).
- Step 3 The template adapter generates one or more storage class templates based on the storage type.
- Step 4 The administrator creates one or more storage classes based on the template and marks them as default.
- Step 5 The user creates a persistent volume claim request that applies one of the storage classes.
- Step 6 The container cluster management system finds the referenced storage class and provisioner, and asks the provisioner to provision a new persistent volume in the storage class according to the access mode and storage size and parameters requested by the persistent volume claim.
- Step 7 The provisioner specifies the actual storage, creates a persistent volume, and binds it to the persistent volume claim request.
- Step 8 The user creates a data structure containing the storage volume requested by the persistent volume claim by name.
- FIG. 4 shows a block diagram of a dynamic storage allocation device provided in an embodiment of the present application.
- the device is applied to a container cluster management system and may specifically include the following modules:
- An acquisition module 401 is used to acquire a target storage type
- the template generation module 402 is used to generate a storage class template using a template adapter according to the target storage type, so as to create a storage class based on the storage class template;
- the storage class template includes storage definition parameters corresponding to the target storage type;
- the request acquisition module 403 is used to acquire a persistent volume claim request created by a user for applying for storage resources;
- the allocation module 404 is used to provision a new persistent volume in the created storage class according to the storage definition parameters corresponding to the persistent volume claim request and the target storage type, create a new persistent volume, bind the new persistent volume to the persistent volume claim request, and allocate the persistent volume for the persistent volume claim request.
- the method before obtaining the target storage type, the method further includes:
- a determination module used to determine whether a persistent volume provisioning program has been deployed
- the return module is used to return the undeployment information if the persistent volume provisioner is not deployed so that the cluster administrator can deploy the persistent volume provisioner.
- the apparatus when deploying the persistent volume provisioning procedure, the apparatus further includes:
- the trigger module is used to trigger the template adapter to obtain the storage definition parameters corresponding to each storage type, generate the template configuration information corresponding to each storage type and save it in the database.
- the trigger module includes:
- the definition parameter acquisition submodule is used to trigger the template adapter to obtain the storage definition parameters corresponding to each storage type provided by the persistent volume provisioning program.
- the template configuration information includes template generation rules and template parameter recommendations
- the trigger module includes:
- the template parameter generation submodule is used to generate template generation rules and template parameter recommendations corresponding to each storage type and save them in the database.
- the acquisition module includes:
- the storage type acquisition submodule is used to obtain at least one target storage type corresponding to at least one target storage provision object, where the storage provision object is an object used to provide persistent volume resources.
- the template generation module includes:
- the storage class template generation submodule is used to use the template adapter to query the database for template generation rules and template parameter recommendations corresponding to the target storage type, and generate a storage class template based on the template generation rules and template parameter recommendations corresponding to the target storage type.
- the storage class template generation submodule includes:
- the target storage type sending unit is used to send the target storage type input by the cluster administrator to the template adapter, so that after receiving the target storage type, the template adapter queries the database for the template generation rules and template parameter recommendations corresponding to the target storage type, and generates a storage class template based on the template generation rules and template parameter recommendations corresponding to the target storage type.
- the method before creating a storage class based on the storage class template, the method further includes:
- the instruction response module is used to modify the template generation rules and template parameter recommendations corresponding to the target storage type in response to the template configuration information modification instruction input by the user.
- the template generation module includes:
- a creation submodule is used to create at least one storage class corresponding to at least one target storage type based on the storage class template.
- the template generation module further includes:
- the default storage class setting submodule is used to set a default storage class, which is applied to persistent volume claim requests that do not specify a storage class.
- the storage class template includes at least one of a storage provision object, a resource recovery policy, whether storage expansion is allowed, a mount option, a storage binding mode, and a storage parameter
- the template generation module includes:
- the storage class creation submodule is used to create a storage class based on at least one of the storage provision object, resource recovery policy, whether storage expansion is allowed, mounting options, storage binding mode and storage parameters.
- the request acquisition module includes:
- the persistent volume claim request acquisition submodule is used to obtain a persistent volume claim request created by a user that references a target storage class in at least one storage class.
- the allocation module includes:
- the search submodule is used to search for the target storage class
- the provisioning submodule is used to use the persistent volume provisioner to provision new persistent volumes in the target storage class based on the persistent volume claim request.
- the persistent volume claim request includes access mode information and storage size information
- the provisioning submodule includes:
- the persistent volume provisioning unit is used to use a persistent volume provisioning program to provision a new persistent volume in a target storage class according to the access mode information, the storage size information, and storage definition parameters corresponding to the target storage type.
- the allocation module includes:
- the real storage acquisition submodule is used to obtain the real storage specified by the persistent volume provisioning program
- the binding submodule is used to create a new persistent volume in the real storage and bind the new persistent volume to the persistent volume claim request.
- the apparatus further comprises:
- a data structure creation module that creates a data structure containing a persistent volume that references a persistent volume claim request by name.
- the target storage type can be obtained, and according to the target storage type, a storage class template can be generated using a template adapter to create a storage class based on the storage class template; a persistent volume claim request created by a user for applying for storage resources is obtained; according to the persistent volume claim request, a new persistent volume is provisioned in the created storage class, and a new persistent volume is created, and the new persistent volume is bound to the persistent volume claim request to allocate the persistent volume for the persistent volume claim request.
- the embodiment of the present application can facilitate users to define the required persistent volumes more finely and accurately, and avoid the problem that the user misconfigures parameters of different storage types, resulting in persistent volume creation errors and application startup failures; in addition, it can also ensure that the persistent volume is recycled in the manner required by the user, avoiding accidental deletion of data, affecting the data preservation of stateful container applications or applications with data persistence requirements, and losing important data generated by the application, resulting in application reconstruction failure.
- the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
- the present application also provides an electronic device.
- FIG. 5 is a schematic diagram of an electronic device provided in the present application
- the electronic device includes: a processor 51, a memory 52, and a memory stored in the memory 52 and capable of being used in the processor
- the computer program 53 running on 51 implements each process of the above-mentioned dynamic storage allocation method embodiment when the computer program is executed by the processor, and can achieve the same technical effect. To avoid repetition, it will not be described here.
- the embodiment of the present application also provides a computer non-volatile readable storage medium, on which a computer program is stored.
- a computer program is executed by a processor, the various processes of the above-mentioned dynamic storage allocation method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
- the embodiments of the present application can be provided as methods, devices, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
- a computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
- each process and/or box in the flowchart and/or block diagram, and the combination of the process and/or box in the flowchart and/or block diagram can be realized by computer program instructions.
- These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing terminal device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device produce a device for realizing the function specified in one process or multiple processes in the flowchart and/or one box or multiple boxes in the block diagram.
- These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.
- These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce computer-implemented processing, so that the instructions executed on the computer or other programmable terminal device provide steps for implementing the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Embodiments of the present application relate to the technical field of computers, and provide a dynamic storage allocation method and apparatus, an electronic device, and a non-volatile readable storage medium, applicable to a container cluster management system. The method comprises: acquiring a target storage type; according to the target storage type, generating a storage class template by using a template adapter, so as to create a storage class on the basis of the storage class template; acquiring a persistent volume claim request created by a user; provisioning a new persistent volume in the created storage class according to the persistent volume claim request, creating the new persistent volume, and binding the new persistent volume to the persistent volume claim request to allocate the persistent volume for the persistent volume claim request. The present application uses a template adapter to generate a storage class template so as to create a storage class, so that a user can more accurately define a required persistent volume, and the problems of persistent volume creation errors and application startup failure caused by parameter configuration errors of different storage types and the problems of application reconstruction failure due to loss of important data generated by an application and caused by misdeletion of data are avoided.
Description
相关申请的交叉引用CROSS-REFERENCE TO RELATED APPLICATIONS
本申请要求于2023年02月24日提交中国专利局,申请号为202310165351.7,申请名称为“动态存储分配方法、装置、电子设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to a Chinese patent application filed with the China Patent Office on February 24, 2023, with application number 202310165351.7 and application name “Dynamic storage allocation method, device, electronic device and storage medium”, all contents of which are incorporated by reference in this application.
本申请涉及计算机技术领域,特别是涉及一种动态存储分配方法、一种动态存储分配装置、一种电子设备和一种计算机非易失性可读存储介质。The present application relates to the field of computer technology, and in particular to a dynamic storage allocation method, a dynamic storage allocation device, an electronic device, and a computer non-volatile readable storage medium.
Kubernetes,也称为K8s,是一个开源系统,可以用于自动化容器化应用程序的部署、扩展和管理,可以提供与静态存储分配相对应的动态存储分配(Dynamic Provisioning)的解决方案。当资源供应使用的是动态模式时,Kubernetes系统可以在为PVC(Persistent Volume Claim,持久卷声明请求)找到合适的Storage Class(存储类)后,自动创建一个PV(Persistent Volume,持久卷)并完成与PVC的绑定。Kubernetes, also known as K8s, is an open source system that can be used to automate the deployment, expansion and management of containerized applications. It can provide a solution for dynamic storage allocation (Dynamic Provisioning) as opposed to static storage allocation. When resource provisioning uses dynamic mode, the Kubernetes system can automatically create a PV (Persistent Volume) and complete the binding with PVC after finding a suitable Storage Class for PVC (Persistent Volume Claim).
Kubernetes可以支持多种PV类型,每种存储类型都有各自的特点,在使用时需要根据它们各自的参数进行设置。由于Kubernetes支持的存储类型众多,且不同存储类型提供的参数差异较大,容易导致对应的StorageClass参数配置不同,并且某些参数不显示设定,导致管理员配置工作繁琐,常常由于不同存储类型参数不同而配置错误,从而导致PV创建错误,应用启动失败,直到管理员修改正确为止。Kubernetes can support multiple PV types, each with its own characteristics, and needs to be set according to their respective parameters when in use. Since Kubernetes supports many storage types and the parameters provided by different storage types vary greatly, it is easy to cause the corresponding StorageClass parameter configurations to be different, and some parameters are not displayed, which makes the administrator's configuration work cumbersome. Often, due to different storage type parameters, configuration errors occur, resulting in PV creation errors and application startup failures until the administrator makes the correct changes.
发明内容Summary of the invention
鉴于上述问题,提出了本申请实施例以便提供一种克服上述问题或者至少部分地解决上述问题的一种动态存储分配方法、一种动态存储分配装置、一种电子设备和一种计算机非易失性可读存储介质。In view of the above problems, embodiments of the present application are proposed to provide a dynamic storage allocation method, a dynamic storage allocation device, an electronic device and a computer non-volatile readable storage medium that overcome the above problems or at least partially solve the above problems.
为了解决上述问题,本申请实施例公开了一种动态存储分配方法,方法应用于容器集群管理系统,方法包括:In order to solve the above problems, an embodiment of the present application discloses a dynamic storage allocation method, which is applied to a container cluster management system and includes:
获取目标存储类型;Get the target storage type;
根据目标存储类型,采用模板适配器生成存储类模板,以基于存储类模板创建存储类;According to the target storage type, a storage class template is generated by using a template adapter to create a storage class based on the storage class template;
获取用户创建的用于申请存储资源的持久卷声明请求;Get the persistent volume claim request created by the user to apply for storage resources;
根据持久卷声明请求,在创建的存储类中置备新的持久卷,并创建新的持久卷,将新的持久卷绑定到持久卷声明请求,以针对持久卷声明请求分配持久卷。Based on the persistent volume claim request, a new persistent volume is provisioned in the created storage class, and a new persistent volume is created and bound to the persistent volume claim request to allocate a persistent volume for the persistent volume claim request.
在一些实施例中,在获取目标存储类型之前,还包括:In some embodiments, before obtaining the target storage type, the method further includes:
判断是否已部署持久卷置备程序;Determine whether the persistent volume provisioner has been deployed;
若未部署持久卷置备程序,则返回未部署信息以使集群管理员部署持久卷置备程序。If the persistent volume provisioner is not deployed, the not deployed message is returned to allow the cluster administrator to deploy the persistent volume provisioner.
在一些实施例中,在部署持久卷置备程序时,方法还包括:
In some embodiments, when deploying the persistent volume provisioner, the method further comprises:
触发模板适配器获取各个存储类型对应的存储定义参数,生成各个存储类型对应的模板配置信息并保存至数据库中。The template adapter is triggered to obtain storage definition parameters corresponding to each storage type, generate template configuration information corresponding to each storage type and save it in the database.
在一些实施例中,触发模板适配器获取各个存储类型对应的存储定义参数,包括:In some embodiments, the trigger template adapter obtains storage definition parameters corresponding to each storage type, including:
触发模板适配器获取持久卷置备程序提供的各个存储类型对应的存储定义参数。Trigger the template adapter to obtain storage definition parameters corresponding to each storage type provided by the persistent volume provisioner.
在一些实施例中,模板配置信息包括模板生成规则和模板参数推荐,生成各个存储类型对应的模板配置信息并保存至数据库中,包括:In some embodiments, the template configuration information includes template generation rules and template parameter recommendations, and the template configuration information corresponding to each storage type is generated and saved in a database, including:
生成各个存储类型对应的模板生成规则和模板参数推荐并保存至数据库中。Generate template generation rules and template parameter recommendations corresponding to each storage type and save them in the database.
在一些实施例中,获取目标存储类型,包括:In some embodiments, obtaining the target storage type includes:
获取至少一个目标存储提供对象对应的至少一个目标存储类型,存储提供对象为用于提供持久卷资源的对象。At least one target storage type corresponding to at least one target storage provision object is obtained, where the storage provision object is an object used to provide persistent volume resources.
在一些实施例中,根据目标存储类型,采用模板适配器生成存储类模板,包括:In some embodiments, according to the target storage type, a template adapter is used to generate a storage class template, including:
采用模板适配器,向数据库查询目标存储类型对应的模板生成规则和模板参数推荐,并根据目标存储类型对应的模板生成规则和模板参数推荐,生成存储类模板。A template adapter is used to query the database for template generation rules and template parameter recommendations corresponding to the target storage type, and a storage class template is generated according to the template generation rules and template parameter recommendations corresponding to the target storage type.
在一些实施例中,采用模板适配器,向数据库查询目标存储类型对应的模板生成规则和模板参数推荐,并根据目标存储类型对应的模板生成规则和模板参数推荐,生成存储类模板,包括:In some embodiments, a template adapter is used to query a database for template generation rules and template parameter recommendations corresponding to the target storage type, and a storage class template is generated according to the template generation rules and template parameter recommendations corresponding to the target storage type, including:
向模板适配器发送集群管理员输入的目标存储类型,以使模板适配器在接收到目标存储类型后,向数据库查询目标存储类型对应的模板生成规则和模板参数推荐,并根据目标存储类型对应的模板生成规则和模板参数推荐,生成存储类模板。The target storage type input by the cluster administrator is sent to the template adapter, so that after receiving the target storage type, the template adapter queries the database for the template generation rules and template parameter recommendations corresponding to the target storage type, and generates a storage class template based on the template generation rules and template parameter recommendations corresponding to the target storage type.
在一些实施例中,在基于存储类模板创建存储类之前,还包括:In some embodiments, before creating a storage class based on the storage class template, the method further includes:
响应于用户输入的模板配置信息修改指令,修改目标存储类型对应的模板生成规则和模板参数推荐。In response to the template configuration information modification instruction input by the user, the template generation rules and template parameter recommendations corresponding to the target storage type are modified.
在一些实施例中,基于存储类模板创建存储类,包括:In some embodiments, creating a storage class based on a storage class template includes:
基于存储类模板,创建与至少一个目标存储类型一一对应的至少一个存储类。Based on the storage class template, at least one storage class is created that corresponds one-to-one to at least one target storage type.
在一些实施例中,基于存储类模板创建存储类,还包括:In some embodiments, creating a storage class based on a storage class template further includes:
设置一个默认存储类,默认存储类应用于未指定存储类的持久卷声明请求。Sets a default storage class that is applied to persistent volume claim requests that do not specify a storage class.
在一些实施例中,存储类模板包括存储提供对象、资源回收策略、是否允许存储扩容、挂载选项、存储绑定模式和存储参数中的至少一种,基于存储类模板创建存储类,包括:In some embodiments, the storage class template includes at least one of a storage provision object, a resource recovery policy, whether storage expansion is allowed, a mount option, a storage binding mode, and a storage parameter. Creating a storage class based on the storage class template includes:
基于存储提供对象、资源回收策略、是否允许存储扩容、挂载选项、存储绑定模式和存储参数中的至少一种,创建存储类。A storage class is created based on at least one of a storage provision object, a resource recovery policy, whether storage expansion is allowed, a mount option, a storage binding mode, and a storage parameter.
在一些实施例中,获取用户创建的用于申请存储资源的持久卷声明请求,包括:In some embodiments, obtaining a persistent volume claim request created by a user for applying for storage resources includes:
获取用户创建的引用至少一个存储类中的目标存储类的持久卷声明请求。Gets a user-created persistent volume claim request that references a target storage class in at least one storage class.
在一些实施例中,根据持久卷声明请求,在创建的存储类中置备新的持久卷,包括:In some embodiments, provisioning a new persistent volume in the created storage class in accordance with the persistent volume claim request includes:
查找目标存储类;Find the target storage class;
采用持久卷置备程序,根据持久卷声明请求,在目标存储类中置备新的持久卷。
Use the persistent volume provisioner to provision a new persistent volume in the target storage class based on the persistent volume claim request.
在一些实施例中,持久卷声明请求包括访问模式信息和存储大小信息,采用持久卷置备程序,根据持久卷声明请求,在目标存储类中置备新的持久卷,包括:In some embodiments, the persistent volume claim request includes access mode information and storage size information, and a persistent volume provisioning procedure is used to provision a new persistent volume in a target storage class according to the persistent volume claim request, including:
采用持久卷置备程序,根据访问模式信息、存储大小信息以及目标存储类型对应的存储定义参数,在目标存储类中置备新的持久卷。A new persistent volume is provisioned in the target storage class using the persistent volume provisioner based on the access mode information, storage size information, and storage definition parameters corresponding to the target storage type.
在一些实施例中,创建新的持久卷,将新的持久卷绑定到持久卷声明请求,包括:In some embodiments, creating a new persistent volume, and binding the new persistent volume to the persistent volume claim request, includes:
获取持久卷置备程序指定的真实存储;Get the real storage specified by the persistent volume provisioner;
在真实存储创建新的持久卷,将新的持久卷绑定到持久卷声明请求。Create a new persistent volume in the real storage and bind the new persistent volume to the persistent volume claim request.
在一些实施例中,方法还包括:In some embodiments, the method further comprises:
创建包含通过名称引用持久卷声明请求的持久卷的数据结构。Creates a data structure containing the persistent volume requested by referencing the persistent volume claim by name.
本申请实施例还公开了一种动态存储分配装置,装置应用于容器集群管理系统,装置包括:The embodiment of the present application also discloses a dynamic storage allocation device, which is applied to a container cluster management system, and includes:
获取模块,用于获取目标存储类型;An acquisition module is used to obtain the target storage type;
模板生成模块,用于根据目标存储类型,采用模板适配器生成存储类模板,以基于存储类模板创建存储类;存储类模板包括目标存储类型对应的存储定义参数;A template generation module, used to generate a storage class template using a template adapter according to a target storage type, so as to create a storage class based on the storage class template; the storage class template includes storage definition parameters corresponding to the target storage type;
请求获取模块,用于获取用户创建的用于申请存储资源的持久卷声明请求;The request acquisition module is used to obtain the persistent volume claim request created by the user to apply for storage resources;
分配模块,用于根据持久卷声明请求和目标存储类型对应的存储定义参数,在创建的存储类中置备新的持久卷,并创建新的持久卷,将新的持久卷绑定到持久卷声明请求,以针对持久卷声明请求分配持久卷。An allocation module is used to provision a new persistent volume in the created storage class according to the storage definition parameters corresponding to the persistent volume claim request and the target storage type, create a new persistent volume, bind the new persistent volume to the persistent volume claim request, and allocate the persistent volume for the persistent volume claim request.
在一些实施例中,在获取目标存储类型之前,还包括:In some embodiments, before obtaining the target storage type, the method further includes:
判断模块,用于判断是否已部署持久卷置备程序;A determination module, used to determine whether a persistent volume provisioning program has been deployed;
返回模块,用于若未部署持久卷置备程序,则返回未部署信息以使集群管理员部署持久卷置备程序。The return module is used to return the undeployment information if the persistent volume provisioner is not deployed so that the cluster administrator can deploy the persistent volume provisioner.
在一些实施例中,在部署持久卷置备程序时,装置还包括:In some embodiments, when deploying the persistent volume provisioning procedure, the apparatus further comprises:
触发模块,用于触发模板适配器获取各个存储类型对应的存储定义参数,生成各个存储类型对应的模板配置信息并保存至数据库中。The trigger module is used to trigger the template adapter to obtain the storage definition parameters corresponding to each storage type, generate the template configuration information corresponding to each storage type and save it in the database.
在一些实施例中,触发模块,包括:In some embodiments, the trigger module includes:
定义参数获取子模块,用于触发模板适配器获取持久卷置备程序提供的各个存储类型对应的存储定义参数。The definition parameter acquisition submodule is used to trigger the template adapter to obtain the storage definition parameters corresponding to each storage type provided by the persistent volume provisioning program.
在一些实施例中,模板配置信息包括模板生成规则和模板参数推荐,触发模块,包括:In some embodiments, the template configuration information includes template generation rules and template parameter recommendations, and the trigger module includes:
模板参数生成子模块,用于生成各个存储类型对应的模板生成规则和模板参数推荐并保存至数据库中。The template parameter generation submodule is used to generate template generation rules and template parameter recommendations corresponding to each storage type and save them in the database.
在一些实施例中,获取模块,包括:In some embodiments, the acquisition module includes:
存储类型获取子模块,用于获取至少一个目标存储提供对象对应的至少一个目标存储类型,存储提供对象为用于提供持久卷资源的对象。The storage type acquisition submodule is used to obtain at least one target storage type corresponding to at least one target storage provision object, where the storage provision object is an object used to provide persistent volume resources.
在一些实施例中,模板生成模块,包括:
In some embodiments, the template generation module includes:
存储类模板生成子模块,用于采用模板适配器,向数据库查询目标存储类型对应的模板生成规则和模板参数推荐,并根据目标存储类型对应的模板生成规则和模板参数推荐,生成存储类模板。The storage class template generation submodule is used to use the template adapter to query the database for template generation rules and template parameter recommendations corresponding to the target storage type, and generate a storage class template based on the template generation rules and template parameter recommendations corresponding to the target storage type.
在一些实施例中,存储类模板生成子模块,包括:In some embodiments, the storage class template generation submodule includes:
目标存储类型发送单元,用于向模板适配器发送集群管理员输入的目标存储类型,以使模板适配器在接收到目标存储类型后,向数据库查询目标存储类型对应的模板生成规则和模板参数推荐,并根据目标存储类型对应的模板生成规则和模板参数推荐,生成存储类模板。The target storage type sending unit is used to send the target storage type input by the cluster administrator to the template adapter, so that after receiving the target storage type, the template adapter queries the database for template generation rules and template parameter recommendations corresponding to the target storage type, and generates a storage class template based on the template generation rules and template parameter recommendations corresponding to the target storage type.
在一些实施例中,在基于存储类模板创建存储类之前,还包括:In some embodiments, before creating a storage class based on the storage class template, the method further includes:
指令响应模块,用于响应于用户输入的模板配置信息修改指令,修改目标存储类型对应的模板生成规则和模板参数推荐。The instruction response module is used to modify the template generation rules and template parameter recommendations corresponding to the target storage type in response to the template configuration information modification instruction input by the user.
在一些实施例中,模板生成模块,包括:In some embodiments, the template generation module includes:
创建子模块,用于基于存储类模板,创建与至少一个目标存储类型一一对应的至少一个存储类。A creation submodule is used to create at least one storage class corresponding to at least one target storage type based on the storage class template.
在一些实施例中,模板生成模块,还包括:In some embodiments, the template generation module further includes:
默认存储类设置子模块,用于设置一个默认存储类,默认存储类应用于未指定存储类的持久卷声明请求。The default storage class setting submodule is used to set a default storage class, which is applied to persistent volume claim requests that do not specify a storage class.
在一些实施例中,存储类模板包括存储提供对象、资源回收策略、是否允许存储扩容、挂载选项、存储绑定模式和存储参数中的至少一种,模板生成模块,包括:In some embodiments, the storage class template includes at least one of a storage provision object, a resource recovery policy, whether storage expansion is allowed, a mount option, a storage binding mode, and a storage parameter, and the template generation module includes:
存储类创建子模块,用于基于存储提供对象、资源回收策略、是否允许存储扩容、挂载选项、存储绑定模式和存储参数中的至少一种,创建存储类。The storage class creation submodule is used to create a storage class based on at least one of the storage provision object, resource recovery policy, whether storage expansion is allowed, mounting options, storage binding mode and storage parameters.
在一些实施例中,请求获取模块,包括:In some embodiments, the request acquisition module includes:
持久卷声明请求获取子模块,用于获取用户创建的引用至少一个存储类中的目标存储类的持久卷声明请求。The persistent volume claim request acquisition submodule is used to obtain a persistent volume claim request created by a user that references a target storage class in at least one storage class.
在一些实施例中,分配模块,包括:In some embodiments, the allocation module includes:
查找子模块,用于查找目标存储类;The search submodule is used to search for the target storage class;
置备子模块,用于采用持久卷置备程序,根据持久卷声明请求,在目标存储类中置备新的持久卷。The provisioning submodule is used to use the persistent volume provisioner to provision new persistent volumes in the target storage class based on the persistent volume claim request.
在一些实施例中,持久卷声明请求包括访问模式信息和存储大小信息,置备子模块,包括:In some embodiments, the persistent volume claim request includes access mode information and storage size information, and the provisioning submodule includes:
持久卷置备单元,用于采用持久卷置备程序,根据访问模式信息、存储大小信息以及目标存储类型对应的存储定义参数,在目标存储类中置备新的持久卷。The persistent volume provisioning unit is used to use a persistent volume provisioning program to provision a new persistent volume in a target storage class according to the access mode information, the storage size information, and storage definition parameters corresponding to the target storage type.
在一些实施例中,分配模块,包括:In some embodiments, the allocation module includes:
真实存储获取子模块,用于获取持久卷置备程序指定的真实存储;The real storage acquisition submodule is used to obtain the real storage specified by the persistent volume provisioning program;
绑定子模块,用于在真实存储创建新的持久卷,将新的持久卷绑定到持久卷声明请求。The binding submodule is used to create a new persistent volume in the real storage and bind the new persistent volume to the persistent volume claim request.
在一些实施例中,装置还包括:
In some embodiments, the apparatus further comprises:
数据结构创建模块,用于创建包含通过名称引用持久卷声明请求的持久卷的数据结构。A data structure creation module that creates a data structure containing a persistent volume that references a persistent volume claim request by name.
本申请实施例还公开了一种电子设备,包括:处理器、存储器及存储在存储器上并能够在处理器上运行的计算机程序,计算机程序被处理器执行时实现如上的动态存储分配方法的步骤。An embodiment of the present application also discloses an electronic device, including: a processor, a memory, and a computer program stored in the memory and capable of running on the processor, and the computer program implements the steps of the above dynamic storage allocation method when executed by the processor.
本申请实施例还公开了一种计算机非易失性可读存储介质,计算机非易失性可读存储介质上存储计算机程序,计算机程序被处理器执行时实现如上的动态存储分配方法的步骤。The embodiment of the present application also discloses a computer non-volatile readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above dynamic storage allocation method are implemented.
本申请实施例包括以下优点:The embodiments of the present application include the following advantages:
在本申请实施例中,可以获取目标存储类型,根据目标存储类型,采用模板适配器生成存储类模板,以基于存储类模板创建存储类;获取用户创建的用于申请存储资源的持久卷声明请求;根据持久卷声明请求,在创建的存储类中置备新的持久卷,并创建新的持久卷,将新的持久卷绑定到持久卷声明请求,以针对持久卷声明请求分配持久卷。本申请实施例通过采用模板适配器生成存储类模板以基于存储类模板创建存储类,可以方便用户对所需持久卷进行更精细、准确的定义,避免用户由于不同存储类型参数配置错误,导致持久卷创建错误,应用启动失败的问题;此外,还可以保证持久卷按照用户需要的方式进行回收,避免数据误删,影响有状态的容器应用或者对数据有持久化需求应用的数据保存,丢失应用产生的重要数据,导致应用重建失败的问题。In an embodiment of the present application, the target storage type can be obtained, and according to the target storage type, a storage class template can be generated using a template adapter to create a storage class based on the storage class template; a persistent volume claim request created by a user for applying for storage resources is obtained; according to the persistent volume claim request, a new persistent volume is provisioned in the created storage class, and a new persistent volume is created, and the new persistent volume is bound to the persistent volume claim request to allocate the persistent volume for the persistent volume claim request. By using a template adapter to generate a storage class template to create a storage class based on a storage class template, the embodiment of the present application can facilitate users to define the required persistent volumes more finely and accurately, and avoid the problem that the user misconfigures parameters of different storage types, resulting in persistent volume creation errors and application startup failures; in addition, it can also ensure that the persistent volume is recycled in the manner required by the user, avoiding accidental deletion of data, affecting the data preservation of stateful container applications or applications with data persistence requirements, and losing important data generated by the application, resulting in application reconstruction failure.
图1是本申请实施例提供的一种动态存储分配方法的步骤流程图;FIG1 is a flowchart of a method for dynamic storage allocation provided by an embodiment of the present application;
图2是本申请实施例提供的另一种动态存储分配方法的步骤流程图;FIG2 is a flowchart of another method for dynamic storage allocation provided by an embodiment of the present application;
图3是本申请实施例提供的一种基于Kubernetes的动态存储分配流程示意图;FIG3 is a schematic diagram of a dynamic storage allocation process based on Kubernetes provided in an embodiment of the present application;
图4是本申请实施例提供的一种动态存储分配装置的结构框图;FIG4 is a structural block diagram of a dynamic storage allocation device provided in an embodiment of the present application;
图5是本申请实施例提供的一种电子设备的示意图。FIG. 5 is a schematic diagram of an electronic device provided in an embodiment of the present application.
为使本申请的上述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本申请作进一步详细的说明。In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
Kubernetes,也称为K8s,是一个开源系统,用于自动化容器化应用程序的部署、扩展和管理。在Kubernetes中,对存储资源的管理方式与计算资源(CPU(Central Processing Unit,中央处理器)/内存)截然不同。为了能够屏蔽底层存储实现的细节,让用户方便使用及管理员方便管理,Kubernetes引入了Persistent Volume(PV)和Persistent Volume Claim(PVC)两个资源对象来实现存储管理子系统。Kubernetes, also known as K8s, is an open source system for automating the deployment, scaling, and management of containerized applications. In Kubernetes, storage resources are managed in a completely different way from computing resources (CPU (Central Processing Unit)/memory). In order to shield the details of the underlying storage implementation and make it easier for users to use and administrators to manage, Kubernetes introduced two resource objects, Persistent Volume (PV) and Persistent Volume Claim (PVC), to implement the storage management subsystem.
PV(持久卷)是对存储资源的抽象,将存储定义为一种容器应用可以使用的资源。PV由管理员创建和配置,它与存储提供商的具体实现直接相关,例如GlusterFS、iSCSI(Internet Small Computer System Interface,网络小型计算机接口)、RBD(RADOS Block Device,块存储,一种构建在RADOS集群之上为客户端提供块设备接口的存储服务中间层)或GCE(Google公有云)或AWS(Amazon Web Services,亚马逊云平台)公有云提供的共
享存储,通过插件式的机制进行管理,供应用访问和使用。除了EmptyDir类型的存储卷,PV的生命周期独立于使用它的Pod。PV (persistent volume) is an abstraction of storage resources, defining storage as a resource that can be used by container applications. PV is created and configured by the administrator, and is directly related to the specific implementation of the storage provider, such as GlusterFS, iSCSI (Internet Small Computer System Interface), RBD (RADOS Block Device, a storage service middle layer built on the RADOS cluster that provides a block device interface to the client), or GCE (Google Public Cloud) or AWS (Amazon Web Services) public cloud shared storage. Shared storage is managed through a plug-in mechanism for application access and use. Except for EmptyDir type storage volumes, the life cycle of PV is independent of the Pod that uses it.
PVC则是用户对存储资源的一个申请。就像Pod消耗Node的资源一样,PVC消耗PV资源。PVC可以申请存储空间的大小(size)和访问模式(例如ReadWriteOnce、ReadOnlyMany或ReadWriteMany)。PVC is a user's application for storage resources. Just like Pod consumes Node resources, PVC consumes PV resources. PVC can apply for the size of storage space and access mode (such as ReadWriteOnce, ReadOnlyMany or ReadWriteMany).
使用PVC申请的存储空间可能仍然不满足应用对存储设备的各种需求。在很多情况下,应用程序对存储设备的特性和性能都有不同的要求,包括读写速度、并发性能、数据冗余等要求,Kubernetes从1.4版本开始引入了一个新的资源对象StorageClass(SC),用于标记存储资源的特性和性能,根据PVC的需求动态供给合适的PV资源。到Kubernetes 1.6版本时,StorageClass和存储资源动态供应的机制得到完善,实现了存储卷的按需创建,在共享存储的自动化管理进程中实现了重要的一步。The storage space requested using PVC may still not meet the various requirements of applications for storage devices. In many cases, applications have different requirements for the characteristics and performance of storage devices, including read and write speed, concurrency performance, data redundancy, etc. Kubernetes introduced a new resource object StorageClass (SC) from version 1.4 to mark the characteristics and performance of storage resources and dynamically supply appropriate PV resources according to the needs of PVC. By Kubernetes version 1.6, the mechanism of StorageClass and dynamic supply of storage resources has been improved, enabling on-demand creation of storage volumes, which is an important step in the process of automated management of shared storage.
通过StorageClass的定义,管理员可以将存储资源定义为某种类别(Class),正如存储设备对于自身的配置描述(Profile),例如快速存储、慢速存储、有数据冗余、无数据冗余等。用户根据StorageClass的描述就可以直观地得知各种存储资源的特性,根据应用对存储资源的需求去申请存储资源了。Through the definition of StorageClass, administrators can define storage resources as a certain category (Class), just like the configuration description (Profile) of storage devices, such as fast storage, slow storage, with data redundancy, without data redundancy, etc. Users can intuitively know the characteristics of various storage resources based on the description of StorageClass and apply for storage resources based on the application's demand for storage resources.
在用户定义好PVC之后,系统将根据PVC对存储资源的请求(存储空间和访问模式)在已存在的PV中选择一个满足PVC要求的PV,一旦找到,就将该PV与用户定义的PVC绑定,用户的应用就可以使用这个PVC了。此时会带来两个问题:After the user defines the PVC, the system will select a PV that meets the PVC requirements from the existing PVs based on the PVC's request for storage resources (storage space and access mode). Once found, the PV will be bound to the user-defined PVC, and the user's application can use this PVC. This will cause two problems:
1、如果在系统中没有满足PVC要求的PV,PVC则会无限期处于Pending状态,直到系统管理员创建了一个符合其要求的PV,影响业务部属;1. If there is no PV that meets the PVC requirements in the system, the PVC will remain in the Pending state indefinitely until the system administrator creates a PV that meets the requirements, affecting business deployment;
2、另外,PV一旦与某个PVC上完成绑定,就会被这个PVC独占,不能再与其他PVC绑定。PVC与PV的绑定关系是一对一的,不会存在一对多的情况。如果PVC申请的存储空间比PV拥有的空间少,则整个PV的空间都能为PVC所用,可能造成资源的浪费。譬如,某个PersistentVolumeClaim要求3GB的存储容量,当前Kubernetes手上只剩下一个5GB的PersistentVolume了,此时Kubernetes只好将这个PersistentVolume与申请资源的PersistentVolumeClaim进行绑定,平白浪费了2GB空间。假设后续有另一个PersistentVolumeClaim申请2GB的存储空间,那它也只能等待管理员分配新的PersistentVolume,或者有其他PersistentVolume被回收之后才被能成功分配。2. In addition, once a PV is bound to a PVC, it will be exclusively used by this PVC and cannot be bound to other PVCs. The binding relationship between PVC and PV is one-to-one, and there will not be a one-to-many situation. If the storage space requested by the PVC is less than the space owned by the PV, the entire PV space can be used by the PVC, which may cause a waste of resources. For example, a PersistentVolumeClaim requires 3GB of storage capacity, and Kubernetes currently only has one 5GB PersistentVolume. At this time, Kubernetes has to bind this PersistentVolume to the PersistentVolumeClaim that applied for the resource, wasting 2GB of space. Assuming that there is another PersistentVolumeClaim that applies for 2GB of storage space later, it can only wait for the administrator to allocate a new PersistentVolume, or other PersistentVolumes are recycled before it can be successfully allocated.
在启用动态供应模式时,一旦用户删除了PVC,与之绑定的PV也会由于其默认的回收策略“Delete”而被删除。如果需要保留存储有用户数据的PV,则在动态绑定成功后,用户需要将系统自动生成PV的回收策略从“Delete”改成“Retain”。然而,如果用户忘记修改,会造成数据误删,影响有状态的容器应用或者对数据有持久化需求应用的数据保存,丢失应用产生的重要数据,导致应用重建失败。When dynamic provisioning mode is enabled, once the user deletes the PVC, the PV bound to it will also be deleted due to its default recycling policy "Delete". If you need to retain the PV that stores user data, after the dynamic binding is successful, the user needs to change the recycling policy of the PV automatically generated by the system from "Delete" to "Retain". However, if the user forgets to make the change, data will be accidentally deleted, affecting the data preservation of stateful container applications or applications with data persistence requirements, losing important data generated by the application, and causing application reconstruction failure.
Kubernetes可以支持多种PV类型,每种存储类型都有各自的特点,在使用时需要根据它们各自的参数进行设置。由于kubernetes支持的存储类型众多,且不同存储类型提供的参
数差异较大,容易导致对应的StorageClass参数配置不同,并且某些参数不显示设定,导致管理员配置工作繁琐,常常由于不同存储类型参数不同而配置错误,从而导致PV创建错误,应用启动失败,直到管理员修改正确为止。Kubernetes can support multiple PV types. Each storage type has its own characteristics and needs to be set according to their respective parameters when used. The large difference in numbers can easily lead to different configurations of the corresponding StorageClass parameters, and some parameters are not displayed, which makes the administrator's configuration work cumbersome. Often, due to different storage type parameters, configuration errors occur, resulting in PV creation errors and application startup failures until the administrator makes the correct changes.
本申请实施例的核心构思之一在于,可以获取目标存储类型,根据目标存储类型,采用模板适配器生成存储类模板,以基于存储类模板创建存储类;获取用户创建的用于申请存储资源的持久卷声明请求;根据持久卷声明请求,在创建的存储类中置备新的持久卷,并创建新的持久卷,将新的持久卷绑定到持久卷声明请求,以针对持久卷声明请求分配持久卷。本申请实施例通过采用模板适配器生成存储类模板以基于存储类模板创建存储类,可以方便用户对所需持久卷进行更精细、准确的定义,避免用户由于不同存储类型参数配置错误,导致持久卷创建错误,应用启动失败的问题;此外,还可以保证持久卷按照用户需要的方式进行回收,避免数据误删,影响有状态的容器应用或者对数据有持久化需求应用的数据保存,丢失应用产生的重要数据,导致应用重建失败的问题。One of the core concepts of the embodiment of the present application is that the target storage type can be obtained, and according to the target storage type, a storage class template can be generated using a template adapter to create a storage class based on the storage class template; a persistent volume claim request created by a user for applying for storage resources is obtained; according to the persistent volume claim request, a new persistent volume is provisioned in the created storage class, and a new persistent volume is created, and the new persistent volume is bound to the persistent volume claim request to allocate the persistent volume for the persistent volume claim request. The embodiment of the present application uses a template adapter to generate a storage class template to create a storage class based on a storage class template, which can facilitate users to define the required persistent volumes more finely and accurately, and avoid the problem that the user misconfigures parameters of different storage types, resulting in persistent volume creation errors and application startup failures; in addition, it can also ensure that the persistent volume is recycled in the manner required by the user, avoiding accidental deletion of data, affecting the data preservation of stateful container applications or applications with data persistence requirements, and losing important data generated by the application, resulting in application reconstruction failure.
参照图1,示出了本申请实施例提供的一种动态存储分配方法的步骤流程图,方法应用于容器集群管理系统,方法具体可以包括如下步骤:1 , a flowchart of a method for dynamic storage allocation provided by an embodiment of the present application is shown. The method is applied to a container cluster management system, and the method may specifically include the following steps:
步骤101,获取目标存储类型。Step 101, obtaining the target storage type.
在本申请实施例中,管理员可以指定至少一种目标存储类型,容器集群管理系统可以支持多种持久卷类型,例如:In an embodiment of the present application, an administrator can specify at least one target storage type, and the container cluster management system can support multiple persistent volume types, for example:
◎AWSElasticBlockStore:AWS公有云提供的Elastic Block Store。◎AWSElasticBlockStore: Elastic Block Store provided by AWS public cloud.
◎AzureFile:Azure公有云提供的File。◎AzureFile: File provided by Azure public cloud.
◎AzureDisk:Azure公有云提供的Disk。◎AzureDisk: Disk provided by Azure public cloud.
◎CephFS:一种开源共享存储系统。◎CephFS: an open source shared storage system.
◎Cinder:OpenStack块存储系统。◎Cinder:OpenStack block storage system.
◎FC(Fibre Channel):光纤存储设备。◎FC (Fibre Channel): optical fiber storage device.
◎FlexVolume:一种插件式的存储机制。◎FlexVolume: A plug-in storage mechanism.
◎Flocker:一种开源共享存储系统。◎Flocker: An open source shared storage system.
◎GCEPersistentDisk:GCE公有云提供的Persistent Disk。◎GCEPersistentDisk: Persistent Disk provided by GCE public cloud.
◎Glusterfs:一种开源共享存储系统。◎Glusterfs: an open source shared storage system.
◎HostPath:宿主机目录,仅用于单机测试。◎HostPath: Host directory, only used for single-machine testing.
◎iSCSI:iSCSI存储设备。◎iSCSI: iSCSI storage device.
◎Local:本地存储设备,从Kubernetes 1.7版本开始引入,到1.14版本时达到稳定版本,目前可以通过指定块设备(Block Device)提供Local PV,或通过社区开发的sig-storage-local-static-provisioner插件管理Local PV的生命周期。◎Local: Local storage device, introduced in Kubernetes version 1.7 and reached a stable version in version 1.14. Currently, Local PV can be provided by specifying a block device (Block Device), or the life cycle of Local PV can be managed through the sig-storage-local-static-provisioner plug-in developed by the community.
◎NFS:网络文件系统。◎NFS: Network File System.
◎Portworx Volumes:Portworx提供的存储服务。◎Portworx Volumes: Storage services provided by Portworx.
◎Quobyte Volumes:Quobyte提供的存储服务。
◎Quobyte Volumes: Storage services provided by Quobyte.
◎RBD(Ceph Block Device):Ceph块存储。◎RBD (Ceph Block Device): Ceph block storage.
◎ScaleIO Volumes:DellEMC的存储设备。◎ScaleIO Volumes: DellEMC's storage devices.
◎StorageOS:StorageOS提供的存储服务。◎StorageOS: Storage services provided by StorageOS.
◎VsphereVolume:VMWare提供的存储系统。◎VsphereVolume: Storage system provided by VMWare.
步骤102,根据目标存储类型,采用模板适配器生成存储类模板,以基于存储类模板创建存储类。Step 102: Generate a storage class template using a template adapter according to the target storage type, so as to create a storage class based on the storage class template.
在本申请实施例中,在获取管理员指定的至少一种目标存储类型后,可以根据至少一种目标存储类型,采用模板适配器生成存储类模板,以基于存储类模板创建存储类。In an embodiment of the present application, after obtaining at least one target storage type specified by an administrator, a storage class template can be generated using a template adapter according to the at least one target storage type to create a storage class based on the storage class template.
步骤103,获取用户创建的用于申请存储资源的持久卷声明请求。Step 103: Obtain a persistent volume claim request created by a user for applying for storage resources.
在本申请实施例中,用户可以创建用于申请存储资源的持久卷声明请求,系统可以获取用户创建的用于申请存储资源的持久卷声明请求。In an embodiment of the present application, a user may create a persistent volume claim request for applying for storage resources, and the system may obtain the persistent volume claim request created by the user for applying for storage resources.
步骤104,根据持久卷声明请求,在创建的存储类中置备新的持久卷,并创建新的持久卷,将新的持久卷绑定到持久卷声明请求,以针对持久卷声明请求分配持久卷。Step 104, according to the persistent volume claim request, provision a new persistent volume in the created storage class, create a new persistent volume, bind the new persistent volume to the persistent volume claim request, and allocate a persistent volume for the persistent volume claim request.
在本申请实施例中,可以根据用户创建的持久卷声明请求,在创建的存储类中置备新的持久卷,并创建新的持久卷,将新的持久卷绑定到持久卷声明请求,从而针对持久卷声明请求分配持久卷。In an embodiment of the present application, a new persistent volume can be provisioned in the created storage class according to the persistent volume claim request created by the user, and a new persistent volume can be created and bound to the persistent volume claim request, thereby allocating a persistent volume for the persistent volume claim request.
在本申请实施例中,可以获取目标存储类型,根据目标存储类型,采用模板适配器生成存储类模板,以基于存储类模板创建存储类;获取用户创建的用于申请存储资源的持久卷声明请求;根据持久卷声明请求,在创建的存储类中置备新的持久卷,并创建新的持久卷,将新的持久卷绑定到持久卷声明请求,以针对持久卷声明请求分配持久卷。本申请实施例通过采用模板适配器生成存储类模板以基于存储类模板创建存储类,可以方便用户对所需持久卷进行更精细、准确的定义,避免用户由于不同存储类型参数配置错误,导致持久卷创建错误,应用启动失败的问题;此外,还可以保证持久卷按照用户需要的方式进行回收,避免数据误删,影响有状态的容器应用或者对数据有持久化需求应用的数据保存,丢失应用产生的重要数据,导致应用重建失败的问题。In an embodiment of the present application, the target storage type can be obtained, and according to the target storage type, a storage class template can be generated using a template adapter to create a storage class based on the storage class template; a persistent volume claim request created by a user for applying for storage resources is obtained; according to the persistent volume claim request, a new persistent volume is provisioned in the created storage class, and a new persistent volume is created, and the new persistent volume is bound to the persistent volume claim request to allocate the persistent volume for the persistent volume claim request. By using a template adapter to generate a storage class template to create a storage class based on a storage class template, the embodiment of the present application can facilitate users to define the required persistent volumes more finely and accurately, and avoid the problem that the user misconfigures parameters of different storage types, resulting in persistent volume creation errors and application startup failures; in addition, it can also ensure that the persistent volume is recycled in the manner required by the user, avoiding accidental deletion of data, affecting the data preservation of stateful container applications or applications with data persistence requirements, and losing important data generated by the application, resulting in application reconstruction failure.
参照图2,示出了本申请实施例提供的一种动态存储分配方法的步骤流程图,方法应用于容器集群管理系统,方法具体可以包括如下步骤:2, a flowchart of a method for dynamic storage allocation provided by an embodiment of the present application is shown. The method is applied to a container cluster management system. The method may specifically include the following steps:
步骤201,判断是否已部署持久卷置备程序;Step 201, determining whether a persistent volume provisioning program has been deployed;
在本申请实施例中,可以首先判断是否已部署持久卷置备程序。In an embodiment of the present application, it may be first determined whether a persistent volume provisioning program has been deployed.
步骤202,若未部署持久卷置备程序,则返回未部署信息以使集群管理员部署持久卷置备程序。Step 202: If the persistent volume provisioning program is not deployed, then return the non-deployment information to enable the cluster administrator to deploy the persistent volume provisioning program.
在具体实现中,如果未安装持久卷制备程序,集群管理员可以设置持久卷制备程序,用于具体到某类存储的实际创建、删除等操作。容器集群管理系统可以提供统一标准,持久卷制备程序可以按照标准提供存储定义参数。
In the specific implementation, if the persistent volume provisioning program is not installed, the cluster administrator can set up the persistent volume provisioning program for the actual creation, deletion, and other operations of a specific type of storage. The container cluster management system can provide a unified standard, and the persistent volume provisioning program can provide storage definition parameters according to the standard.
在一种实施例中,在部署持久卷置备程序时,方法还可以包括:触发模板适配器获取各个存储类型对应的存储定义参数,生成各个存储类型对应的模板配置信息并保存至数据库中。In one embodiment, when deploying the persistent volume provisioning program, the method may further include: triggering the template adapter to obtain storage definition parameters corresponding to each storage type, generating template configuration information corresponding to each storage type, and saving the template configuration information to a database.
在一种实施例中,触发模板适配器获取各个存储类型对应的存储定义参数,可以包括:触发模板适配器获取持久卷置备程序提供的各个存储类型对应的存储定义参数。In one embodiment, triggering the template adapter to obtain storage definition parameters corresponding to each storage type may include: triggering the template adapter to obtain storage definition parameters corresponding to each storage type provided by the persistent volume provisioning program.
在一种实施例中,模板配置信息包括模板生成规则和模板参数推荐,生成各个存储类型对应的模板配置信息并保存至数据库中,可以包括:生成各个存储类型对应的模板生成规则和模板参数推荐并保存至数据库中。In one embodiment, the template configuration information includes template generation rules and template parameter recommendations. Generating template configuration information corresponding to each storage type and saving it in a database may include: generating template generation rules and template parameter recommendations corresponding to each storage type and saving them in a database.
在具体实现中,在安装持久卷置备程序时,可以触发模板适配器去获取持久卷置备程序提供的各个存储类型对应的存储定义参数,同时生成模板生成规则和模板参数推荐并保存到数据库中。In a specific implementation, when installing the persistent volume provisioning program, the template adapter can be triggered to obtain storage definition parameters corresponding to each storage type provided by the persistent volume provisioning program, and at the same time generate template generation rules and template parameter recommendations and save them in the database.
步骤203,获取目标存储类型。Step 203, obtaining the target storage type.
在一种实施例中,步骤203可以包括:获取至少一个目标存储提供对象对应的至少一个目标存储类型,存储提供对象为用于提供持久卷资源的对象。In one embodiment, step 203 may include: obtaining at least one target storage type corresponding to at least one target storage provision object, where the storage provision object is an object for providing persistent volume resources.
在具体实现中,管理员可以指定一个或多个存储提供对象,描述存储资源的提供对象,用于提供具体的持久卷资源,也可以将其看作后端存储驱动。In the specific implementation, the administrator can specify one or more storage provider objects to describe the provider objects of storage resources, which are used to provide specific persistent volume resources and can also be regarded as backend storage drivers.
步骤204,根据目标存储类型,采用模板适配器生成存储类模板,以基于存储类模板创建存储类。Step 204: Generate a storage class template using a template adapter according to the target storage type, so as to create a storage class based on the storage class template.
在一种实施例中,根据目标存储类型,采用模板适配器生成存储类模板,可以包括:采用模板适配器,向数据库查询目标存储类型对应的模板生成规则和模板参数推荐,并根据目标存储类型对应的模板生成规则和模板参数推荐,生成存储类模板。In one embodiment, a storage class template is generated using a template adapter according to a target storage type, which may include: using a template adapter to query a database for template generation rules and template parameter recommendations corresponding to the target storage type, and generating a storage class template according to the template generation rules and template parameter recommendations corresponding to the target storage type.
在一种实施例中,采用模板适配器,向数据库查询目标存储类型对应的模板生成规则和模板参数推荐,并根据目标存储类型对应的模板生成规则和模板参数推荐,生成存储类模板,包括:向模板适配器发送集群管理员输入的目标存储类型,以使模板适配器在接收到目标存储类型后,向数据库查询目标存储类型对应的模板生成规则和模板参数推荐,并根据目标存储类型对应的模板生成规则和模板参数推荐,生成存储类模板。In one embodiment, a template adapter is used to query a database for template generation rules and template parameter recommendations corresponding to a target storage type, and generate a storage class template based on the template generation rules and template parameter recommendations corresponding to the target storage type, including: sending the target storage type input by a cluster administrator to the template adapter, so that after receiving the target storage type, the template adapter queries the database for template generation rules and template parameter recommendations corresponding to the target storage type, and generates a storage class template based on the template generation rules and template parameter recommendations corresponding to the target storage type.
在具体实现中,模板适配器可以在接收到管理员输入的存储提供对象后,向数据库查询对应类型的模板生成规则和模板参数推荐,根据查询到的信息生成一个或多个存储类模板。In a specific implementation, after receiving the storage provision object input by the administrator, the template adapter can query the database for template generation rules and template parameter recommendations of the corresponding type, and generate one or more storage class templates according to the queried information.
在一种实施例中,在基于存储类模板创建存储类之前,还可以包括:响应于用户输入的模板配置信息修改指令,修改目标存储类型对应的模板生成规则和模板参数推荐。In one embodiment, before creating a storage class based on the storage class template, the process may further include: modifying the template generation rules and template parameter recommendations corresponding to the target storage type in response to a template configuration information modification instruction input by a user.
在一种实施例中,基于存储类模板创建存储类,可以包括:基于存储类模板,创建与至少一个目标存储类型一一对应的至少一个存储类。In one embodiment, creating a storage class based on a storage class template may include: creating at least one storage class corresponding to at least one target storage type based on the storage class template.
在一种实施例中,基于存储类模板创建存储类,还可以包括:设置一个默认存储类,默认存储类应用于未指定存储类的持久卷声明请求。
In one embodiment, creating a storage class based on a storage class template may also include: setting a default storage class, where the default storage class is applied to persistent volume claim requests that do not specify a storage class.
在具体实现中,管理员可以根据生成的模板根据实际需要修改对应参数,创建一个或多个存储卷,并可以在集群级别设置一个默认的存储卷,为那些未指定存储卷的持久卷声明请求使用。In the specific implementation, the administrator can modify the corresponding parameters according to the actual needs based on the generated template, create one or more storage volumes, and set a default storage volume at the cluster level for persistent volume claim requests that do not specify a storage volume.
在一种实施例中,存储类模板包括存储提供对象、资源回收策略、是否允许存储扩容、挂载选项、存储绑定模式和存储参数中的至少一种,基于存储类模板创建存储类,可以包括:In one embodiment, the storage class template includes at least one of a storage provision object, a resource recovery policy, whether storage expansion is allowed, a mount option, a storage binding mode, and a storage parameter. Creating a storage class based on the storage class template may include:
基于存储提供对象、资源回收策略、是否允许存储扩容、挂载选项、存储绑定模式和存储参数中的至少一种,创建存储类。A storage class is created based on at least one of a storage provision object, a resource recovery policy, whether storage expansion is allowed, a mount option, a storage binding mode, and a storage parameter.
在具体实现中,存储类模板可以包括存储提供者、资源回收策略、是否允许存储扩容、挂载选项、存储绑定模式、存储参数等不同维度的信息和推荐配置,可以基于存储提供对象、资源回收策略、是否允许存储扩容、挂载选项、存储绑定模式和存储参数等不同维度的信息和推荐配置,创建存储类。In a specific implementation, a storage class template may include information and recommended configurations of different dimensions, such as storage providers, resource recovery policies, whether storage expansion is allowed, mount options, storage binding modes, and storage parameters. A storage class may be created based on information and recommended configurations of different dimensions, such as storage providers, resource recovery policies, whether storage expansion is allowed, mount options, storage binding modes, and storage parameters.
步骤205,获取用户创建的用于申请存储资源的持久卷声明请求。Step 205: Obtain a persistent volume claim request created by a user for applying for storage resources.
在一种实施例中,步骤205可以包括:获取用户创建的引用至少一个存储类中的目标存储类的持久卷声明请求。In one embodiment, step 205 may include: obtaining a persistent volume claim request created by a user that references a target storage class in at least one storage class.
在具体实现中,用户可以创建一个引用其中一个存储类的持久卷声明请求,系统可以获取用户创建的用于申请存储资源的持久卷声明请求。In a specific implementation, a user can create a persistent volume claim request that references one of the storage classes, and the system can obtain the persistent volume claim request created by the user for applying for storage resources.
步骤206,根据持久卷声明请求,在创建的存储类中置备新的持久卷,并创建新的持久卷,将新的持久卷绑定到持久卷声明请求,以针对持久卷声明请求分配持久卷。Step 206, according to the persistent volume claim request, provision a new persistent volume in the created storage class, create a new persistent volume, bind the new persistent volume to the persistent volume claim request, and allocate a persistent volume for the persistent volume claim request.
在一种实施例中,根据持久卷声明请求,在创建的存储类中置备新的持久卷,可以包括:查找目标存储类;采用持久卷置备程序,根据持久卷声明请求,在目标存储类中置备新的持久卷。In one embodiment, provisioning a new persistent volume in a created storage class according to a persistent volume claim request may include: searching for a target storage class; and using a persistent volume provisioning program to provision a new persistent volume in the target storage class according to the persistent volume claim request.
在一种实施例中,持久卷声明请求包括访问模式信息和存储大小信息,采用持久卷置备程序,根据持久卷声明请求,在目标存储类中置备新的持久卷,可以包括:采用持久卷置备程序,根据访问模式信息、存储大小信息以及目标存储类型对应的存储定义参数,在目标存储类中置备新的持久卷。In one embodiment, a persistent volume claim request includes access mode information and storage size information, and a persistent volume provisioning program is used to provision a new persistent volume in a target storage class according to the persistent volume claim request. This may include: using a persistent volume provisioning program to provision a new persistent volume in a target storage class according to the access mode information, storage size information, and storage definition parameters corresponding to the target storage type.
在具体实现中,容器集群管理系统可以查找其中引用的存储类和置备程序,并要求置备程序根据持久卷声明请求的访问模式和存储大小,以及参数在存储类中置备新的持久卷。In a specific implementation, the container cluster management system can find the storage class and provisioner referenced therein, and require the provisioner to provision a new persistent volume in the storage class according to the access mode and storage size requested by the persistent volume claim, as well as the parameters.
在一种实施例中,创建新的持久卷,将新的持久卷绑定到持久卷声明请求,可以包括:获取持久卷置备程序指定的真实存储;在真实存储创建新的持久卷,将新的持久卷绑定到持久卷声明请求。In one embodiment, creating a new persistent volume and binding the new persistent volume to a persistent volume claim request may include: obtaining real storage specified by a persistent volume provisioning program; creating a new persistent volume in the real storage, and binding the new persistent volume to the persistent volume claim request.
在具体实现中,置备程序指定了真实的存储,创建一个持久卷,并将其绑定到持久卷声明请求。In the implementation, the provisioner specifies the actual storage, creates a persistent volume, and binds it to the persistent volume claim request.
在一种实施例中,方法还可以包括:创建包含通过名称引用持久卷声明请求的持久卷的数据结构。
In one embodiment, the method may further include: creating a data structure containing a persistent volume that references the persistent volume claim request by name.
在具体实现中,用户可以创建一个包含通过名称引用持久卷声明请求的存储卷的数据结构。In a specific implementation, a user can create a data structure containing the storage volume requested by referencing the persistent volume claim by name.
在本申请实施例中,可以获取目标存储类型,根据目标存储类型,采用模板适配器生成存储类模板,以基于存储类模板创建存储类;获取用户创建的用于申请存储资源的持久卷声明请求;根据持久卷声明请求,在创建的存储类中置备新的持久卷,并创建新的持久卷,将新的持久卷绑定到持久卷声明请求,以针对持久卷声明请求分配持久卷。本申请实施例通过采用模板适配器生成存储类模板以基于存储类模板创建存储类,可以方便用户对所需持久卷进行更精细、准确的定义,避免用户由于不同存储类型参数配置错误,导致持久卷创建错误,应用启动失败的问题;此外,还可以保证持久卷按照用户需要的方式进行回收,避免数据误删,影响有状态的容器应用或者对数据有持久化需求应用的数据保存,丢失应用产生的重要数据,导致应用重建失败的问题。In an embodiment of the present application, the target storage type can be obtained, and according to the target storage type, a storage class template can be generated using a template adapter to create a storage class based on the storage class template; a persistent volume claim request created by a user for applying for storage resources is obtained; according to the persistent volume claim request, a new persistent volume is provisioned in the created storage class, and a new persistent volume is created, and the new persistent volume is bound to the persistent volume claim request to allocate the persistent volume for the persistent volume claim request. By using a template adapter to generate a storage class template to create a storage class based on a storage class template, the embodiment of the present application can facilitate users to define the required persistent volumes more finely and accurately, and avoid the problem that the user misconfigures parameters of different storage types, resulting in persistent volume creation errors and application startup failures; in addition, it can also ensure that the persistent volume is recycled in the manner required by the user, avoiding accidental deletion of data, affecting the data preservation of stateful container applications or applications with data persistence requirements, and losing important data generated by the application, resulting in application reconstruction failure.
为了使本领域技术人员更好地理解本申请实施例,下面对本申请实施例加以说明。参照图3,为本申请实施例提供的一种基于容器集群管理系统的动态存储分配流程示意图。In order to enable those skilled in the art to better understand the embodiments of the present application, the embodiments of the present application are described below. Referring to FIG3 , a schematic diagram of a dynamic storage allocation process based on a container cluster management system provided in the embodiments of the present application is shown.
步骤一:如果尚未部署持久卷制备程序,集群管理员设置持久卷制备程序。Step 1: If the persistent volume provisioning program has not yet been deployed, the cluster administrator sets up the persistent volume provisioning program.
步骤二:管理员指定存储提供者(存储类型)。Step 2: The administrator specifies the storage provider (storage type).
步骤三:模板适配器根据存储类型生成一个或多个存储类模板。Step 3: The template adapter generates one or more storage class templates based on the storage type.
步骤四:管理员根据模板创建一个或多个存储类并将其标记为默认值。Step 4: The administrator creates one or more storage classes based on the template and marks them as default.
步骤五:用户创建一个应用其中一个存储类的持久卷声明请求。Step 5: The user creates a persistent volume claim request that applies one of the storage classes.
步骤六:容器集群管理系统查找其中引用的存储类和置备程序,并要求置备程序根据持久卷声明请求的访问模式和存储大小,以及参数在存储类中置备新的持久卷。Step 6: The container cluster management system finds the referenced storage class and provisioner, and asks the provisioner to provision a new persistent volume in the storage class according to the access mode and storage size and parameters requested by the persistent volume claim.
步骤七:置备程序指定了真实的存储,创建一个持久卷,并将其绑定到持久卷声明请求。Step 7: The provisioner specifies the actual storage, creates a persistent volume, and binds it to the persistent volume claim request.
步骤八:用户创建一个包含通过名称引用持久卷声明请求的存储卷的数据结构。Step 8: The user creates a data structure containing the storage volume requested by the persistent volume claim by name.
需要说明的是,对于方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请实施例并不受所描述的动作顺序的限制,因为依据本申请实施例,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于本申请实施例,所涉及的动作并不一定是本申请实施例所必须的。It should be noted that, for the method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present application are not limited by the described order of actions, because according to the embodiments of the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification all belong to the embodiments of the present application, and the actions involved are not necessarily required by the embodiments of the present application.
参照图4,示出了本申请实施例提供的一种动态存储分配装置的结构框图,装置应用于容器集群管理系统,具体可以包括如下模块:4 shows a block diagram of a dynamic storage allocation device provided in an embodiment of the present application. The device is applied to a container cluster management system and may specifically include the following modules:
获取模块401,用于获取目标存储类型;An acquisition module 401 is used to acquire a target storage type;
模板生成模块402,用于根据目标存储类型,采用模板适配器生成存储类模板,以基于存储类模板创建存储类;存储类模板包括目标存储类型对应的存储定义参数;The template generation module 402 is used to generate a storage class template using a template adapter according to the target storage type, so as to create a storage class based on the storage class template; the storage class template includes storage definition parameters corresponding to the target storage type;
请求获取模块403,用于获取用户创建的用于申请存储资源的持久卷声明请求;
The request acquisition module 403 is used to acquire a persistent volume claim request created by a user for applying for storage resources;
分配模块404,用于根据持久卷声明请求和目标存储类型对应的存储定义参数,在创建的存储类中置备新的持久卷,并创建新的持久卷,将新的持久卷绑定到持久卷声明请求,以针对持久卷声明请求分配持久卷。The allocation module 404 is used to provision a new persistent volume in the created storage class according to the storage definition parameters corresponding to the persistent volume claim request and the target storage type, create a new persistent volume, bind the new persistent volume to the persistent volume claim request, and allocate the persistent volume for the persistent volume claim request.
在一种实施例中,在获取目标存储类型之前,还包括:In one embodiment, before obtaining the target storage type, the method further includes:
判断模块,用于判断是否已部署持久卷置备程序;A determination module, used to determine whether a persistent volume provisioning program has been deployed;
返回模块,用于若未部署持久卷置备程序,则返回未部署信息以使集群管理员部署持久卷置备程序。The return module is used to return the undeployment information if the persistent volume provisioner is not deployed so that the cluster administrator can deploy the persistent volume provisioner.
在一种实施例中,在部署持久卷置备程序时,装置还包括:In one embodiment, when deploying the persistent volume provisioning procedure, the apparatus further includes:
触发模块,用于触发模板适配器获取各个存储类型对应的存储定义参数,生成各个存储类型对应的模板配置信息并保存至数据库中。The trigger module is used to trigger the template adapter to obtain the storage definition parameters corresponding to each storage type, generate the template configuration information corresponding to each storage type and save it in the database.
在一种实施例中,触发模块,包括:In one embodiment, the trigger module includes:
定义参数获取子模块,用于触发模板适配器获取持久卷置备程序提供的各个存储类型对应的存储定义参数。The definition parameter acquisition submodule is used to trigger the template adapter to obtain the storage definition parameters corresponding to each storage type provided by the persistent volume provisioning program.
在一种实施例中,模板配置信息包括模板生成规则和模板参数推荐,触发模块,包括:In one embodiment, the template configuration information includes template generation rules and template parameter recommendations, and the trigger module includes:
模板参数生成子模块,用于生成各个存储类型对应的模板生成规则和模板参数推荐并保存至数据库中。The template parameter generation submodule is used to generate template generation rules and template parameter recommendations corresponding to each storage type and save them in the database.
在一种实施例中,获取模块,包括:In one embodiment, the acquisition module includes:
存储类型获取子模块,用于获取至少一个目标存储提供对象对应的至少一个目标存储类型,存储提供对象为用于提供持久卷资源的对象。The storage type acquisition submodule is used to obtain at least one target storage type corresponding to at least one target storage provision object, where the storage provision object is an object used to provide persistent volume resources.
在一种实施例中,模板生成模块,包括:In one embodiment, the template generation module includes:
存储类模板生成子模块,用于采用模板适配器,向数据库查询目标存储类型对应的模板生成规则和模板参数推荐,并根据目标存储类型对应的模板生成规则和模板参数推荐,生成存储类模板。The storage class template generation submodule is used to use the template adapter to query the database for template generation rules and template parameter recommendations corresponding to the target storage type, and generate a storage class template based on the template generation rules and template parameter recommendations corresponding to the target storage type.
在一种实施例中,存储类模板生成子模块,包括:In one embodiment, the storage class template generation submodule includes:
目标存储类型发送单元,用于向模板适配器发送集群管理员输入的目标存储类型,以使模板适配器在接收到目标存储类型后,向数据库查询目标存储类型对应的模板生成规则和模板参数推荐,并根据目标存储类型对应的模板生成规则和模板参数推荐,生成存储类模板。The target storage type sending unit is used to send the target storage type input by the cluster administrator to the template adapter, so that after receiving the target storage type, the template adapter queries the database for the template generation rules and template parameter recommendations corresponding to the target storage type, and generates a storage class template based on the template generation rules and template parameter recommendations corresponding to the target storage type.
在一种实施例中,在基于存储类模板创建存储类之前,还包括:In one embodiment, before creating a storage class based on the storage class template, the method further includes:
指令响应模块,用于响应于用户输入的模板配置信息修改指令,修改目标存储类型对应的模板生成规则和模板参数推荐。The instruction response module is used to modify the template generation rules and template parameter recommendations corresponding to the target storage type in response to the template configuration information modification instruction input by the user.
在一种实施例中,模板生成模块,包括:In one embodiment, the template generation module includes:
创建子模块,用于基于存储类模板,创建与至少一个目标存储类型一一对应的至少一个存储类。A creation submodule is used to create at least one storage class corresponding to at least one target storage type based on the storage class template.
在一种实施例中,模板生成模块,还包括:
In one embodiment, the template generation module further includes:
默认存储类设置子模块,用于设置一个默认存储类,默认存储类应用于未指定存储类的持久卷声明请求。The default storage class setting submodule is used to set a default storage class, which is applied to persistent volume claim requests that do not specify a storage class.
在一种实施例中,存储类模板包括存储提供对象、资源回收策略、是否允许存储扩容、挂载选项、存储绑定模式和存储参数中的至少一种,模板生成模块,包括:In one embodiment, the storage class template includes at least one of a storage provision object, a resource recovery policy, whether storage expansion is allowed, a mount option, a storage binding mode, and a storage parameter, and the template generation module includes:
存储类创建子模块,用于基于存储提供对象、资源回收策略、是否允许存储扩容、挂载选项、存储绑定模式和存储参数中的至少一种,创建存储类。The storage class creation submodule is used to create a storage class based on at least one of the storage provision object, resource recovery policy, whether storage expansion is allowed, mounting options, storage binding mode and storage parameters.
在一种实施例中,请求获取模块,包括:In one embodiment, the request acquisition module includes:
持久卷声明请求获取子模块,用于获取用户创建的引用至少一个存储类中的目标存储类的持久卷声明请求。The persistent volume claim request acquisition submodule is used to obtain a persistent volume claim request created by a user that references a target storage class in at least one storage class.
在一种实施例中,分配模块,包括:In one embodiment, the allocation module includes:
查找子模块,用于查找目标存储类;The search submodule is used to search for the target storage class;
置备子模块,用于采用持久卷置备程序,根据持久卷声明请求,在目标存储类中置备新的持久卷。The provisioning submodule is used to use the persistent volume provisioner to provision new persistent volumes in the target storage class based on the persistent volume claim request.
在一种实施例中,持久卷声明请求包括访问模式信息和存储大小信息,置备子模块,包括:In one embodiment, the persistent volume claim request includes access mode information and storage size information, and the provisioning submodule includes:
持久卷置备单元,用于采用持久卷置备程序,根据访问模式信息、存储大小信息以及目标存储类型对应的存储定义参数,在目标存储类中置备新的持久卷。The persistent volume provisioning unit is used to use a persistent volume provisioning program to provision a new persistent volume in a target storage class according to the access mode information, the storage size information, and storage definition parameters corresponding to the target storage type.
在一种实施例中,分配模块,包括:In one embodiment, the allocation module includes:
真实存储获取子模块,用于获取持久卷置备程序指定的真实存储;The real storage acquisition submodule is used to obtain the real storage specified by the persistent volume provisioning program;
绑定子模块,用于在真实存储创建新的持久卷,将新的持久卷绑定到持久卷声明请求。The binding submodule is used to create a new persistent volume in the real storage and bind the new persistent volume to the persistent volume claim request.
在一种实施例中,装置还包括:In one embodiment, the apparatus further comprises:
数据结构创建模块,用于创建包含通过名称引用持久卷声明请求的持久卷的数据结构。A data structure creation module that creates a data structure containing a persistent volume that references a persistent volume claim request by name.
在本申请实施例中,可以获取目标存储类型,根据目标存储类型,采用模板适配器生成存储类模板,以基于存储类模板创建存储类;获取用户创建的用于申请存储资源的持久卷声明请求;根据持久卷声明请求,在创建的存储类中置备新的持久卷,并创建新的持久卷,将新的持久卷绑定到持久卷声明请求,以针对持久卷声明请求分配持久卷。本申请实施例通过采用模板适配器生成存储类模板以基于存储类模板创建存储类,可以方便用户对所需持久卷进行更精细、准确的定义,避免用户由于不同存储类型参数配置错误,导致持久卷创建错误,应用启动失败的问题;此外,还可以保证持久卷按照用户需要的方式进行回收,避免数据误删,影响有状态的容器应用或者对数据有持久化需求应用的数据保存,丢失应用产生的重要数据,导致应用重建失败的问题。In an embodiment of the present application, the target storage type can be obtained, and according to the target storage type, a storage class template can be generated using a template adapter to create a storage class based on the storage class template; a persistent volume claim request created by a user for applying for storage resources is obtained; according to the persistent volume claim request, a new persistent volume is provisioned in the created storage class, and a new persistent volume is created, and the new persistent volume is bound to the persistent volume claim request to allocate the persistent volume for the persistent volume claim request. By using a template adapter to generate a storage class template to create a storage class based on a storage class template, the embodiment of the present application can facilitate users to define the required persistent volumes more finely and accurately, and avoid the problem that the user misconfigures parameters of different storage types, resulting in persistent volume creation errors and application startup failures; in addition, it can also ensure that the persistent volume is recycled in the manner required by the user, avoiding accidental deletion of data, affecting the data preservation of stateful container applications or applications with data persistence requirements, and losing important data generated by the application, resulting in application reconstruction failure.
对于装置实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
本申请实施例还提供了一种电子设备,参照图5,为本申请实施例提供的一种电子设备的示意图,该电子设备包括:处理器51、存储器52及存储在存储器52上并能够在处理器
51上运行的计算机程序53,该计算机程序被处理器执行时实现上述动态存储分配方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。The present application also provides an electronic device. Referring to FIG. 5 , which is a schematic diagram of an electronic device provided in the present application, the electronic device includes: a processor 51, a memory 52, and a memory stored in the memory 52 and capable of being used in the processor The computer program 53 running on 51 implements each process of the above-mentioned dynamic storage allocation method embodiment when the computer program is executed by the processor, and can achieve the same technical effect. To avoid repetition, it will not be described here.
本申请实施例还提供了一种计算机非易失性可读存储介质,计算机非易失性可读存储介质上存储计算机程序,计算机程序被处理器执行时实现上述动态存储分配方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。The embodiment of the present application also provides a computer non-volatile readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the above-mentioned dynamic storage allocation method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
本说明书中的各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
本领域内的技术人员应明白,本申请实施例的实施例可提供为方法、装置、或计算机程序产品。因此,本申请实施例可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, devices, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
本申请实施例是参照根据本申请实施例的方法、终端设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理终端设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理终端设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application embodiment is described with reference to the flowchart and/or block diagram of the method, terminal device (system) and computer program product according to the embodiment of the present application. It should be understood that each process and/or box in the flowchart and/or block diagram, and the combination of the process and/or box in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing terminal device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device produce a device for realizing the function specified in one process or multiple processes in the flowchart and/or one box or multiple boxes in the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理终端设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理终端设备上,使得在计算机或其他可编程终端设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程终端设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce computer-implemented processing, so that the instructions executed on the computer or other programmable terminal device provide steps for implementing the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.
尽管已描述了本申请实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例做出另外的变更和修改。所以,所附权利要求意欲解释为包括本申请实施例以及落入本申请实施例范围的所有变更和修改。Although the embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they are aware of the basic creative concepts. Therefore, the appended claims are intended to be interpreted as including the embodiments of the present application and all changes and modifications that fall within the scope of the embodiments of the present application.
最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者终端设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者终
端设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括要素的过程、方法、物品或者终端设备中还存在另外的相同要素。Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements for such process, method, article or terminal. Elements inherent to the terminal device. In the absence of more restrictions, elements defined by the phrase "comprising a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device comprising the elements.
以上对本申请所提供的动态存储分配方法、装置、电子设备和非易失性可读存储介质,进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上,本说明书内容不应理解为对本申请的限制。
The dynamic storage allocation method, device, electronic device and non-volatile readable storage medium provided by the present application are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims (20)
- 一种动态存储分配方法,其特征在于,所述方法应用于容器集群管理系统,所述方法包括:A dynamic storage allocation method, characterized in that the method is applied to a container cluster management system, and the method comprises:获取目标存储类型;Get the target storage type;根据所述目标存储类型,采用模板适配器生成存储类模板,以基于所述存储类模板创建存储类;According to the target storage type, using a template adapter to generate a storage class template, so as to create a storage class based on the storage class template;获取用户创建的用于申请存储资源的持久卷声明请求;Get the persistent volume claim request created by the user to apply for storage resources;根据所述持久卷声明请求,在创建的存储类中置备新的持久卷,并创建所述新的持久卷,将所述新的持久卷绑定到所述持久卷声明请求,以针对所述持久卷声明请求分配持久卷。According to the persistent volume claim request, a new persistent volume is provisioned in the created storage class, the new persistent volume is created, and the new persistent volume is bound to the persistent volume claim request to allocate a persistent volume for the persistent volume claim request.
- 根据权利要求1所述的方法,其特征在于,在所述获取目标存储类型之前,还包括:判断是否已部署持久卷置备程序;The method according to claim 1 is characterized in that, before obtaining the target storage type, it also includes: determining whether a persistent volume provisioning program has been deployed;若未部署持久卷置备程序,则返回未部署信息以使集群管理员部署持久卷置备程序。If the persistent volume provisioner is not deployed, the not deployed message is returned to allow the cluster administrator to deploy the persistent volume provisioner.
- 根据权利要求2所述的方法,其特征在于,在所述部署持久卷置备程序时,所述方法还包括:The method according to claim 2, characterized in that, when deploying the persistent volume provisioning program, the method further comprises:触发模板适配器获取各个存储类型对应的存储定义参数,生成各个存储类型对应的模板配置信息并保存至数据库中。The template adapter is triggered to obtain storage definition parameters corresponding to each storage type, generate template configuration information corresponding to each storage type and save it in the database.
- 根据权利要求3所述的方法,其特征在于,所述触发模板适配器获取各个存储类型对应的存储定义参数,包括:The method according to claim 3 is characterized in that the triggering template adapter obtains the storage definition parameters corresponding to each storage type, including:触发模板适配器获取所述持久卷置备程序提供的各个存储类型对应的存储定义参数。The template adapter is triggered to obtain storage definition parameters corresponding to each storage type provided by the persistent volume provisioning program.
- 根据权利要求3所述的方法,其特征在于,所述模板配置信息包括模板生成规则和模板参数推荐,所述生成各个存储类型对应的模板配置信息并保存至数据库中,包括:The method according to claim 3, characterized in that the template configuration information includes template generation rules and template parameter recommendations, and the step of generating template configuration information corresponding to each storage type and saving it in a database comprises:生成各个存储类型对应的模板生成规则和模板参数推荐并保存至数据库中。Generate template generation rules and template parameter recommendations corresponding to each storage type and save them in the database.
- 根据权利要求4所述的方法,其特征在于,所述获取目标存储类型,包括:The method according to claim 4, characterized in that the obtaining the target storage type comprises:获取至少一个目标存储提供对象对应的至少一个目标存储类型,所述存储提供对象为用于提供持久卷资源的对象。At least one target storage type corresponding to at least one target storage provision object is obtained, where the storage provision object is an object for providing persistent volume resources.
- 根据权利要求5所述的方法,其特征在于,所述根据所述目标存储类型,采用模板适配器生成存储类模板,包括:The method according to claim 5, characterized in that the step of generating a storage class template using a template adapter according to the target storage type comprises:采用模板适配器,向所述数据库查询所述目标存储类型对应的模板生成规则和模板参数推荐,并根据所述目标存储类型对应的模板生成规则和模板参数推荐,生成存储类模板。A template adapter is used to query the database for template generation rules and template parameter recommendations corresponding to the target storage type, and a storage class template is generated according to the template generation rules and template parameter recommendations corresponding to the target storage type.
- 根据权利要求7所述的方法,其特征在于,所述采用模板适配器,向所述数据库查询所述目标存储类型对应的模板生成规则和模板参数推荐,并根据所述目标存储类型对应的模板生成规则和模板参数推荐,生成存储类模板,包括:The method according to claim 7 is characterized in that the adopting of the template adapter to query the database for template generation rules and template parameter recommendations corresponding to the target storage type, and generating a storage class template according to the template generation rules and template parameter recommendations corresponding to the target storage type, comprises:向模板适配器发送集群管理员输入的目标存储类型,以使所述模板适配器在接收到所述目标存储类型后,向所述数据库查询所述目标存储类型对应的模板生成规则和模板参数推荐,并根据所述目标存储类型对应的模板生成规则和模板参数推荐,生成存储类模板。 The target storage type input by the cluster administrator is sent to the template adapter, so that after receiving the target storage type, the template adapter queries the database for template generation rules and template parameter recommendations corresponding to the target storage type, and generates a storage class template according to the template generation rules and template parameter recommendations corresponding to the target storage type.
- 根据权利要求8所述的方法,其特征在于,在所述基于所述存储类模板创建存储类之前,还包括:The method according to claim 8, characterized in that before creating a storage class based on the storage class template, it also includes:响应于用户输入的模板配置信息修改指令,修改所述目标存储类型对应的模板生成规则和模板参数推荐。In response to a template configuration information modification instruction input by a user, the template generation rule and template parameter recommendation corresponding to the target storage type are modified.
- 根据权利要求6所述的方法,其特征在于,所述基于所述存储类模板创建存储类,The method according to claim 6, characterized in that the creating a storage class based on the storage class template,包括:include:基于所述存储类模板,创建与所述至少一个目标存储类型一一对应的至少一个存储类。Based on the storage class template, at least one storage class is created corresponding to the at least one target storage type.
- 根据权利要求10所述的方法,其特征在于,所述基于所述存储类模板创建存储类,还包括:The method according to claim 10, characterized in that the step of creating a storage class based on the storage class template further comprises:设置一个默认存储类,所述默认存储类应用于未指定存储类的持久卷声明请求。Sets a default storage class that is applied to persistent volume claim requests that do not specify a storage class.
- 根据权利要求1所述的方法,其特征在于,所述存储类模板包括存储提供对象、资源回收策略、是否允许存储扩容、挂载选项、存储绑定模式和存储参数中的至少一种,The method according to claim 1, characterized in that the storage class template includes at least one of a storage provision object, a resource recovery strategy, whether storage expansion is allowed, a mount option, a storage binding mode, and a storage parameter.所述基于所述存储类模板创建存储类,包括:The creating a storage class based on the storage class template includes:基于存储提供对象、资源回收策略、是否允许存储扩容、挂载选项、存储绑定模式和存储参数中的至少一种,创建存储类。A storage class is created based on at least one of a storage provision object, a resource recovery policy, whether storage expansion is allowed, a mount option, a storage binding mode, and a storage parameter.
- 根据权利要求10所述的方法,其特征在于,所述获取用户创建的用于申请存储资源的持久卷声明请求,包括:The method according to claim 10, characterized in that the obtaining of a persistent volume claim request created by a user for applying for storage resources comprises:获取用户创建的引用所述至少一个存储类中的目标存储类的持久卷声明请求。A persistent volume claim request created by a user referencing a target storage class in the at least one storage class is obtained.
- 根据权利要求13所述的方法,其特征在于,所述根据所述持久卷声明请求,在创建的存储类中置备新的持久卷,包括:The method according to claim 13, wherein the step of provisioning a new persistent volume in the created storage class according to the persistent volume claim request comprises:查找所述目标存储类;Find the target storage class;采用所述持久卷置备程序,根据持久卷声明请求,在所述目标存储类中置备新的持久卷。The persistent volume provisioning procedure is used to provision a new persistent volume in the target storage class according to the persistent volume claim request.
- 根据权利要求14所述的方法,其特征在于,所述持久卷声明请求包括访问模式信息和存储大小信息,所述采用所述持久卷置备程序,根据持久卷声明请求,在所述目标存储类中置备新的持久卷,包括:The method according to claim 14, characterized in that the persistent volume claim request includes access mode information and storage size information, and the adopting the persistent volume provisioning program to provision a new persistent volume in the target storage class according to the persistent volume claim request comprises:采用所述持久卷置备程序,根据所述访问模式信息、存储大小信息以及目标存储类型对应的存储定义参数,在所述目标存储类中置备新的持久卷。The persistent volume provisioning program is used to provision a new persistent volume in the target storage class according to the access mode information, the storage size information, and the storage definition parameters corresponding to the target storage type.
- 根据权利要求15所述的方法,其特征在于,所述创建所述新的持久卷,将所述新的持久卷绑定到所述持久卷声明请求,包括:The method according to claim 15, characterized in that the creating the new persistent volume and binding the new persistent volume to the persistent volume claim request comprises:获取所述持久卷置备程序指定的真实存储;Obtaining the real storage specified by the persistent volume provisioner;在所述真实存储创建所述新的持久卷,将所述新的持久卷绑定到所述持久卷声明请求。The new persistent volume is created in the real storage, and the new persistent volume is bound to the persistent volume claim request.
- 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method according to claim 1, characterized in that the method further comprises:创建包含通过名称引用持久卷声明请求的持久卷的数据结构。Creates a data structure containing the persistent volume requested by referencing the persistent volume claim by name.
- 一种动态存储分配装置,其特征在于,所述装置应用于容器集群管理系统,所述装置包括:A dynamic storage allocation device, characterized in that the device is applied to a container cluster management system, and the device comprises:获取模块,用于获取目标存储类型; An acquisition module is used to obtain the target storage type;模板生成模块,用于根据所述目标存储类型,采用模板适配器生成存储类模板,以基于所述存储类模板创建存储类;所述存储类模板包括所述目标存储类型对应的存储定义参数;A template generation module, configured to generate a storage class template using a template adapter according to the target storage type, so as to create a storage class based on the storage class template; the storage class template includes storage definition parameters corresponding to the target storage type;请求获取模块,用于获取用户创建的用于申请存储资源的持久卷声明请求;The request acquisition module is used to obtain the persistent volume claim request created by the user to apply for storage resources;分配模块,用于根据所述持久卷声明请求和所述目标存储类型对应的存储定义参数,在创建的存储类中置备新的持久卷,并创建所述新的持久卷,将所述新的持久卷绑定到所述持久卷声明请求,以针对所述持久卷声明请求分配持久卷。An allocation module is used to provision a new persistent volume in the created storage class according to the persistent volume declaration request and the storage definition parameters corresponding to the target storage type, create the new persistent volume, bind the new persistent volume to the persistent volume declaration request, so as to allocate a persistent volume for the persistent volume declaration request.
- 一种电子设备,其特征在于,包括:处理器、存储器及存储在所述存储器上并能够在所述处理器上运行的计算机程序,所述计算机程序被所述处理器执行时实现如权利要求1-17中任一项所述的动态存储分配方法的步骤。An electronic device, characterized in that it includes: a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the steps of the dynamic storage allocation method as described in any one of claims 1 to 17 are implemented.
- 一种计算机非易失性可读存储介质,其特征在于,所述计算机非易失性可读存储介质上存储计算机程序,所述计算机程序被处理器执行时实现如权利要求1至17中任一项所述的动态存储分配方法的步骤。 A computer non-volatile readable storage medium, characterized in that a computer program is stored on the computer non-volatile readable storage medium, and when the computer program is executed by a processor, the steps of the dynamic storage allocation method as described in any one of claims 1 to 17 are implemented.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310165351.7 | 2023-02-24 | ||
CN202310165351.7A CN116088768B (en) | 2023-02-24 | 2023-02-24 | Dynamic storage allocation method, dynamic storage allocation device, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2024174717A1 true WO2024174717A1 (en) | 2024-08-29 |
Family
ID=86186903
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2023/141624 WO2024174717A1 (en) | 2023-02-24 | 2023-12-25 | Dynamic storage allocation method and apparatus, electronic device, and storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN116088768B (en) |
WO (1) | WO2024174717A1 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116088768B (en) * | 2023-02-24 | 2023-07-14 | 苏州浪潮智能科技有限公司 | Dynamic storage allocation method, dynamic storage allocation device, electronic equipment and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113849137A (en) * | 2021-10-13 | 2021-12-28 | 上海威固信息技术股份有限公司 | Visual block storage method and system for Shenwei container platform |
CN114253459A (en) * | 2020-09-22 | 2022-03-29 | 北京金山云网络技术有限公司 | Method and device for creating persistent data volume and server |
CN114756170A (en) * | 2022-04-02 | 2022-07-15 | 苏州空天信息研究院 | Storage isolation system and method for container application |
CN116088768A (en) * | 2023-02-24 | 2023-05-09 | 苏州浪潮智能科技有限公司 | Dynamic storage allocation method, dynamic storage allocation device, electronic equipment and storage medium |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10963349B2 (en) * | 2017-08-25 | 2021-03-30 | Vmware, Inc. | Containerized application snapshots |
CN109144723B (en) * | 2018-07-23 | 2022-11-11 | 北京轻元科技有限公司 | Method and terminal for allocating storage space |
CN113296871A (en) * | 2020-04-10 | 2021-08-24 | 阿里巴巴集团控股有限公司 | Method, equipment and system for processing container group instance |
CN111966305B (en) * | 2020-10-22 | 2021-02-09 | 腾讯科技(深圳)有限公司 | Persistent volume allocation method and device, computer equipment and storage medium |
CN114327784A (en) * | 2021-12-31 | 2022-04-12 | 中国联合网络通信集团有限公司 | Kubernetes storage resource binding method, system, equipment and medium based on position information |
CN115576655B (en) * | 2022-12-09 | 2023-04-14 | 浪潮电子信息产业股份有限公司 | Container data protection system, method, device, equipment and readable storage medium |
-
2023
- 2023-02-24 CN CN202310165351.7A patent/CN116088768B/en active Active
- 2023-12-25 WO PCT/CN2023/141624 patent/WO2024174717A1/en unknown
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114253459A (en) * | 2020-09-22 | 2022-03-29 | 北京金山云网络技术有限公司 | Method and device for creating persistent data volume and server |
CN113849137A (en) * | 2021-10-13 | 2021-12-28 | 上海威固信息技术股份有限公司 | Visual block storage method and system for Shenwei container platform |
CN114756170A (en) * | 2022-04-02 | 2022-07-15 | 苏州空天信息研究院 | Storage isolation system and method for container application |
CN116088768A (en) * | 2023-02-24 | 2023-05-09 | 苏州浪潮智能科技有限公司 | Dynamic storage allocation method, dynamic storage allocation device, electronic equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN116088768A (en) | 2023-05-09 |
CN116088768B (en) | 2023-07-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11847319B2 (en) | Storage system interface | |
EP3657358B1 (en) | Method, device and system for persistent data processing, and readable storage medium | |
US11249788B2 (en) | Cloud management platform, and virtual machine management method and system | |
CN109684282B (en) | Method and device for constructing metadata cache | |
US9529933B2 (en) | Dynamic assignment of business logic based on schema mapping metadata | |
WO2024174717A1 (en) | Dynamic storage allocation method and apparatus, electronic device, and storage medium | |
US10649955B2 (en) | Providing unique inodes across multiple file system namespaces | |
US11429568B2 (en) | Global namespace for a hierarchical set of file systems | |
US10657102B2 (en) | Storage space management in union mounted file systems | |
US10713215B2 (en) | Allocating non-conflicting inode numbers | |
CN111684437B (en) | Staggered update key-value storage system ordered by time sequence | |
US10579587B2 (en) | Space management for a hierarchical set of file systems | |
CN113391875A (en) | Container deployment method and device | |
US20170237687A1 (en) | Resource trees by management controller | |
CN112052222B (en) | Heterogeneous object storage cluster access method, device, equipment and storage medium | |
US10579598B2 (en) | Global namespace for a hierarchical set of file systems | |
US10592479B2 (en) | Space management for a hierarchical set of file systems | |
CN107453950B (en) | Information processing method and monitoring system | |
US11042665B2 (en) | Data connectors in large scale processing clusters | |
CN113687910A (en) | Method, device, equipment and storage medium for managing USB (universal serial bus) equipment in cluster | |
WO2024174894A1 (en) | Physical volume access method, apparatus, computer device and storage medium | |
CN114296637B (en) | Dynamic creation method and device for local storage volume | |
US12093144B1 (en) | Method and system for performing cross platform restoration operations | |
US20240232404A9 (en) | Method and system for automatic data protection for limited access cloud data | |
US20240137360A1 (en) | Method and system for performing authentication and object discovery for on-premises cloud service providers |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 23923880 Country of ref document: EP Kind code of ref document: A1 |