4.6.4. Consuming storage using FlexVolume drivers
You can consume a Fibre Channel volume by using a PersistentVolume object.
Each PersistentVolume object in OpenShift Container Platform represents one storage asset in the storage back-end, such as a volume.
Procedure
Use the
PersistentVolumeobject to reference the installed storage.Persistent volume object definition using FlexVolume drivers example
apiVersion: v1 kind: PersistentVolume metadata: name: pv0001 spec: capacity: storage: 1Gi accessModes: - ReadWriteOnce flexVolume: driver: openshift.com/foo fsType: "ext4" secretRef: foo-secret readOnly: true options: fooServer: 192.168.0.1:1234 fooVolumeName: barwhere:
metadata.name- Specifies the name of the volume. This is how it is identified through persistent volume claims or from pods. This name can be different from the name of the volume on back-end storage.
spec.capacity.storage- Specifies the amount of storage allocated to this volume.
spec.flexVolume.driver- Specifies the name of the driver. This field is mandatory.
spec.flexVolume.fsType- Specifies the file system that is present on the volume. This field is optional.
spec.flexVolume.secretRef- Specifies the reference to a secret. Keys and values from this secret are provided to the FlexVolume driver on invocation. This field is optional.
spec.flexVolume.readOnly- Specifies the read-only flag. This field is optional.
spec.flexVolume.optionsSpecifies the additional options for the FlexVolume driver. In addition to the flags specified by the user in the
optionsfield, the following flags are also passed to the executable:"fsType":"<FS type>", "readwrite":"<rw>", "secret/key1":"<secret1>" "secret/keyN":"<secretN>"
참고Secrets are passed only to mount or unmount call-outs.