A PV is a persistent storage volume in a cluster. Same as a node, a PV is a cluster-level resource.
PVs can be mounted to the host system only in the mode supported by underlying storage resources. For example, a file storage system can be read and written by multiple nodes, but an EVS disk can be read and written by only one node.
Storage Type |
ReadWriteOnce |
ReadWriteMany |
---|---|---|
EVS |
√ |
× |
SFS |
× |
√ |
OBS |
× |
√ |
SFS Turbo |
× |
√ |
A PV reclaim policy is used to delete or reclaim underlying volumes when a PVC is deleted. The value can be Delete or Retain.
Everest also allows you to delete a PVC without deleting underlying storage resources. This function can be achieved only by using a YAML file. Set the PV reclaim policy to Delete and add annotations"everest.io/reclaim-policy: retain-volume-only". In this way, when the PVC is deleted, the PV resource is deleted, but the underlying storage resources are retained.
The requirements for creating an EVS volume are as follows:
Using the CCE Console
Using YAML
apiVersion: v1 kind: PersistentVolume metadata: annotations: pv.kubernetes.io/provisioned-by: everest-csi-provisioner everest.io/reclaim-policy: retain-volume-only # (Optional) The PV is deleted while the underlying volume is retained. name: cce-evs-test labels: failure-domain.beta.kubernetes.io/region: eu-de failure-domain.beta.kubernetes.io/zone: eu-de-01 spec: accessModes: - ReadWriteOnce # Access mode. The value is fixed to ReadWriteOnce for EVS. capacity: storage: 10Gi # EVS disk capacity, in the unit of Gi. The value ranges from 1 to 32768. csi: driver: disk.csi.everest.io # Dependent storage driver for the mounting. fsType: ext4 volumeHandle: 459581af-e78c-4356-9e78-eaf9cd8525eb # Volume ID of the EVS disk. volumeAttributes: everest.io/disk-mode: SCSI # Device type of the EVS disk. Only SCSI is supported. everest.io/disk-volume-type: SAS # EVS disk type. storage.kubernetes.io/csiProvisionerIdentity: everest-csi-provisioner everest.io/crypt-key-id: 0992dbda-6340-470e-a74e-4f0db288ed82 # (Optional) Encryption key ID. Mandatory for an encrypted disk. persistentVolumeReclaimPolicy: Delete # Reclain policy. storageClassName: csi-disk # Storage class name. The value must be csi-disk.
Parameter |
Description |
---|---|
everest.io/reclaim-policy: retain-volume-only |
This field is optional. Currently, only retain-volume-only is supported. This field is valid only when the everest version is 1.2.9 or later and the reclaim policy is Delete. If the reclaim policy is Delete and the current value is retain-volume-only, the associated PV is deleted while the underlying storage volume is retained, when a PVC is deleted. |
failure-domain.beta.kubernetes.io/region |
Region where the cluster is located. For details about the value of region, see Regions and Endpoints. |
failure-domain.beta.kubernetes.io/zone |
AZ where the EVS volume is created. It must be the same as the AZ planned for the workload. For details about the value of zone, see Regions and Endpoints. |
volumeHandle |
Volume ID of the EVS disk. To obtain the volume ID, log in to the Cloud Server Console. In the navigation pane, choose Elastic Volume Service > Disks. Click the name of the target EVS disk to go to its details page. On the Summary tab page, click the copy button after ID. |
everest.io/disk-volume-type |
EVS disk type. All letters are in uppercase.
|
everest.io/crypt-key-id |
Encryption key ID. This field is mandatory when the volume is an encrypted volume. |
persistentVolumeReclaimPolicy |
A reclaim policy is supported when the cluster version is equal to or later than 1.19.10 and the everest version is equal to or later than 1.2.9. The Delete and Retain policies are supported. Delete:
Retain: When a PVC is deleted, the PV and underlying storage resources are not deleted. Instead, you must manually delete these resources. After that, the PV resource is in the Released state and cannot be bound to the PVC again. If high data security is required, you are advised to select Retain to prevent data from being deleted by mistake. |
Using YAML
apiVersion: v1 kind: PersistentVolume metadata: annotations: pv.kubernetes.io/provisioned-by: everest-csi-provisioner everest.io/reclaim-policy: retain-volume-only # (Optional) The PV is deleted while the underlying volume is retained. name: cce-sfs-test spec: accessModes: - ReadWriteMany # Access mode. The value must be ReadWriteMany for SFS. capacity: storage: 1Gi # File storage capacity. csi: driver: disk.csi.everest.io # Mount the dependent storage driver. fsType: nfs volumeHandle: 30b3d92a-0bc7-4610-b484-534660db81be # SFS file system ID. volumeAttributes: everest.io/share-export-location: # Shared path of the file storage storage.kubernetes.io/csiProvisionerIdentity: everest-csi-provisioner persistentVolumeReclaimPolicy: Retain # Reclaim policy. storageClassName: csi-nas # Storage class name. The value must be csi-nas for SFS. mountOptions: [] # Mount options
Parameter |
Description |
---|---|
everest.io/reclaim-policy: retain-volume-only |
This field is optional. Currently, only retain-volume-only is supported. This field is valid only when the everest version is 1.2.9 or later and the reclaim policy is Delete. If the reclaim policy is Delete and the current value is retain-volume-only, the associated PV is deleted while the underlying storage volume is retained, when a PVC is deleted. |
volumeHandle |
File system ID. On the management console, choose Service List > Storage > Scalable File Service. In the SFS file system list, click the name of the target file system and copy the content following ID on the page displayed. |
everest.io/share-export-location |
Shared path of the file system. On the management console, choose Service List > Storage > Scalable File Service. You can obtain the shared path of the file system from the Mount Address column. |
mountOptions |
Mount options. If not specified, the following configurations are used by default. For details, see SFS Volume Mount Options. mountOptions: - vers=3 - timeo=600 - nolock - hard |
everest.io/crypt-key-id |
Encryption key ID. This field is mandatory when the volume is an encrypted volume. |
persistentVolumeReclaimPolicy |
A reclaim policy is supported when the cluster version is equal to or later than 1.19.10 and the everest version is equal to or later than 1.2.9. The options are as follows: Delete:
Retain: When a PVC is deleted, the PV and underlying storage resources are not deleted. Instead, you must manually delete these resources. After that, the PV resource is in the Released state and cannot be bound to the PVC again. If high data security is required, you are advised to select Retain to prevent data from being deleted by mistake. |
Secure containers do not support OBS volumes.
A single user can create a maximum of 100 OBS buckets on the console. If you have a large number of CCE workloads and you want to mount an OBS bucket to every workload, you may easily run out of buckets. In this scenario, you are advised to use OBS through the OBS API or SDK and do not mount OBS buckets to the workload on the console.
Using the CCE Console
Using YAML
apiVersion: v1 kind: PersistentVolume metadata: annotations: pv.kubernetes.io/provisioned-by: everest-csi-provisioner everest.io/reclaim-policy: retain-volume-only # (Optional) The PV is deleted while the underlying volume is retained. name: cce-obs-test spec: accessModes: - ReadWriteMany # Access mode. The value must be ReadWriteMany for OBS. capacity: storage: 1Gi # Storage capacity. This parameter is set only to meet the PV format requirements. It can be set to any value. The actual OBS space size is not limited by this value. csi: driver: obs.csi.everest.io # Dependent storage driver for the mounting. fsType: obsfs # OBS file type. volumeHandle: cce-obs-bucket # OBS bucket name. volumeAttributes: everest.io/obs-volume-type: STANDARD everest.io/region: eu-de storage.kubernetes.io/csiProvisionerIdentity: everest-csi-provisioner nodePublishSecretRef: name: test-user namespace: default persistentVolumeReclaimPolicy: Retain # Reclaim policy. storageClassName: csi-obs # Storage class name. The value must be csi-obs for OBS. mountOptions: [] # Mount options.
Parameter |
Description |
---|---|
everest.io/reclaim-policy: retain-volume-only |
This field is optional. Currently, only retain-volume-only is supported. This field is valid only when the everest version is 1.2.9 or later and the reclaim policy is Delete. If the reclaim policy is Delete and the current value is retain-volume-only, the associated PV is deleted while the underlying storage volume is retained, when a PVC is deleted. |
fsType |
File type. The value can be obsfs or s3fs. If the value is s3fs, an OBS bucket is created and mounted using s3fs. If the value is obsfs, an OBS parallel file system is created and mounted using obsfs. You are advised to set this field to obsfs. |
volumeHandle |
OBS bucket name. |
everest.io/obs-volume-type |
Storage class, including STANDARD (standard bucket) and WARM (infrequent access bucket). |
everest.io/region |
Region where the OBS bucket is deployed. For details about the value of region, see Regions and Endpoints. |
nodePublishSecretRef |
Access key (AK/SK) used for mounting the object storage volume. You can use the AK/SK to create a secret and mount it to the PV. For details, see Using a Custom AK/SK to Mount an OBS Volume. |
mountOptions |
Mount options. For details, see OBS Volume Mount Options. |
persistentVolumeReclaimPolicy |
A reclaim policy is supported when the cluster version is equal to or later than 1.19.10 and the everest version is equal to or later than 1.2.9. The Delete and Retain policies are supported. Delete:
Retain: When a PVC is deleted, the PV and underlying storage resources are not deleted. Instead, you must manually delete these resources. After that, the PV resource is in the Released state and cannot be bound to the PVC again. If high data security is required, you are advised to select Retain to prevent data from being deleted by mistake. |
SFS Turbo and the cluster must be in the same VPC.
Using the CCE Console
Using YAML
apiVersion: v1 kind: PersistentVolume metadata: annotations: pv.kubernetes.io/provisioned-by: everest-csi-provisioner name: cce-sfsturbo-test spec: accessModes: - ReadWriteMany # Access mode. The value must be ReadWriteMany for SFS Turbo. capacity: storage: 100.00Gi # SFS Turbo volume capacity. csi: driver: sfsturbo.csi.everest.io # Dependent storage driver for the mounting. fsType: nfs volumeHandle: 6674bd0a-d760-49de-bb9e-805c7883f047 # SFS Turbo volume ID. volumeAttributes: everest.io/share-export-location: 192.168.0.85:/ # Shared path of the SFS Turbo volume. storage.kubernetes.io/csiProvisionerIdentity: everest-csi-provisioner persistentVolumeReclaimPolicy: Retain # Reclaim policy. storageClassName: csi-sfsturbo # Storage class name. The value must be csi-sfsturbo for SFS Turbo. mountOptions: [] # Mount options.
Parameter |
Description |
---|---|
volumeHandle |
SFS Turbo volume ID. You can obtain the ID on the SFS Turbo storage instance details page on the SFS console. |
everest.io/share-export-location |
Shared path of the SFS Turbo volume. |
mountOptions |
Mount options. If not specified, the following configurations are used by default. For details, see SFS Volume Mount Options. mountOptions: - vers=3 - timeo=600 - nolock - hard |
persistentVolumeReclaimPolicy |
A reclaim policy is supported when the cluster version is equal to or later than 1.19.10 and the everest version is equal to or later than 1.2.9. The Delete and Retain policies are supported. Delete:
Retain: When a PVC is deleted, the PV and underlying storage resources are not deleted. Instead, you must manually delete these resources. After that, the PV resource is in the Released state and cannot be bound to the PVC again. If high data security is required, you are advised to select Retain to prevent data from being deleted by mistake. |