Creating a PersistentVolumeClaim (PVC)

Use this information for PersistentVolumeClaim (PVC) configuration settings.

The IBM block storage CSI driver supports using both file system and raw block volume types.
Use the sections below for yaml creation of PVCs with file system and raw block volume types. After yaml creation, use the kubectl apply command.
$> kubectl apply -f <filename>.yaml
The persistentvolumeclaim/<filename> created message is emitted.

Creating PVC for volume with file system

Create a PVC demo-pvc-file-system.yaml file with the size of 1 Gb.
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: demo-pvc-file-system
spec:
  volumeMode: Filesystem
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi
  storageClassName: gold

Creating PVC for raw block volume

Create a PVC demo-pvc-raw-block yaml file with the size of 1 Gb.
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: demo-pvc-raw-block
spec:
  volumeMode: Block
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi
  storageClassName: gold