Creating a PersistentVolumeClaim (PVC)
Create a PersistentVolumeClaim (PVC) YAML file for a Ceph File System (CephFS) persistent volume (PV).
About this task
A PVC is a request for abstract storage resources by a user. The PVC is then be associated to a Pod resource to provision a PV, which is backed with a CephFS image.
- Specify the accessMode with one of the following values:
ReadWriteOnce,ReadWriteMany, orReadOnlyMany. - Be sure to use the same StorageClass as defined in Creating a StorageClass when configuring the storageClassName.
Procedure
What to do next
- Verify that the PVC is in a bound state, by using the kubectl get pvc command.
For example,
host01:.kube$ kubectl get pvc NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS VOLUMEATTRIBUTESCLASS AGE cephfs-pvc-ibm Bound pvc-b6c257c4-3da7-476b-9c0e-3547c1b1952a 10Gi RWX cephfs-storageclass-fuse <unset> 2d3h cephfs-pvc-kernel Bound pvc-f0d96599-7b98-4f56-b4ae-db22fb65c277 20Gi RWX cephfs-storageclass-ibm <unset> 2d3h
- Verify that there are subvolumes in the Ceph cluster.
ceph fs subvolume ls cephfs csiFor example,[root@host01 ceph]# ceph fs subvolume ls cephfs csi [ { "name": "csi-vol-ab1237a9-1fbd-43c1-8b41-0dfd9dc8dee9" }, { "name": "csi-vol-d456149-72b9-4640-abe3-6e4987475dcc" } ]