PersistentVolumes

An illustration of PersistentVolume is shown in the following graph. First, the administrator provisions the specification of a PersistentVolume. Then the consumer requests for storage with PersistentVolumeClaim. Finally, the Pod mounts the volume with the reference of PersistentVolumeClaim:

PersistentVolumeClaims is an abstract layer to decouple volumes for a Pod and physical volume resource

Here is an example using NFS. The administrator needs to provision and allocate PersistentVolume first:

# example of PV with NFS$ cat 2-6-7_pv.yaml  apiVersion: "v1"  kind: "PersistentVolume"  metadata:    name: "pvnfs01"  spec:    capacity:

Get Kubernetes Cookbook, 2nd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.