Create a Persistent Volume Claim
The next step is to create a PersistentVolumeClaim. Pods use Persistent Volume Claims to request physical storage. In this exercise, you create a Persistent Volume Claim that requests a volume of at least three gibibytes that can provide read-write access for at least one Node.
The configuration file specifies that the volume is at /mnt/data on the cluster’s Node. The configuration also specifies a size of 10 gibibytes and an access mode of ReadWriteOnce, which means the volume can be mounted as read-write by a single Node.
It defines the StorageClass name manual for the Persistent Volume, which will be used to bind Persistent Volume Claim requests to this Persistent Volume.
Create the Persistent Volume Claim:Copy the code into a pv-volume-claim.yaml file and run:
kubectl apply -f a pv-volume-claim.yaml
After you create the Persistent Volume Claim, the Kubernetes control plane looks for a Persistent Volume that satisfies the claim’s requirements.
If the control plane finds a suitable Persistent Volume with the same StorageClass, it binds the claim to the volume.
Look again at the Persistent Volume:
kubectl get pv my-pv-volume
Now the output shows a STATUS of
Bound.
Look at the Persistent Volume Claim:
kubectl get pvc my-pv-claim