4.6.3. Installing FlexVolume drivers
You can implement FlexVolumes by using a list of operations to call and the installation path are all that is required. FlexVolume drivers that are used to extend OpenShift Container Platform are executed only on the node.
Prerequisites
FlexVolume drivers must implement these operations:
initInitializes the driver. It is called during initialization of all nodes.
- Arguments: none
- Executed on: node
- Expected output: default JSON
mountMounts a volume to directory. This can include anything that is necessary to mount the volume, including finding the device and then mounting the device.
-
Arguments:
<mount-dir><json> - Executed on: node
- Expected output: default JSON
-
Arguments:
unmountUnmounts a volume from a directory. This can include anything that is necessary to clean up the volume after unmounting.
-
Arguments:
<mount-dir> - Executed on: node
- Expected output: default JSON
-
Arguments:
mountdeviceMounts a volume’s device to a directory where individual pods can then bind mount.
This call-out does not pass "secrets" specified in the FlexVolume spec. If your driver requires secrets, do not implement this call-out.
-
Arguments:
<mount-dir><json> - Executed on: node
- Expected output: default JSON
-
Arguments:
unmountdeviceUnmounts a volume’s device from a directory.
-
Arguments:
<mount-dir> - Executed on: node
- Expected output: default JSON
-
Arguments:
-
All other operations should return JSON with
{"status": "Not supported"}and exit code1.
Procedure
- Ensure that the executable file exists on all nodes in the cluster.
Place the executable file at the volume plugin path:
/etc/kubernetes/kubelet-plugins/volume/exec/<vendor>~<driver>/<driver>.For example, to install the FlexVolume driver for the storage
foo, place the executable file at:/etc/kubernetes/kubelet-plugins/volume/exec/openshift.com~foo/foo.