May 2018
Intermediate to advanced
554 pages
13h 51m
English
In Chapter 2, Walking through Kubernetes Concepts, we learned how to declare PersistentVolume and PersistentVolumeClaim. With dynamic provisioning, you can define a set of StorageClass with different physical storage backends and use them in PersistentVolume or PersistentVolumeClaim. Let's see how it works.
To check the current default StorageClass, use kubectl get storageclasses command:
# kubectl get storageclassesNAME PROVISIONER AGEstandard (default) kubernetes.io/gce-pd 1h
We can see we have a default storage class named standard and its provisioner is GCE PD.
Let's create a PersistentVolumeClaim request and use the standard StorageClass as the backend:
# cat gke-pvc.yamlapiVersion: v1kind: PersistentVolumeClaimmetadata: ...
Read now
Unlock full access