Creating a PersistentVolumeClaim (PVC)
Use this information for PersistentVolumeClaim (PVC) configuration settings.
Starting from version 1.1.0, the IBM block storage CSI driver
supports using both file system and raw block volume types.
|
Important: If not defined, the default type is Filesystem. Be sure to define the type as Block if this
configuration is preferred.
|
|
Note: The examples below create the PVC with a storage size 1 Gb. This can be changed,
per customer needs.
|
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.
|
Note: volumeMode is an optional field.
Filesystem is the default if the value is not added.
|
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