July 2018
Intermediate to advanced
504 pages
11h 34m
English
Unlike NFS or GlusterFS persistent volumes, iSCSI volumes can only be accessed from one client/pod at a time. This is a block-based persistent storage and we should provide the file system type we are going to use. In the following example, the ext4 file system will be used:
# cat pv-iscsi.yamlapiVersion: v1kind: PersistentVolumemetadata: name: pv-iscsispec: capacity: storage: 1Gi accessModes: - ReadWriteOnce iscsi: targetPortal: storage.example.com iqn: iqn.2018-04.com.example.storage:disk1 lun: 0 fsType: 'ext4' readOnly: false
Let's create the volume:
# oc create -f pv-iscsi.yamlpersistentvolume "pv-iscsi" created
At the end of the lab, you should have at least three PVs, like the ones shown in the following code:
# oc get ...
Read now
Unlock full access