A cluster turns PersistentVolumeClaims into EZGH storage in your project, made as its cluster bot:
| Block Storage | Files | |
|---|---|---|
| Add-on | blockstore-csi (installed) |
files-csi (optional) |
| StorageClass | ezgh-gp1 (the default) |
Your own, naming your file system |
| Access mode | ReadWriteOnce |
ReadWriteMany |
| Each volume is | A volume | An access point on your file system |
Block Storage volumes
ezgh-gp1 is the default StorageClass. Its volumes are created when the first pod using the claim is
scheduled (WaitForFirstConsumer), and deleted with the claim (reclaimPolicy: Delete). A volume
follows its pod to another node: it’s detached and attached while the cluster runs.
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: data
spec:
accessModes: [ReadWriteOnce]
resources:
requests:
storage: 100Gi-
Volumes are formatted ext4. For xfs, create a StorageClass of your own:
apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: gp1-xfs provisioner: blockstore.csi.ezghcloud.com parameters: type: gp1 csi.storage.k8s.io/fstype: xfs reclaimPolicy: Delete volumeBindingMode: WaitForFirstConsumer allowVolumeExpansion: true -
Claims can be expanded: raise
spec.resources.requests.storage. -
A
VolumeSnapshot(the default VolumeSnapshotClass isezgh-gp1) is a Block Storage snapshot, and a claim can be restored from one. Claims can’t be cloned from another claim: take a snapshot and restore it. -
Every volume is encrypted at rest, as every Block Storage volume is.
-
A node holds as many PersistentVolumes as its instance type’s
limits.volumes, less one for the root volume.
Files volumes
Files volumes can be mounted by many pods on many nodes at once. Create a file system and a
mount target in the node group’s subnet, and add the node subnet’s range to the mount
target’s allowedSourceCidrs: mounts are allowed by network address.
Then add the files-csi add-on:
ezgh kubernetes addons create files-csi --cluster kcl_3k9d0a1m2x7q --waitIt installs the StorageClass ezgh-files, which names no file system. Create a StorageClass of your
own with fileSystem set to yours:
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: shared
provisioner: files.csi.ezghcloud.com
parameters:
fileSystem: fsy_4n8b2v6c1x3z
tls: "true"
reclaimPolicy: Delete
volumeBindingMode: ImmediateapiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: shared
spec:
accessModes: [ReadWriteMany]
storageClassName: shared
resources:
requests:
storage: 100Gi| Parameter | |
|---|---|
fileSystem |
The file system (fsy_…). Required |
tls |
"true" mounts with TLS. Default "false" |
uid, gid |
The owner of each claim’s directory, and the user and group its files are written as. Default 1000 |
directoryPerms |
The mode each claim’s directory is created with. Default 0770 |
- Each claim gets its own access point, exporting the directory
/kubernetes/<PersistentVolume name>of the file system. Deleting the claim deletes the access point but keeps its files on the file system. - Each claim counts against the file system’s access points quota.
- A file system’s size isn’t fixed, so a claim’s requested size isn’t a limit. Claims can’t be expanded, cloned or restored from a snapshot.
- A static PersistentVolume of driver
files.csi.ezghcloud.commounts files that already exist: itsvolumeHandleis a file system (fsy_…), a directory of one (fsy_…:/path) or an access point (fap_…).
When a cluster is deleted
Volumes a cluster created for claims are kept when the cluster is deleted, tagged with the cluster. Delete the claims first to delete their volumes with them.