July 2018
Intermediate to advanced
504 pages
11h 34m
English
The NFS-related PersistentVolume resource that was created by the OpenShift API can be defined using either a YAML or JSON notation and can be submitted to the API by using the oc create command. Previously, we set up several NFS exports on storage.example.com. Now, we need to create the appropriate PV resources for each of them.
The following example provides a file that can make NFS resources available for OpenShift clusters:
# cat pv-nfsvol1.yamlapiVersion: v1kind: PersistentVolumemetadata: name: pv-nfsvol1spec: capacity: storage: 2Gi accessModes: - ReadWriteMany persistentVolumeReclaimPolicy: Retain nfs: path: /exports/nfsvol1 server: storage.example.com readOnly: false
This file contains the following ...