CN114281253A - Storage volume management method - Google Patents

Storage volume management method Download PDF

Info

Publication number
CN114281253A
CN114281253A CN202111514118.2A CN202111514118A CN114281253A CN 114281253 A CN114281253 A CN 114281253A CN 202111514118 A CN202111514118 A CN 202111514118A CN 114281253 A CN114281253 A CN 114281253A
Authority
CN
China
Prior art keywords
storage volume
cluster
request
target
volume
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111514118.2A
Other languages
Chinese (zh)
Other versions
CN114281253B (en
Inventor
袁家发
潘映林
伍盛
张志强
蓝小明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Merchants Bank Co Ltd
Original Assignee
China Merchants Bank Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Merchants Bank Co Ltd filed Critical China Merchants Bank Co Ltd
Priority to CN202111514118.2A priority Critical patent/CN114281253B/en
Publication of CN114281253A publication Critical patent/CN114281253A/en
Application granted granted Critical
Publication of CN114281253B publication Critical patent/CN114281253B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The application discloses a management method of a storage volume, which is applied to a management system of the storage volume, wherein the management system of the storage volume is deployed between a container cluster and a CSI plug-in, and the management method of the storage volume comprises the following steps: receiving a storage volume management request based on the container cluster, wherein the storage volume management request comprises a storage volume creation request and a storage volume deletion request; determining whether the storage volume management request is of a cross-cluster type or not based on management parameters in the storage volume management request and preset storage volume information; and if the storage volume management request is of a cross-cluster type, creating or deleting a cross-cluster type storage volume for the container cluster based on the CSI plug-in. The application can realize cross-cluster automatic management of the storage volume based on the CSI storage plug-in through a management system of the storage volume arranged between the container cluster and the CSI plug-in.

Description

Storage volume management method
Technical Field
The application relates to the technical field of containers, in particular to a storage volume management method.
Background
In recent years, container technology and container arrangement technology are rapidly developed, and the container technology has the characteristics of less occupied resources, good isolation, convenience in deployment, high efficiency, safety and the like, and gradually becomes a basic technology of cloud computing. The container platform and its associated techniques can meet the needs of managing containers on a single machine, but are not well suited to containers deployed on multiple hosts. The container arrangement tool expands the life cycle management capability of the container to a multi-machine cluster, the value of the container is improved to a great extent, and meanwhile, the container arrangement tool provides an abstraction layer for developers and infrastructure teams to process large-scale containerization deployment. Kubernets (abbreviated as K8s, an abbreviation that is 8 instead of 8 characters "ubernet" in the middle of the name, is an open source application for managing containerization on multiple hosts in a cloud platform) has become the fastest growing container orchestration engine with the highest market share.
On existing container platforms and orchestration systems, how to efficiently and regularly utilize storage is a concern for the overall system. The CSI (Container Storage Interface) provides a set of canonical Storage Interface standards that result from the cooperation between community members from various COs (including kubernets, messes, Cloud foundation and Docker), an industry standard in the field of Container orchestration. The goal of this interface is to establish a standardized mechanism for the CO to expose any storage system to its containerized workload. At present, the CSI plugin provided by each storage provider can provide functions of storage creation, deletion, capacity expansion, and the like for the container cluster in which the CSI plugin is located, but cannot realize a function of providing storage volume sharing for applications across clusters. However, in order to apply the high availability guarantee, many times, one application on the container platform is not only deployed in one cluster, but needs to be released in a cluster of a plurality of different fault domains at the same time, namely, the cluster is released in a federal mode. In the context of federal releases of kubernets clusters, container instances that are applied in different clusters are different applications from the perspective of a single kubernets, but essentially, they are still different instances of the same application and often need to share the same storage volume. At present, each CSI plug-in only carries out management such as creation and deletion of volumes from the perspective of a single cluster, and the situation of cluster federation is not considered. In order to enable application sharing back-end storage volumes in a plurality of clusters to be manually created and mounted in each cluster only through a storage administrator, the inefficient and error-prone manual management mode cannot adapt to a large-scale container platform scene, so that the existing CSI-based storage plug-in cannot provide cross-cluster automatic management of the storage volumes.
Disclosure of Invention
The application mainly aims to provide a storage volume management method, and aims to solve the technical problem that cross-cluster automatic management of a storage volume cannot be provided based on a CSI storage plug-in at present.
In order to achieve the above object, an embodiment of the present application provides a method for managing a storage volume, which is applied to a management system of the storage volume, where the management system of the storage volume is deployed between a container cluster and a container storage interface CSI plugin, and the method for managing the storage volume includes:
receiving a storage volume management request based on the container cluster, wherein the storage volume management request comprises a storage volume creation request and a storage volume deletion request;
determining whether the storage volume management request is of a cross-cluster type or not based on management parameters in the storage volume management request and preset storage volume information;
and if the storage volume management request is of a cross-cluster type, creating or deleting a cross-cluster type storage volume for the container cluster based on the CSI plug-in.
Preferably, the step of determining whether the storage volume management request is of a cross-cluster type based on the management parameters in the storage volume management request and preset storage volume information includes:
if the storage volume management request is a storage volume creation request, determining whether the storage volume creation request is a cross-cluster type or not based on storage volume creation parameters corresponding to the storage volume creation request and preset storage volume information;
if the storage volume management request is a storage volume deletion request, determining whether the storage volume deletion request is of a cross-cluster type or not based on storage volume deletion parameters corresponding to the storage volume deletion request and preset storage volume information.
Preferably, the step of determining whether the storage volume creation request is of a cross-cluster type based on the storage volume creation parameter corresponding to the storage volume creation request and preset storage volume information includes:
acquiring storage volume creation parameters in the storage volume creation request, and determining a first target storage volume statement corresponding to the storage volume creation parameters in a database table of preset storage volume information;
determining whether the first target storage volume declares that a target annotation exists and/or whether cluster federated default shared storage volume functionality is disabled, the target annotation being used to specify a back-end physical volume unique encoding ID to be shared;
and if the target annotation and/or the function of the cluster federal default shared storage volume is not disabled, determining that the storage volume creation request is of a cross-cluster type, and determining each target container cluster of the storage volume to be created by combining a database table in the preset storage volume information.
Preferably, the step of determining whether the first target storage volume declares that a target annotation is present and/or whether cluster federated default shared storage volume functionality is disabled comprises:
identifying whether a first identifier corresponding to a target annotation and/or a second identifier corresponding to a function of a forbidden cluster federal default shared storage volume exists in the first target storage volume statement;
if the first identifier and/or the second identifier exist, determining that the target annotation exists and/or the function of the cluster federated default shared storage volume is not disabled;
if the first identity is not present and the second identity is not present, determining that the target annotation is not present and disabling cluster federated default shared storage volume functionality.
Preferably, the step of determining whether the storage volume deletion request is of a cross-cluster type based on the storage volume deletion parameter corresponding to the storage volume deletion request and preset storage volume information includes:
acquiring a volume ID prefix contained in a storage volume deletion parameter in the storage volume deletion request, determining a second target storage volume statement corresponding to the volume ID prefix in a database table of preset storage volume information, and determining a target volume ID corresponding to the second target storage volume statement;
determining the target number of a third target storage volume statement of a target volume corresponding to the target volume sharing the target volume ID in the database table;
and determining whether the storage volume deleting request is of a cross-cluster type or not according to the target number.
Preferably, the step of determining whether the storage volume deletion request is of a cross-cluster type according to the target number includes:
if the target number is larger than a preset threshold value, determining that the storage volume deleting request is of a cross-cluster type;
and if the target number is less than or equal to the preset threshold value, determining that the storage volume deleting request is not in a cross-cluster type.
Preferably, the step of creating or deleting a storage volume across cluster types for the container cluster based on the CSI plugin comprises:
if the storage volume management request is a storage volume creation request, determining that the storage volume creation request corresponds to each target container cluster of a storage volume to be created, and creating a shared storage volume for the container cluster and each target container cluster based on the CSI plug-in;
and if the storage volume management request is a storage volume deletion request, deleting the second target storage volume statement based on the CSI plug-in, and reserving the target storage volume corresponding to the second target storage volume statement for calling other container clusters sharing the target storage volume.
Preferably, before the step of receiving a storage volume management request based on the container cluster, the method further includes:
receiving an association request based on each container cluster, and creating a database table based on each container cluster;
creating a storage class based on each of the container clusters;
and generating preset storage volume information based on the database table and the storage class.
The embodiment of the application provides a management method of a storage volume, which is applied to a management system of the storage volume, wherein the management system of the storage volume is deployed between a container cluster and a CSI plug-in, and the management method of the storage volume comprises the following steps: receiving a storage volume management request based on the container cluster, wherein the storage volume management request comprises a storage volume creation request and a storage volume deletion request; determining whether the storage volume management request is of a cross-cluster type or not based on management parameters in the storage volume management request and preset storage volume information; and if the storage volume management request is of a cross-cluster type, creating or deleting a cross-cluster type storage volume for the container cluster based on the CSI plug-in. According to the method and the device, the management system of the storage volume arranged between the container cluster and the CSI plug-in determines the type of the storage volume management request according to the management parameters in the storage volume management request and the storage volume information in the preset database, and can create or delete the cross-cluster type storage volume for the container cluster through the CSI plug-in when the type of the storage volume management request is the cross-cluster type, so that cross-cluster automatic management of the storage volume is provided based on the CSI storage plug-in.
Drawings
FIG. 1 is a flowchart illustrating a storage volume management method according to a first embodiment of the present application;
FIG. 2 is a flowchart illustrating a first scenario of a storage volume management method according to a second embodiment of the present application;
fig. 3 is a flowchart illustrating a second scenario in a storage volume management method according to the present application.
The implementation, functional features and advantages of the objectives of the present application will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The embodiment of the application provides a management method of a storage volume, which is applied to a management system of the storage volume, wherein the management system of the storage volume is deployed between a container cluster and a CSI plug-in, and the management method of the storage volume comprises the following steps: receiving a storage volume management request based on the container cluster, wherein the storage volume management request comprises a storage volume creation request and a storage volume deletion request; determining whether the storage volume management request is of a cross-cluster type or not based on management parameters in the storage volume management request and preset storage volume information; and if the storage volume management request is of a cross-cluster type, creating or deleting a cross-cluster type storage volume for the container cluster based on the CSI plug-in. According to the method and the device, the management system of the storage volume arranged between the container cluster and the CSI plug-in determines the type of the storage volume management request according to the management parameters in the storage volume management request and the storage volume information in the preset database, and can create or delete the cross-cluster type storage volume for the container cluster through the CSI plug-in when the type of the storage volume management request is the cross-cluster type, so that cross-cluster automatic management of the storage volume is provided based on the CSI storage plug-in.
For a better understanding of the above technical solutions, exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
In order to better understand the technical solution, the technical solution will be described in detail with reference to the drawings and the specific embodiments.
Referring to fig. 1, fig. 1 is a schematic flowchart illustrating a method for managing a storage volume according to a first embodiment of the present application. In this embodiment, the method for managing the storage volume includes the following steps:
step S10, receiving a storage volume management request based on the container cluster, wherein the storage volume management request comprises a storage volume creation request and a storage volume deletion request;
the management method of the storage volume in the embodiment is applied to a management system of the storage volume, the management system of the storage volume is deployed between a container cluster (i.e., a kubernets cluster, which may also be referred to as a mirror cluster) and a CSI plugin of a container storage interface, specifically, the CSI plugin is a CSI plugin of a storage provider in the embodiment, the management system of the storage volume in the embodiment may be the CSI plugin, and in order to avoid confusion with the CSI plugin of the storage provider, the CSI plugin corresponding to the management system of the storage volume may be subsequently referred to as a target CSI plugin. The management method of the storage volume realizes a CSI interface facing Kubernets and upwards carries out Kubernets External Component call; a real back-end storage provider CSI plug-in is downwards butted, a storage provider CSI interface is called according to a strategy to manage the life cycle of the physical volume, and the physical volume is called as a storage volume; the method for managing the storage volume can support the standard CSI plug-ins of all storage providers without invasion, is not limited by binding of storage manufacturers, namely as long as the plug-ins of the storage providers realize the CSI interface, the method for managing the storage volume can manage the storage volume of the CSI plug-ins of the storage providers, and therefore flexible and uniform storage volume management is achieved. In this embodiment, the target CSI plugin and the Kubernetes External Component are deployed in one Pod with the storage provider CSI plugin in a Sidecar mode, the Unix Sock file of the target CSI plugin is exposed to the Kubernetes External Component call in a manner of sharing the EmptyDir volume, and the Unix Sock file of the storage provider CSI plugin can also be exposed to the target CSI plugin call in a manner of sharing the EmptyDir volume. The Kubernetes External Component is provided by Kubernetes Team, monitors events related to storage volume operation of Kubernetes through a Watch mechanism, and calls an interface on a target CSI plug-in Unix Sock.
It should be noted that, before the step of receiving a storage volume management request based on the container cluster, the method further includes:
step A1, receiving an association request based on each container cluster, and creating a database table based on each container cluster;
step A2, creating a storage class based on each container cluster;
step A2, generating preset storage volume information based on the database table and the storage class.
It should be understood that, before step S10, in this embodiment, when an association request sent by associating multiple container clusters is received, database tables such as a cluster table, a cluster federation table, a storage volume declaration table, and a physical volume table are also required to be created in the relational database preset by the target CSI plugin to store volume information of each container cluster. Specifically, the cluster federation table contains an ID of the cluster federation, a comment description, a creation time, a last modification time and a cluster federation name, wherein the ID is used as a unique main key of the table; the cluster table comprises an ID of a Kubernetes cluster, a cluster federal ID, comment description, creation time, final modification time and a cluster name, wherein the cluster ID is used as a unique main key of the table, and the cluster federal ID is the ID of the cluster federal; the PVC table comprises ID, comment description, creation time, last modification time, PVC name, PV name, name space name, belonged cluster ID, physical volume ID and state of the PVC, wherein the ID is used as the only main key of the table; the physical volume table contains the ID of the physical volume, comment description, creation time, last modification time, description content of the volume and access right, wherein the ID is used as a unique primary key of the table. Meanwhile, in this embodiment, the configuration file of the target CSI plugin is created in a ConfigMap form in each kubernets cluster under the cluster federation, where the included information includes distributed lock service connection information, relational database connection information, and a cluster federation characteristic switch, and a field (e.g., enableFedFeature) is added in the ConfigMap configuration file as an identifier to control whether to start a cluster federation default shared storage volume function. The default of the enableFeddfeature field is true, and the meaning of the enableFeddfeature field is that the same back-end physical volume is shared by the same PVC in each cluster under the same name Namespace (name space) under the cluster federation by default; the cluster federation is a cluster group consisting of a plurality of identical Kubernetes clusters, and when an application is released or changed on the cluster federation, each mirror image cluster under the federation does the same operation, so that the mirror image clusters become a high-availability whole. This is the source of demand for cluster federal default shared storage volume functionality.
Further, a storage class (StorageClass) is created in each kubernets cluster under the cluster federation, wherein in addition to necessary information for creating the StorageClass, custom information including a cluster name (clusterName), a PV name prefix (prefix) field and the like is set under the Parameters field, wherein the clusterName field is used for storing a name of a current cluster, and the prefix field is used for storing a prefix of a kubernets PV resource name, and after the storage class (StorageClass) is created in each kubernets cluster under the cluster federation, when a storage volume management request is initiated based on a container cluster in the cluster federation, the target CSI plugin can accurately identify the container cluster initiating the storage volume management request. The obtained database table and the storage class jointly form preset storage volume information of each container cluster, so that after a storage volume management request based on the container cluster is received, whether the storage volume management request is of a cross-cluster type or not is determined based on management parameters in the storage volume management request and the preset storage volume information, and when the storage volume management request is of the cross-cluster type, a storage volume of the cross-cluster type is created or deleted for the container cluster based on a CSI plug-in, and further any storage volume can be flexibly shared.
Meanwhile, PVC is established in each Kubernets cluster, and an annotation (such as a cms-csi-shared-disableDefaultShare) is added under the indexing field of each PVC to serve as a second identifier to disable the function of a cluster federal default shared storage volume aiming at the PVC; and adding another annotation (cmb-csi-shared-volume ID) as the first identification to determine the specific back-end physical volume ID to share. The specific priority of the annotation in this embodiment may be as follows:
the priority of the cmb-csi-shared-volume ID field is highest, when a physical volume item corresponding to the field value can be inquired from a database, the physical volume is returned to complete the shared storage volume creation task, if the inquiry is not successful, the shared volume is failed to be created, and failure information is returned;
when the field is false, the cluster federal default shared storage volume function is closed, and the cmb-csi-shared-disableDefaultShare field does not take effect;
the priority of the cmb-csi-shared-disableDefaultShare field is lowest, and the value of the field is judged only when the function of the cluster federal default shared storage volume is started, namely enableFedFeature is true, so that whether cluster federal default sharing is performed on the PVC is determined.
Further, in step S10, when a user needs to manage storage volumes (including storage volume creation and storage volume deletion) of one or more container clusters in the cluster federation, a storage volume management request may be initiated in the container cluster of the cluster federation, where the storage volume management request may be a storage volume creation request or a storage volume deletion request. That is, the user requests to initiate a storage volume creation request when creating a storage volume, and the user requests to initiate a storage volume deletion request when deleting a storage volume corresponding to a PVC of a certain container cluster. After a user initiates a storage volume management request based on a container cluster, a target CSI plug-in receives a storage volume management request sent by the user, identifies whether the storage volume management request is a storage volume creation request or a storage volume deletion request, determines the type of the storage volume management request based on management parameters in the storage volume management request, and performs corresponding storage volume management according to a corresponding management strategy, so that cross-cluster automatic management of a storage volume is provided based on the CSI storage plug-in.
Step S20, determining whether the storage volume management request is a cross-cluster type based on the management parameters in the storage volume management request and preset storage volume information;
after receiving a storage volume management request based on a container cluster, on one hand, if the storage volume management request is a storage volume creation request, determining whether the storage volume creation request is a cross-cluster type based on storage volume creation parameters corresponding to the storage volume creation request and preset storage volume information. Specifically, a storage volume creation parameter in the storage volume creation request may be acquired, and a first target storage volume statement corresponding to the storage volume creation parameter in a database table of preset storage volume information is determined; determining whether a first target storage volume declares that a target annotation is present and/or whether cluster federated default shared storage volume functionality is disabled; and if the target annotation exists and/or the function of the cluster federal default shared storage volume is not disabled, determining that the storage volume creation request is of a cross-cluster type, and determining each target container cluster of the storage volume to be created by combining a database table in preset storage volume information. More specifically, when determining whether a first target storage volume statement has a target annotation and/or whether cluster federal default shared storage volume functions are disabled, identifying whether a first identifier corresponding to the target annotation and/or a second identifier corresponding to the cluster federal default shared storage volume functions are disabled exist in the first target storage volume statement; if the first identifier and/or the second identifier exist, determining that a target note exists and/or the cluster federated default shared storage volume function is not disabled; if the first identity is not present and the second identity is not present, it is determined that the target annotation is not present and the cluster federated default shared storage volume functionality is disabled.
On the other hand, if the storage volume management request is a storage volume deletion request, whether the storage volume deletion request is of a cross-cluster type is determined based on a storage volume deletion parameter corresponding to the storage volume deletion request and preset storage volume information. Specifically, a volume ID prefix included in a storage volume deletion parameter in a storage volume deletion request is acquired, a second target storage volume statement corresponding to the volume ID prefix in a database table of preset storage volume information is determined, and a target volume ID corresponding to the second target storage volume statement is determined; determining the target number of the third target storage volume statement of the target volume corresponding to the shared target volume ID in the database table according to the target volume ID; and determining whether the storage volume deleting request is of a cross-cluster type according to the target number. More specifically, when determining whether the storage volume deletion request is of a cross-cluster type according to the target number, if the target number is greater than a preset threshold value, determining that the storage volume deletion request is of the cross-cluster type; and if the target number is less than or equal to a preset threshold value, determining that the storage volume deleting request is not in a cross-cluster type.
Whether the storage volume management request is in a cross-cluster type or not is determined through management parameters in the storage volume management request and preset storage volume information, so that a cross-cluster type storage volume is created or deleted for a container cluster based on a CSI plug-in when the storage volume management request is in the cross-cluster type, and cross-cluster automatic management of the storage volume is provided based on the CSI storage plug-in.
Step S30, if the storage volume management request is of a cross-cluster type, creating or deleting a cross-cluster type storage volume for the container cluster based on the CSI plugin.
After determining whether the storage volume management request is of a cross-cluster type or not based on management parameters in the storage volume management request and preset storage volume information, if the storage volume management request is determined to be of the cross-cluster type and is a storage volume creation request, determining that the storage volume creation request corresponds to each target container cluster of the storage volume to be created, and creating a shared storage volume for the container clusters and each target container cluster based on a storage provider CSI plug-in; and if the storage volume management request is of a cross-cluster type and is a storage volume deleting request, deleting a second target storage volume statement by calling a storage provider CSI plug-in, and reserving a target storage volume corresponding to the second target storage volume statement for calling other container clusters sharing the target storage volume.
Specifically, the step of creating or deleting a storage volume across cluster types for the container cluster based on the CSI plugin includes:
step B, if the storage volume management request is a storage volume creation request, determining that the storage volume creation request corresponds to each target container cluster of a storage volume to be created, and creating a shared storage volume for the container cluster and each target container cluster based on the CSI plug-in;
after determining whether the storage volume management request is of a cross-cluster type or not based on management parameters in the storage volume management request and preset storage volume information, if the storage volume management request is determined to be of the cross-cluster type and is a storage volume creation request, determining each target container cluster of the storage volume to be created according to storage volume creation parameters in the storage volume creation request, calling a storage provider CSI plug-in to create a PV for each container cluster and each target container cluster respectively, creating a storage volume, and associating the PVs through the storage volume so that the application of each container cluster is shared when data reading and writing are performed on the storage volume.
And step C, if the storage volume management request is a storage volume deleting request, deleting the second target storage volume statement based on the CSI plug-in, and reserving the target storage volume corresponding to the second target storage volume statement for calling other container clusters sharing the target storage volume.
If the storage volume management request is a cross-cluster type and is a storage volume deletion request, the physical volume ID is used as a distributed lock, and a volume deletion function is executed. When a deleting function of the volume is executed, a PVC (polyvinyl chloride) statement corresponding to the storage volume deleting request, namely a second target storage volume statement, is deleted, and as the storage volume deleting request is of a cross-cluster type, namely other container clusters and the container cluster share the same storage volume, namely a target storage volume, in a cluster federation, a storage provider CSI (channel state information) plug-in is called to delete the PVC corresponding to the storage volume deleting request, and the target storage volume corresponding to the PVC is reserved for calling other container clusters sharing the target storage volume.
It can be understood that, if it is determined that the storage volume management request is not of a cross-cluster type and is a storage volume creation request, the PVC corresponding to the container cluster may be directly created and a backend storage provider CSI plug-in is invoked to create a storage volume uniquely corresponding to the PVC, and a result of creating the storage volume is obtained, that is, the created storage volume cannot be shared by other container clusters. Specifically, a storage provider CSI interface is directly called to create a physical volume, and a UUID is assigned to uniquely represent the physical volume, i.e., a physical volume ID, and the ID and volume-related information are written into a database physical volume table. And meanwhile, allocating a UUID to the PVC, writing PVC information into a database PVC table, and taking the UUID of the PVC as a CSI interface to return a prefix of the VolumeId in the value to Kubernets. And finally, putting the corresponding physical volume ID as a cmb-csi-shared-volume ID annotation into an annotation field in the PVC for use when other PVCs want to share the physical storage volume with the PVC. The value is a long character string generated randomly, and only a user with the PVC access authority can acquire the value by using the authority control of Kubernetes, so that the storage volume sharing is realized through the mechanism, and the design is safe and reliable.
And if the storage volume management request is determined to be not of a cross-cluster type and is a storage volume deletion request, deleting corresponding PVC (polyvinyl chloride) and physical volumes (namely the storage volume) in the database and calling the deletion of the rear-end storage volume as a transaction to execute, and if the deletion is successful, returning a success result, otherwise, returning corresponding error information.
It should be noted that, the specific steps of the flow for creating a volume in this embodiment are as follows:
s1, calling a target CSI plug-in to create a volume interface by the Kubernetes External Component;
s2, acquiring the distributed lock by taking the combination of the cluster federal name, the name space name and the PVC name in the request parameters as the lock name;
s3, in order to ensure idempotency, after acquiring the distributed lock, inquiring whether the volume is created, if so, releasing the distributed lock in S2, and returning the created result in the database;
s4, using the Service Account voucher of the container to access the Kubernets ApiServer to obtain the corresponding PVC object, reading the value corresponding to the cmm-csi-shared-volume ID field under the annotation, namely the UUID of the physical volume, if the value exists, entering S8, and if the value does not exist, entering the step S5;
s5, inquiring whether the cluster federation default sharing function is closed, namely whether enableFedfeature is false, if not, entering S6, otherwise, entering S9;
s6, acquiring a cmb-csi-shared-disableDefaultShare field under the PVC object annotation, judging whether the field is true, and if the field is true, entering S9; otherwise, go to S7;
s7, judging whether PVC with the same cluster federal, the same namespace and the same name exists in the database, if not, entering S9, and if so, entering S8;
s8, judging whether only one UUID of the physical volume in the physical volume table in the database meets the condition, if not, returning error information; if so, acquiring the distributed lock through the UUID, writing new PVC information into the PVC table, inquiring the physical volume table in the database to obtain information corresponding to the physical volume, and returning the information to the Kubernets External Component. Then, the UUID lock and the distributed lock in S2 are released, and the result is returned and the flow ends.
And S9, calling the CSI plug-in of the back-end storage provider to create the physical volume, obtaining the volume creating result, releasing the distributed lock in S2, returning the result and ending the process.
It should be further noted that, in this embodiment, the specific steps of the flow for deleting a volume are as follows:
s1, calling a target CSI plug-in to delete a volume interface by the Kubernetes External Component;
s2, obtaining the ID of the corresponding PVC in the database PVC table through the prefix of the VolumeId in the volume information carried by the request;
s3, acquiring the corresponding physical volume ID through the ID of the PVC, and acquiring the distributed lock by using the physical volume ID as the lock name;
s4, inquiring a database PVC table through the physical volume ID to obtain the number of the PVC sharing the volume, and returning error information if the number is less than 0; if the number is greater than 1, proceed to S5; otherwise, go to S6;
s5, only deleting the PVC ID entry with the ID of S2 in the PVC table, if the deletion is successful, constructing and returning the returned information of the successful deletion, otherwise, returning the failure information, and ending the process;
and S6, taking the deletion of the PVC and the physical volume corresponding to the deleted database and the deletion of the calling back-end storage volume as a transaction to execute, and returning a success result if the deletion is successful, otherwise, returning corresponding error information.
The embodiment provides a management method of a storage volume, which is applied to a management system of the storage volume, wherein the management system of the storage volume is deployed between a container cluster and a CSI plugin, and the management method of the storage volume comprises the following steps: receiving a storage volume management request based on the container cluster, wherein the storage volume management request comprises a storage volume creation request and a storage volume deletion request; determining whether the storage volume management request is of a cross-cluster type or not based on management parameters in the storage volume management request and preset storage volume information; and if the storage volume management request is of a cross-cluster type, creating or deleting a cross-cluster type storage volume for the container cluster based on the CSI plug-in. According to the method and the device, the management system of the storage volume arranged between the container cluster and the CSI plug-in determines the type of the storage volume management request according to the management parameters in the storage volume management request and the storage volume information in the preset database, and can create or delete the cross-cluster type storage volume for the container cluster through the CSI plug-in when the type of the storage volume management request is the cross-cluster type, so that cross-cluster automatic management of the storage volume is provided based on the CSI storage plug-in.
In addition, the storage volume management method solves the problem that the common CSI plug-in cannot realize cross-cluster storage volume sharing and cross-cluster storage volume migration, and enables the storage volume sharing and management to be more flexible and efficient; and the management method of the storage volume has high flexibility, can support the standard CSI plug-ins of all storage suppliers without invasion, and is not limited by the binding of storage manufacturers.
Further, based on the first embodiment of the method for managing a storage volume of the present application, a second embodiment of the method for managing a storage volume of the present application is provided, referring to fig. 2 and 3, and fig. 2 and 3 are a schematic flow diagram of a first scenario and a schematic flow diagram of a second scenario, respectively, in the second embodiment of the method for managing a storage volume of the present application; in a second embodiment, the step of determining whether the storage volume management request is of a cross-cluster type based on the management parameters in the storage volume management request and preset storage volume information includes:
step D, if the storage volume management request is a storage volume creation request, determining whether the storage volume creation request is a cross-cluster type or not based on storage volume creation parameters and preset storage volume information corresponding to the storage volume creation request;
after a storage volume management request based on a container cluster is received, if the storage volume management request is a storage volume creation request, it indicates that a kubernets External Component calls a target CSI plugin of the application to create a volume interface, a PVC of a storage volume creation parameter corresponding to the storage volume creation request is created, specifically, a combination of a cluster federal name, a namespace name, and a PVC name in the storage volume creation parameter may be used as a distributed lock to perform locking, and further, whether a created PVC includes an annotation (for example, a cmb-CSI-shared-volume ID) added in advance according to a requirement is detected, and if the created PVC includes the annotation, a value corresponding to the cmb-CSI-shared-volume ID, that is, a physical volume ID, is further used as a distributed lock to perform a volume creation function after locking. The concurrency issues when creating and deleting PVCs can be solved using distributed locks.
Further, in order to ensure idempotency, after the distributed lock is acquired, whether a storage volume corresponding to the storage volume creation request is created or not is inquired, if the storage volume corresponding to the storage volume creation request is created, the distributed lock is released, and a created result in the database is returned. If the storage volume corresponding to the storage volume creation request is not created, the storage volume creation parameters in the storage volume creation request can be acquired, and a first target storage volume statement corresponding to the storage volume creation parameters in a database table of preset storage volume information is determined; determining whether a first target storage volume declares that a target annotation is present and/or whether cluster federated default shared storage volume functionality is disabled; and if the target annotation exists and/or the function of the cluster federal default shared storage volume is not disabled, determining that the storage volume creation request is of a cross-cluster type, and determining each target container cluster of the storage volume to be created by combining a database table in preset storage volume information. More specifically, when determining whether a first target storage volume statement has a target annotation and/or whether cluster federal default shared storage volume functions are disabled, identifying whether a first identifier corresponding to the target annotation and/or a second identifier corresponding to the cluster federal default shared storage volume functions are disabled exist in the first target storage volume statement; if the first identifier and/or the second identifier exist, determining that a target note exists and/or the cluster federated default shared storage volume function is not disabled; if the first identity is not present and the second identity is not present, it is determined that the target annotation is not present and the cluster federated default shared storage volume functionality is disabled.
Further, the step of determining whether the storage volume creation request is of a cross-cluster type based on the storage volume creation parameter corresponding to the storage volume creation request and preset storage volume information includes:
step D1, acquiring the storage volume creation parameters in the storage volume creation request, and determining a first target storage volume statement corresponding to the storage volume creation parameters in a database table of preset storage volume information;
step D2, determining whether the first target storage volume declares that a target annotation exists and/or whether a cluster federal default shared storage volume function is disabled, wherein the target annotation is used for specifying a unique encoding ID of a back-end physical volume to be shared;
and D3, if the target annotation and/or the function of the cluster federal default shared storage volume is/are not disabled, determining that the storage volume creation request is of a cross-cluster type, and determining each target container cluster of the storage volume to be created by combining a database table in the preset storage volume information.
When whether the storage volume creating request is a cross-cluster type is determined based on storage volume creating parameters corresponding to the storage volume creating request and preset storage volume information, the storage volume creating parameters containing a container cluster Service Account certificate in the storage volume creating request are obtained, and a Kubernets ApiServer is accessed through the Service Account certificate to obtain a PVC object corresponding to the storage volume creating parameters, so that a first target storage volume statement is obtained. After the first target storage volume statement is obtained, whether a target note exists in the first target storage volume statement or whether the cluster federal default shared storage volume function is disabled or whether the cluster federal default shared storage volume function is not disabled while the target note exists is determined. Further, if it is determined that a target annotation exists in the first target storage volume statement, or the function of the cluster federal default shared storage volume is not disabled while the target annotation exists, it is indicated that the request can share the storage volume currently used by other container clusters, or the request can create one storage volume for sharing by a plurality of container clusters, so that the storage volume creation request is determined to be of a cross-cluster type. After the storage volume creation request is determined to be of a cross-cluster type, other container clusters sharing the same storage volume with the container cluster corresponding to the request can be determined to serve as target container clusters by combining a database table in preset storage volume information, association between each target container cluster and the container cluster corresponding to the request is facilitated through the storage volume after the storage volume is created, and the storage volume can be shared by each container cluster.
Further, the step of determining whether the first target storage volume declares that a target annotation is present and/or whether cluster federated default shared storage volume functionality is disabled comprises:
step D21, identifying whether a first identifier corresponding to a target annotation and/or a second identifier corresponding to a function of a forbidden cluster federal default shared storage volume exists in the first target storage volume statement;
step D22, if the first identifier and/or the second identifier exist, determining that the target annotation exists and/or the cluster federated default shared storage volume function is not disabled;
step D23, if the first identifier does not exist and the second identifier does not exist, determining that the target annotation does not exist and disabling cluster federated default shared storage volume functionality.
When determining whether a first target storage volume statement has a target annotation and/or whether a cluster federal default shared storage volume function is disabled, preferentially reading whether a first identifier corresponding to the target annotation exists under an annotation stated by a second target storage volume, for example, in this embodiment, the first identifier may specifically be a value corresponding to an annotation cmb-csi-shared-volume id field, that is, a physical volume UUID; if the first identifier does not exist, further identifying whether a second identifier corresponding to a function of disabling the cluster federated default shared storage volume exists, for example, the second identifier may specifically be an annotation, cmb-csi-shared-disableDefaultShare, in this embodiment. As long as any one of the first identifier and the second identifier exists under the annotation of the second target storage volume statement, it may be determined that a target annotation exists in the first target storage volume statement and/or the cluster federated default shared storage volume function is not disabled, and it may be further determined that the storage volume management request is of a cross-cluster type. And only when the first identifier and the second identifier do not exist under the annotation of the second target storage volume statement, determining that the target annotation does not exist in the first target storage volume statement and the function of the cluster federal default shared storage volume is disabled, and further determining that the storage volume management request is in a non-cross cluster type.
It is to be understood that the step of determining whether the storage volume management request is of a cross-cluster type based on the management parameters in the storage volume management request and the preset storage volume information further includes:
and E, if the storage volume management request is a storage volume deleting request, determining whether the storage volume deleting request is of a cross-cluster type or not based on the storage volume deleting parameters corresponding to the storage volume deleting request and preset storage volume information.
After a storage volume management request based on a container cluster is received, if the storage volume management request is a storage volume deleting request, the Kubernets External Component calls a target CSI plug-in to delete a volume interface of the application, a volume ID prefix contained in a storage volume deleting parameter in the storage volume deleting request is obtained, a second target storage volume statement corresponding to the volume ID prefix in a database table of preset storage volume information is determined, and a target volume ID corresponding to the second target storage volume statement is determined; determining the target number of the third target storage volume statement sharing the target volume corresponding to the target volume ID in the database table according to the target volume ID; and determining whether the storage volume deleting request is of a cross-cluster type according to the target number. Whether the storage volume deleting request is of a cross-cluster type or not is determined through the storage volume deleting parameters corresponding to the storage volume deleting request and preset storage volume information, PVC or PVC and the storage volume thereof specified by a user can be conveniently and accurately deleted subsequently, and cross-cluster automatic management of the storage volume is provided based on a CSI storage plug-in.
Further, the step of determining whether the storage volume deletion request is of a cross-cluster type based on the storage volume deletion parameter corresponding to the storage volume deletion request and preset storage volume information includes:
step E1, obtaining a volume ID prefix included in the storage volume deletion parameter in the storage volume deletion request, determining a second target storage volume statement corresponding to the volume ID prefix in a database table of preset storage volume information, and determining a target volume ID corresponding to the second target storage volume statement;
step E2, determining the target number of the third target storage volume statement of the target volume corresponding to the target volume sharing the target volume ID in the database table;
step E3, determining whether the storage volume deletion request is of a cross-cluster type according to the target number.
The volume information included in the storage volume deletion parameter in the storage volume deletion request is acquired, specifically, a prefix (namely, a volume ID prefix) of a VolumeId included in the storage volume deletion parameter in the storage volume deletion request is acquired, a corresponding PVC is determined as a second target storage volume statement according to the VolumeId prefix, further, an ID corresponding to the second target storage volume statement is determined in a database PVC table, a corresponding physical volume ID is acquired as a target volume ID according to the ID of the second target storage volume statement, and the physical volume ID is used as a lock name to acquire the distributed lock. Further, the physical volume ID is queried in the created relational database, and all PVCs sharing the physical volume in the PVC table of the relational database are queried, so as to obtain the number of PVCs sharing the volume (i.e. the third target storage volume declaration) as the target number. Further, whether the storage volume deleting request is a cross-cluster type or a non-cross-cluster type is determined according to the comparison between the target quantity and a preset threshold value, so that the storage volume is accurately managed according to the type of the storage volume deleting request, and cross-cluster automatic management of the storage volume is provided based on the CSI storage plug-in. The preset threshold is a numerical value set according to actual requirements and used for determining the type of the storage volume deletion request. In this embodiment, the UUID of the PVC in the database table is used as a CSI interface to return the VolumeId prefix in the value to kubernets, and the prefix is designed to solve the problem that when the kubernets delete the PVC, the target CSI plugin cannot determine which corresponding entry in the database PVC table is deleted by the PVC this time. If the prefix is not added, the target CSI plug-in can only obtain the information of the physical volume when processing the PVC deleting task, but the corresponding PVC table entry in the database cannot be correctly deleted because the physical volume and the PVC are in a one-to-many relationship. Therefore, the embodiment can accurately perform automatic management on the storage volume according to the request.
Further, the step of determining whether the storage volume deletion request is of a cross-cluster type according to the target number comprises:
step F, if the target number is larger than a preset threshold value, determining that the storage volume deleting request is of a cross-cluster type;
and G, if the target number is less than or equal to the preset threshold value, determining that the storage volume deleting request is not in a cross-cluster type.
After the target number declared by the third target storage volume of the target volume corresponding to the shared target volume ID in the second target volume information is determined, the target number is compared with a preset threshold value, and the size relation between the target number and the preset threshold value is determined. Further, if it is determined through comparison that the target number is greater than a preset threshold, for example, the preset threshold is 1 in this embodiment, when the target number is greater than 1, it is determined that the storage volume deletion request is of a cross-cluster type; and when the target number is less than 1, determining that the storage volume deleting request is not in a cross-cluster type. It should be further noted that, when the storage volume deletion request is a non-cross cluster type, if the target number is less than 0, then returning error information; if the target number is equal to 0, it indicates that no other container cluster shares the same storage volume with the PVC of the container cluster, so that when the storage volume management is performed, the deletion of the corresponding PVC and physical volume in the database and the deletion of the calling back-end storage volume can be performed as a transaction, and if the transaction is successful, a success result is returned, otherwise, corresponding error information is returned.
It should be noted that, in this embodiment, the priority of the cmb-csi-shared-volume id field is highest, and when a physical volume entry corresponding to the field value can be queried from the database, the physical volume is returned to complete the shared storage volume creation task, and if the query is not successful, the shared volume creation is failed, and failure information is returned. The enabledfeature field is second in priority, when the field is false, the cluster federated default shared storage volume function is closed, and the cmb-csi-shared-disableDefaultShare field does not take effect. The priority of the cmb-csi-shared-disableDefaultShare field is lowest, and the value of the field is judged only when the function of the cluster federal default shared storage volume is started, namely enableFedFeature is true, so that whether cluster federal default sharing is performed on the PVC is determined.
According to the embodiment, whether the storage volume management request is of a cross-cluster type or not can be determined based on the management parameters in the storage volume management request and the preset storage volume information, so that the storage volume can be managed accurately according to the type of the storage volume management request, and cross-cluster automatic management of the storage volume based on the CSI storage plug-in is realized.
For ease of understanding, the present application in one embodiment is explained in terms of a number of specific scenarios to be deployed and used:
assume that the CSI plugin of the present invention has been developed and packaged, compiled into two mirrors, controller and node respectively, and has been pushed to the mirror sharing repository while owning the CSI plugin and storage service provided by the storage provider. Three existing Kubernetes clusters are named as k1, k2 and k3 respectively, and jointly form a cluster federation named as fed, so that the k1, k2 and k3 are mirror clusters, and when applications are deployed or other operations are carried out in the cluster federation, the operations are synchronized to each cluster respectively, so that the three mirror clusters are completely symmetrical.
Firstly, a relational database is created, then each table is created, information of a cluster table and a cluster federal table is initialized according to the information, wherein the cluster table records information of three clusters, and meanwhile, cluster federal IDs of the three clusters in the cluster table are set as IDs of fed rows in the cluster federal table. Then creating a namespace for deploying the plug-in each cluster; two Service accounts are created for the plug-in, and a Service Account cluster administrator authority is given. And then, creating a configmap required by the storage provider plug-in, and then creating a configmap required by the target CSI plug-in the application, wherein the configmap mainly comprises configuration information such as relational database connection, distributed database connection, cluster federation default shared identification bits and the like. And then creating a service based on the packaged images, wherein the controller images are deployed to any one node in a Deployment mode, and the node images are deployed to all nodes in a DaemonSet mode. Establishing a StorageClass, wherein the StorageClass contains information such as sc name, the name of the cluster and the like, and the k1, k2 and k3 clusters are named as k1, k2 and k3 respectively; and at this point, the target CSI plug-in is deployed to the cluster.
Use scenario 1 default cluster federation sharing is turned on: sending a command for creating a PVC (namely a storage volume creation request) to the cluster federation, wherein the command is distributed to each specific cluster, each cluster creates a PVC with the same name at the moment, and creates a corresponding PV through a Kubernets automatic volume mechanism, wherein each cluster has one PV, but the target CSI plug-in of the application does not create a physical volume (namely a storage volume) for each PV, but only creates a physical volume and associates the PVs together, and the application in the three clusters writes data to the storage volume in a shared manner.
Usage scenario 2: default cluster federation sharing is turned off: sending a command for creating a PVC to the cluster federation, wherein the command is distributed to each specific cluster, each cluster creates a PVC at the moment, a corresponding PV is created through a Kubernets automatic volume mechanism, each cluster has a PV, the target CSI plug-in of the application creates a physical volume for each PV respectively, the physical volumes are associated with different back-end storage volumes, and data are independent.
Usage scenario 3: and performing cross-cluster sharing and cross-cluster migration through the cmb-csi-shared-volume ID, wherein the k1 and k2 clusters are not required to belong to the same cluster federation in the scene. Specifically, the first PVC is created in the k1 cluster, at which time we can get the value of the cmb-csi-shared-volume ID field from the annotation of the PVC that has been created; then we create a second PVC in the k2 cluster, and set the value of the cmb-CSI-shared-volume id in the association of the PVCs to the value of the cmb-CSI-shared-volume id field of the first PVC, at this time, the kubernet automatic volume mechanism will create two corresponding PVs, but the target CSI plugin of the present application will not create one physical volume for each PV, but only create one physical volume, and the two PVCs are actually associated with the same physical volume. This enables sharing of storage volumes across clusters. At this time, if the PVC in the k1 cluster is deleted, the PV in the k1 cluster will be deleted by the kubernets automatic volume mechanism, but the target CSI plugin of the present application detects that there are other PVCs, i.e., PVCs in the k2 cluster, using the same physical volume, and therefore, the CSI plugin of the storage provider will not be called to delete the physical volume. At this point, the PVC in the k2 cluster may still use the physical volume. This enables migration of storage volumes across clusters.
Usage scenario 4: the storage volume is shared across Namespace through the cmb-csi-shared-volume ID, and the k1 cluster and the k2 cluster are not required to belong to the same cluster federation in the scene. Specifically, PVC is created in two namespaces in a k1 cluster, a first PVC is created in a first namespace, and at the moment, the value of a cmb-csi-shared-volume ID field can be obtained through the information of the created PVC; then we create a second PVC in the second namespace, the value of the cmb-csi-shared-volume id is the value of the cmb-csi-shared-volume id field of the first PVC, at this time, the kubernets automatic volume mechanism will create two corresponding PVs, but the plug-in of the present invention will not create one physical volume for each PV, only create one physical volume and associate them together, and the two PVCs are associated with the same physical volume.
Usage scenario 5: disabling cluster federation default sharing functionality for a single PVC without shutting down the cluster federation default sharing functionality: a PVC is created in a certain namespace of a k1 cluster, and a PVC with the same name is created under the namespace with the same name of the k2 cluster, and the two PVCs are added with a value of comb-csi-shared-disabled DefaultShare annotation with false in the fields of indications of identities when being created. At this time, the target CSI plugin of the present application will no longer share storage volumes for the two PVCs, but create a physical volume for each PVC.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present application or a part contributing to the prior art may be embodied in the form of a software product, where the computer software product is stored in a storage medium (e.g., a ROM/RAM, a magnetic disk, and an optical disk), and includes a plurality of instructions for enabling a terminal device (which may be a fixed terminal, such as an internet of things smart device including smart homes, such as a smart air conditioner, a smart lamp, a smart power supply, and a smart router, or a mobile terminal, including a smart phone, a wearable networked AR/VR device, a smart sound box, and a network device such as an auto-driven automobile) to execute the method according to the embodiments of the present application.
The above description is only a preferred embodiment of the present application, and not intended to limit the scope of the present application, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the specification and the drawings of the present application, or which are directly or indirectly applied to other related technical fields, are included in the scope of the present application.

Claims (8)

1. The management method of the storage volume is applied to a management system of the storage volume, the management system of the storage volume is deployed between a container cluster and a Container Storage Interface (CSI) plug-in, and the management method of the storage volume comprises the following steps:
receiving a storage volume management request based on the container cluster, wherein the storage volume management request comprises a storage volume creation request and a storage volume deletion request;
determining whether the storage volume management request is of a cross-cluster type or not based on management parameters in the storage volume management request and preset storage volume information;
and if the storage volume management request is of a cross-cluster type, creating or deleting a cross-cluster type storage volume for the container cluster based on the CSI plug-in.
2. The method for managing a storage volume according to claim 1, wherein the step of determining whether the storage volume management request is of a cross-cluster type based on the management parameters in the storage volume management request and preset storage volume information comprises:
if the storage volume management request is a storage volume creation request, determining whether the storage volume creation request is a cross-cluster type or not based on storage volume creation parameters corresponding to the storage volume creation request and preset storage volume information;
if the storage volume management request is a storage volume deletion request, determining whether the storage volume deletion request is of a cross-cluster type or not based on storage volume deletion parameters corresponding to the storage volume deletion request and preset storage volume information.
3. The storage volume management method according to claim 2, wherein the step of determining whether the storage volume creation request is of a cross-cluster type based on the storage volume creation parameter and preset storage volume information corresponding to the storage volume creation request comprises:
acquiring storage volume creation parameters in the storage volume creation request, and determining a first target storage volume statement corresponding to the storage volume creation parameters in a database table of preset storage volume information;
determining whether the first target storage volume declares that a target annotation exists and/or whether cluster federated default shared storage volume functionality is disabled, the target annotation being used to specify a back-end physical volume unique encoding ID to be shared;
and if the target annotation and/or the function of the cluster federal default shared storage volume is not disabled, determining that the storage volume creation request is of a cross-cluster type, and determining each target container cluster of the storage volume to be created by combining a database table in the preset storage volume information.
4. The method of storage volume management according to claim 3, wherein the step of determining whether the first target storage volume states that target annotations are present and/or whether cluster federated default shared storage volume functionality is disabled comprises:
identifying whether a first identifier corresponding to a target annotation and/or a second identifier corresponding to a function of a forbidden cluster federal default shared storage volume exists in the first target storage volume statement;
if the first identifier and/or the second identifier exist, determining that the target annotation exists and/or the function of the cluster federated default shared storage volume is not disabled;
if the first identity is not present and the second identity is not present, determining that the target annotation is not present and disabling cluster federated default shared storage volume functionality.
5. The storage volume management method according to claim 2, wherein the step of determining whether the storage volume deletion request is of a cross-cluster type based on a storage volume deletion parameter corresponding to the storage volume deletion request and preset storage volume information includes:
acquiring a volume ID prefix contained in a storage volume deletion parameter in the storage volume deletion request, determining a second target storage volume statement corresponding to the volume ID prefix in a database table of preset storage volume information, and determining a target volume ID corresponding to the second target storage volume statement;
determining the target number of a third target storage volume statement of a target volume corresponding to the target volume sharing the target volume ID in the database table;
and determining whether the storage volume deleting request is of a cross-cluster type or not according to the target number.
6. The storage volume management method of claim 5, wherein the step of determining whether the storage volume deletion request is of a cross-cluster type based on the target number comprises:
if the target number is larger than a preset threshold value, determining that the storage volume deleting request is of a cross-cluster type;
and if the target number is less than or equal to the preset threshold value, determining that the storage volume deleting request is not in a cross-cluster type.
7. The method for storage volume management according to any of claims 1-6, wherein the step of creating or deleting a storage volume across cluster types for the container cluster based on the CSI plug-in comprises:
if the storage volume management request is a storage volume creation request, determining that the storage volume creation request corresponds to each target container cluster of a storage volume to be created, and creating a shared storage volume for the container cluster and each target container cluster based on the CSI plug-in;
and if the storage volume management request is a storage volume deletion request, deleting the second target storage volume statement based on the CSI plug-in, and reserving the target storage volume corresponding to the second target storage volume statement for calling other container clusters sharing the target storage volume.
8. The method for storage volume management according to claim 1, wherein the step of receiving a storage volume management request based on the container cluster is preceded by the step of:
receiving an association request based on each container cluster, and creating a database table based on each container cluster;
creating a storage class based on each of the container clusters;
and generating preset storage volume information based on the database table and the storage class.
CN202111514118.2A 2021-12-10 2021-12-10 Storage volume management method Active CN114281253B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111514118.2A CN114281253B (en) 2021-12-10 2021-12-10 Storage volume management method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111514118.2A CN114281253B (en) 2021-12-10 2021-12-10 Storage volume management method

Publications (2)

Publication Number Publication Date
CN114281253A true CN114281253A (en) 2022-04-05
CN114281253B CN114281253B (en) 2024-01-26

Family

ID=80872013

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111514118.2A Active CN114281253B (en) 2021-12-10 2021-12-10 Storage volume management method

Country Status (1)

Country Link
CN (1) CN114281253B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114911421A (en) * 2022-05-19 2022-08-16 江苏安超云软件有限公司 Data storage method, system and device based on CSI plug-in and storage medium
CN116010111A (en) * 2023-03-22 2023-04-25 安超云软件有限公司 Cross-cluster resource scheduling method, system and terminal equipment
CN117519613A (en) * 2024-01-08 2024-02-06 之江实验室 Storage volume sharing method and system for k8s clusters

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090327798A1 (en) * 2008-06-27 2009-12-31 Microsoft Corporation Cluster Shared Volumes
CN106210046A (en) * 2016-07-11 2016-12-07 浪潮(北京)电子信息产业有限公司 A kind of volume based on Cinder is across cluster hanging method and system
CN109547537A (en) * 2018-11-05 2019-03-29 中国电子科技集团公司第二十八研究所 The method for realizing openstack High Availabitity based on SAN storage shared volume
CN109714181A (en) * 2017-10-25 2019-05-03 北京航天长峰科技工业集团有限公司 A kind of command dispatching system using micro services framework
CN112445575A (en) * 2020-11-27 2021-03-05 中国工商银行股份有限公司 Multi-cluster resource scheduling method, device and system
CN112925647A (en) * 2021-03-24 2021-06-08 北京金山云网络技术有限公司 Cloud edge coordination system, and control method and device of cluster resources
CN113504954A (en) * 2021-07-08 2021-10-15 华云数据控股集团有限公司 Method, system and medium for calling CSI LVM plug-in, dynamic persistent volume provisioning
CN113609019A (en) * 2021-08-09 2021-11-05 山东乾云启创信息科技股份有限公司 Cross-cluster deployment pipeline method and device for container cloud application
CN113672173A (en) * 2021-07-31 2021-11-19 济南浪潮数据技术有限公司 Storage volume capacity expansion method, system, equipment and readable storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090327798A1 (en) * 2008-06-27 2009-12-31 Microsoft Corporation Cluster Shared Volumes
CN106210046A (en) * 2016-07-11 2016-12-07 浪潮(北京)电子信息产业有限公司 A kind of volume based on Cinder is across cluster hanging method and system
CN109714181A (en) * 2017-10-25 2019-05-03 北京航天长峰科技工业集团有限公司 A kind of command dispatching system using micro services framework
CN109547537A (en) * 2018-11-05 2019-03-29 中国电子科技集团公司第二十八研究所 The method for realizing openstack High Availabitity based on SAN storage shared volume
CN112445575A (en) * 2020-11-27 2021-03-05 中国工商银行股份有限公司 Multi-cluster resource scheduling method, device and system
CN112925647A (en) * 2021-03-24 2021-06-08 北京金山云网络技术有限公司 Cloud edge coordination system, and control method and device of cluster resources
CN113504954A (en) * 2021-07-08 2021-10-15 华云数据控股集团有限公司 Method, system and medium for calling CSI LVM plug-in, dynamic persistent volume provisioning
CN113672173A (en) * 2021-07-31 2021-11-19 济南浪潮数据技术有限公司 Storage volume capacity expansion method, system, equipment and readable storage medium
CN113609019A (en) * 2021-08-09 2021-11-05 山东乾云启创信息科技股份有限公司 Cross-cluster deployment pipeline method and device for container cloud application

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
柳昕;: "综合应用云计算产品,搭建跨地域PaaS云", 信息通信, no. 04 *
田杨锋;王振;: "基于K8s的PaaS架构及业界典型产品的调研分析", 科学技术创新, no. 06 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114911421A (en) * 2022-05-19 2022-08-16 江苏安超云软件有限公司 Data storage method, system and device based on CSI plug-in and storage medium
CN114911421B (en) * 2022-05-19 2023-08-04 江苏安超云软件有限公司 Data storage method, system, device and storage medium based on CSI plug-in
CN116010111A (en) * 2023-03-22 2023-04-25 安超云软件有限公司 Cross-cluster resource scheduling method, system and terminal equipment
CN116010111B (en) * 2023-03-22 2023-12-22 安超云软件有限公司 Cross-cluster resource scheduling method, system and terminal equipment
CN117519613A (en) * 2024-01-08 2024-02-06 之江实验室 Storage volume sharing method and system for k8s clusters

Also Published As

Publication number Publication date
CN114281253B (en) 2024-01-26

Similar Documents

Publication Publication Date Title
CN114281253A (en) Storage volume management method
US20200153706A1 (en) Method and device for terminal device management based on right control
US6742035B1 (en) Directory-based volume location service for a distributed file system
RU2357283C2 (en) Scheme for refreshing connection with network printing device for clients of printer device
CN107105050B (en) Storage and downloading method and system for service objects
CN105700939A (en) Method and system for multi-thread synchronization in distributed system
CN109936571B (en) Mass data sharing method, open sharing platform and electronic equipment
EP2696555B1 (en) Method and system for identifying storage device
JP2007299431A (en) Replication facility
CN109923547B (en) Program behavior monitoring device, distributed object generation management device, storage medium, and program behavior monitoring system
CN107306247B (en) Resource access control method and device
CN111240892A (en) Data backup method and device
CN104793981A (en) Online snapshot managing method and device for virtual machine cluster
CN109032526B (en) Data processing method and device for distributed file system
CN114546563A (en) Multi-tenant page access control method and system
CN111435286A (en) Data storage method, device and system
CN110008006B (en) Container-based big data tool deployment method and system
CN112463203A (en) SELinux management configuration method, system, equipment and medium
CN114710350B (en) Method and device for distributing callable resources, electronic equipment and storage medium
CN112187501A (en) Terminal grouping management method, device, equipment and storage medium
CN114363162A (en) Block chain log generation method and device, electronic equipment and storage medium
CN109525649B (en) Data processing method and device for zookeeper client
CN113259459A (en) Block chain subnet operation state control method and block chain system
CN111541654A (en) User management method and device based on multi-tenant cloud management platform and computer equipment
CN116684282B (en) Method and device for initializing newly-added cloud server and computer equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant